From 54dd7be5855055a698291084c0074a1abac7b921 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 22 Apr 2009 08:46:35 +0100 Subject: [PATCH] Allow selection of qemu using --with-qemu --- README | 12 ++++++++++++ configure.ac | 15 +++++++++++++-- libguestfs.spec.in | 1 + src/guestfs.c | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/README b/README index 86a8f1e..b71eaa8 100644 --- a/README +++ b/README @@ -81,6 +81,18 @@ these commands as root: make install +Note on using KVM +---------------------------------------------------------------------- + +If you are using x86-64, then by default the configure script will +look for qemu-kvm (KVM support). You will need a reasonably recent +processor for this to work. KVM is much faster than using plain QEMU. + +You may also need to enable KVM support for non-root users, by doing: + + chmod o+rw /dev/kvm + + Notes on cross-architecture support ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 6368196..caee197 100644 --- a/configure.ac +++ b/configure.ac @@ -54,8 +54,18 @@ test "x$POD2TEXT" = "xno" && AC_MSG_ERROR([pod2text must be installed]) dnl Check for QEMU for running binaries on this $host_cpu, fall -dnl back to basic 'qemu'. -AC_PATH_PROGS([QEMU],[qemu-system-$host_cpu qemu],[no], +dnl back to basic 'qemu'. Allow the user to override it. +default_qemu="qemu-system-$host_cpu qemu" +# On x86-64, try using KVM first. +if test "x$host_cpu" = "xx86_64"; then + default_qemu="qemu-kvm $default_qemu" +fi +AC_ARG_WITH([qemu], + [AS_HELP_STRING([--with-qemu], + [set default QEMU binary @<:@default=[qemu-kvm] qemu-system- qemu@:>@])], + [], + [with_qemu="$default_qemu"]) +AC_PATH_PROGS([QEMU],[$with_qemu],[no], [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin]) test "x$QEMU" = "xno" && AC_MSG_ERROR([qemu must be installed]) AC_DEFINE_UNQUOTED([QEMU],["$QEMU"],[Location of qemu binary.]) @@ -345,6 +355,7 @@ echo "Thank you for downloading $PACKAGE_STRING" echo echo "This is how we have configured the optional components for you today:" echo +echo "QEMU ................................ $QEMU" echo -n "OCaml bindings ...................... " if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi echo -n "Perl bindings ....................... " diff --git a/libguestfs.spec.in b/libguestfs.spec.in index 84ace5c..fd83769 100644 --- a/libguestfs.spec.in +++ b/libguestfs.spec.in @@ -230,6 +230,7 @@ popd ./configure \ --prefix=%{_prefix} --libdir=%{_libdir} \ --with-java-home=%{java_home} \ + --with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \ %{extra} # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir diff --git a/src/guestfs.c b/src/guestfs.c index 0b3142c..0bec3b7 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -730,7 +730,7 @@ guestfs_launch (guestfs_h *g) add_cmdline (g, "-m"); add_cmdline (g, "384"); /* XXX Choose best size. */ -#if defined(__i386__) || defined(__x86_64) +#if 0 add_cmdline (g, "-no-kqemu"); /* Avoids a warning. */ #endif add_cmdline (g, "-kernel"); -- 1.8.3.1