[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] tools: allow user to specify a system qemu-xen binary



commit 5c7cbadaccca8dbb47f2c42ab1b5a8afac9275e3
Author:     Ian Campbell <ian.campbell@xxxxxxxxxx>
AuthorDate: Wed May 15 14:47:32 2013 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed Aug 21 10:39:20 2013 +0100

    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@xxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Makefile               |   20 ++++++++++++--------
 config/Tools.mk.in     |    1 +
 tools/Makefile         |    2 +-
 tools/config.h.in      |    3 +++
 tools/configure        |   41 +++++++++++++++++++++++++++++++++++++++++
 tools/configure.ac     |   21 +++++++++++++++++++++
 tools/libxl/libxl_dm.c |   11 ++++++++++-
 7 files changed, 89 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index a936fbe..2b91537 100644
--- a/Makefile
+++ b/Makefile
@@ -84,8 +84,19 @@ tools/qemu-xen-traditional-dir-force-update:
        $(MAKE) -C tools qemu-xen-traditional-dir-force-update
 endif
 
+ifeq ($(CONFIG_QEMU_XEN),y)
+QEMU_XEN_DIR_TGT := tools/qemu-xen-dir
+
+tools/qemu-xen-dir:
+       $(MAKE) -C tools qemu-xen-dir-find
+
+.PHONY: tools/qemu-xen-dir-force-update
+tools/qemu-xen-dir-force-update:
+       $(MAKE) -C tools qemu-xen-dir-force-update
+endif
+
 ifeq ($(CONFIG_IOEMU),y)
-install-tools: $(QEMU_TRAD_DIR_TARGET) tools/qemu-xen-dir
+install-tools: $(QEMU_TRAD_DIR_TARGET) $(QEMU_XEN_DIR_TARGET)
 endif
 
 .PHONY: install-kernels
@@ -99,13 +110,6 @@ ifeq (x86_64,$(XEN_TARGET_ARCH))
        XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
 endif
 
-tools/qemu-xen-dir:
-       $(MAKE) -C tools qemu-xen-dir-find
-
-.PHONY: tools/qemu-xen-dir-force-update
-tools/qemu-xen-dir-force-update:
-       $(MAKE) -C tools qemu-xen-dir-force-update
-
 .PHONY: tools/firmware/seabios-dir-force-update
 tools/firmware/seabios-dir-force-update:
        $(MAKE) -C tools/firmware seabios-dir-force-update
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 5ec9623..e388e42 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -51,6 +51,7 @@ CONFIG_OVMF         := @ovmf@
 CONFIG_ROMBIOS      := @rombios@
 CONFIG_SEABIOS      := @seabios@
 CONFIG_QEMU_TRAD    := @qemu_traditional@
+CONFIG_QEMU_XEN     := @qemu_xen@
 CONFIG_XEND         := @xend@
 CONFIG_BLKTAP1      := @blktap1@
 
diff --git a/tools/Makefile b/tools/Makefile
index 6fa589b..0531f48 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 f844222..aaa1027 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 7398423..4be39fc 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 9b05478..1f57681 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 615dcf3..4035b6d 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,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.