diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2013-05-15 14:47:32 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-08-21 10:39:20 +0100 |
commit | 5c7cbadaccca8dbb47f2c42ab1b5a8afac9275e3 (patch) | |
tree | 0f3fa769942ff67d46cb9cd6fd5dc412c6cb6656 /tools | |
parent | b0f69ec5c71de1248d915c193b57c43e786857dd (diff) | |
download | xen-5c7cbadaccca8dbb47f2c42ab1b5a8afac9275e3.tar.gz xen-5c7cbadaccca8dbb47f2c42ab1b5a8afac9275e3.tar.bz2 xen-5c7cbadaccca8dbb47f2c42ab1b5a8afac9275e3.zip |
tools: allow user to specify a system qemu-xen binary
If this option is given don't bother building qemu-xen ourselves. Likely to be
handy for distros who have an existing qemu package which they want to reuse.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile | 2 | ||||
-rw-r--r-- | tools/config.h.in | 3 | ||||
-rwxr-xr-x | tools/configure | 41 | ||||
-rw-r--r-- | tools/configure.ac | 21 | ||||
-rw-r--r-- | tools/libxl/libxl_dm.c | 11 |
5 files changed, 76 insertions, 2 deletions
diff --git a/tools/Makefile b/tools/Makefile index 6fa589b09c..0531f48a84 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -29,7 +29,7 @@ SUBDIRS-$(CONFIG_Linux) += libvchan # do not recurse in to a dir we are about to delete ifneq "$(MAKECMDGOALS)" "distclean" SUBDIRS-$(CONFIG_QEMU_TRAD) += qemu-xen-traditional-dir -SUBDIRS-$(CONFIG_IOEMU) += qemu-xen-dir +SUBDIRS-$(CONFIG_QEMU_XEN) += qemu-xen-dir endif SUBDIRS-y += xenpmd diff --git a/tools/config.h.in b/tools/config.h.in index f84422213f..aaa10275ec 100644 --- a/tools/config.h.in +++ b/tools/config.h.in @@ -75,6 +75,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Qemu Xen path */ +#undef QEMU_XEN_PATH + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS diff --git a/tools/configure b/tools/configure index 739842381c..4be39fca34 100755 --- a/tools/configure +++ b/tools/configure @@ -654,6 +654,7 @@ APPEND_LIB APPEND_INCLUDES PREPEND_LIB PREPEND_INCLUDES +qemu_xen qemu_traditional blktap1 xend @@ -736,6 +737,7 @@ enable_debug enable_xend enable_blktap1 enable_qemu_traditional +with_system_qemu ' ac_precious_vars='build_alias host_alias @@ -1400,6 +1402,14 @@ Optional Features: Enable qemu traditional device model, (DEFAULT is on for x86, otherwise off) +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-system-qemu[=PATH] + Use system supplied qemu PATH or qemu (taken from + $PATH) as qemu-xen device model instead of building + and installing our own version + Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -3686,6 +3696,37 @@ fi +# Check whether --with-system-qemu was given. +if test "${with_system_qemu+set}" = set; then : + withval=$with_system_qemu; + case $withval in + yes) qemu_xen=n ; qemu_xen_path=qemu ;; + no) qemu_xen=y ; qemu_xen_path= ;; + *) qemu_xen=n ; qemu_xen_path=$withval ;; + esac + +else + + case "$host_cpu" in + i[3456]86|x86_64) + qemu_xen=y;; + *) qemu_xen=n;; + esac + +fi + +if test "x$qemu_xen" = "xn"; then : + + +cat >>confdefs.h <<_ACEOF +#define QEMU_XEN_PATH "$qemu_xen_path" +_ACEOF + + +fi + + + diff --git a/tools/configure.ac b/tools/configure.ac index 9b05478083..1f576819a8 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -76,6 +76,27 @@ AC_DEFINE([HAVE_QEMU_TRADITIONAL], [1], [Qemu traditional enabled]) ]) AC_SUBST(qemu_traditional) +AC_ARG_WITH([system-qemu], + AS_HELP_STRING([--with-system-qemu@<:@=PATH@:>@], + [Use system supplied qemu PATH or qemu (taken from $PATH) as qemu-xen + device model instead of building and installing our own version]),[ + case $withval in + yes) qemu_xen=n ; qemu_xen_path=qemu ;; + no) qemu_xen=y ; qemu_xen_path= ;; + *) qemu_xen=n ; qemu_xen_path=$withval ;; + esac +],[ + case "$host_cpu" in + i[[3456]]86|x86_64) + qemu_xen=y;; + *) qemu_xen=n;; + esac +]) +AS_IF([test "x$qemu_xen" = "xn"], [ + AC_DEFINE_UNQUOTED([QEMU_XEN_PATH], ["$qemu_xen_path"], [Qemu Xen path]) +]) +AC_SUBST(qemu_xen) + AC_ARG_VAR([PREPEND_INCLUDES], [List of include folders to prepend to CFLAGS (without -I)]) AC_ARG_VAR([PREPEND_LIB], diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 615dcf3945..4035b6db62 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -33,6 +33,15 @@ const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid) return libxl__sprintf(gc, "/var/lib/xen/qemu-save.%d", domid); } +static const char *qemu_xen_path(libxl__gc *gc) +{ +#ifdef QEMU_XEN_PATH + return QEMU_XEN_PATH; +#else + return libxl__abs_path(gc, "qemu-system-i386", libxl__libexec_path()); +#endif +} + const char *libxl__domain_device_model(libxl__gc *gc, const libxl_domain_build_info *info) { @@ -50,7 +59,7 @@ const char *libxl__domain_device_model(libxl__gc *gc, dm = libxl__abs_path(gc, "qemu-dm", libxl__libexec_path()); break; case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: - dm = libxl__abs_path(gc, "qemu-system-i386", libxl__libexec_path()); + dm = qemu_xen_path(gc); break; default: LIBXL__LOG(ctx, LIBXL__LOG_ERROR, |