提交 05dd6741 编写于 作者: J Jim Fehlig 提交者: Eric Blake

Convert libxl driver to Xen 4.2

Based on a patch originally authored by Daniel De Graaf

  http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html

This patch converts the Xen libxl driver to support only Xen >= 4.2.
Support for Xen 4.1 libxl is dropped since that version of libxl is
designated 'technology preview' only and is incompatible with Xen 4.2
libxl.  Additionally, the default toolstack in Xen 4.1 is still xend,
for which libvirt has a stable, functional driver.
(cherry picked from commit dfa1e1dd)

Conflicts:
	src/libxl/libxl_conf.c - commit e5e8d5 not backported
	src/libxl/libxl_driver.c - commit 1c04f999 not backported
上级 d39ef5a0
......@@ -715,16 +715,14 @@ if test "$with_libxl" != "no" ; then
fi
CFLAGS="$CFLAGS $LIBXL_CFLAGS"
LIBS="$LIBS $LIBXL_LIBS"
AC_CHECK_LIB([xenlight], [libxl_domain_create_new], [
AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
with_libxl=yes
LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl"
LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
],[
if test "$with_libxl" = "yes"; then
fail=1
fi
with_libxl=no
],[
-lxenstore -lxenctrl -lxenguest -luuid -lutil -lblktapctl
])
fi
......@@ -732,7 +730,7 @@ LIBS="$old_LIBS"
CFLAGS="$old_CFLAGS"
if test $fail = 1; then
AC_MSG_ERROR([You must install the libxl Library to compile libxenlight driver with -lxl])
AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.2 to compile libxenlight driver with -lxl])
fi
if test "$with_libxl" = "yes"; then
......
......@@ -53,6 +53,14 @@
the <code>/etc/xen</code> directory. It is important not to place
any other non-config files in this directory.
</li>
<li>
<strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
toolstack is deprecated in favor of libxl, also commonly called
libxenlight. libvirt supports this new Xen toolstack via the
libxl driver. If XenD is enabled, the legacy xen driver consisting
of the above mentioned channels will be used. If XenD is disabled,
the libxl driver will be used.
</li>
</ul>
<h2><a name="uri">Connections to Xen driver</a></h2>
......
......@@ -188,8 +188,8 @@
%endif
%endif
# Fedora doesn't have new enough Xen for libxl until F16
%if 0%{?fedora} && 0%{?fedora} < 16
# Fedora doesn't have new enough Xen for libxl until F18
%if 0%{?fedora} && 0%{?fedora} < 18
%define with_libxl 0
%endif
......
此差异已折叠。
......@@ -58,7 +58,7 @@ struct _libxlDriverPrivate {
FILE *logger_file;
xentoollog_logger *logger;
/* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
libxl_ctx ctx;
libxl_ctx *ctx;
virBitmapPtr reservedVNCPorts;
virDomainObjList domains;
......@@ -77,10 +77,8 @@ typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr;
struct _libxlDomainObjPrivate {
/* per domain libxl ctx */
libxl_ctx ctx;
libxl_waiter *dWaiter;
int waiterFD;
int eventHdl;
libxl_ctx *ctx;
libxl_evgen_domain_death *deathW;
};
# define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
......@@ -100,13 +98,11 @@ virCapsPtr
libxlMakeCapabilities(libxl_ctx *ctx);
int
libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_dev,
libxl_device_disk *x_dev);
libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
int
libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
libxl_device_nic *x_nic);
libxlMakeNic(virDomainNetDefPtr l_nic, libxl_device_nic *x_nic);
int
libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
libxlMakeVfb(libxlDriverPrivatePtr driver,
virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
int
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册