psss / rpms / libguestfs

Forked from rpms/libguestfs 5 years ago
Clone

Blame 0001-EPEL-5-Remove-checks-which-fail-with-ancient-qemu.patch

b287e8f
From 8f5ea9ebe047912e1850180926c1baa25830d3f0 Mon Sep 17 00:00:00 2001
89d86ed
From: Richard W.M. Jones <rjones@redhat.com>
89d86ed
Date: Sat, 16 Jun 2012 10:19:39 +0100
b287e8f
Subject: [PATCH 01/33] EPEL 5: Remove checks which fail with ancient qemu.
89d86ed
88f5280
Note that g->app.qemu_version and g->app.qemu_devices will both
89d86ed
be empty strings.
89d86ed
---
88f5280
 configure.ac           |   57 ------------------------------------------------
b03e9cf
 src/launch-appliance.c |   23 +-----------------
b03e9cf
 2 files changed, 2 insertions(+), 78 deletions(-)
89d86ed
89d86ed
diff --git a/configure.ac b/configure.ac
b287e8f
index cf505e4..9f5371b 100644
89d86ed
--- a/configure.ac
89d86ed
+++ b/configure.ac
7dda85d
@@ -697,63 +697,6 @@ This could be a very old version of qemu, or qemu might not be
89d86ed
 working.
89d86ed
 ])
89d86ed
     fi
89d86ed
-
89d86ed
-    AC_MSG_CHECKING([that $QEMU -version works])
89d86ed
-    if $QEMU -version >&AS_MESSAGE_LOG_FD 2>&1; then
89d86ed
-        AC_MSG_RESULT([yes])
89d86ed
-    else
89d86ed
-        AC_MSG_RESULT([no])
89d86ed
-        AC_MSG_FAILURE(
89d86ed
-[$QEMU -version: command failed.
89d86ed
-
89d86ed
-This could be a very old version of qemu, or qemu might not be
89d86ed
-working.
89d86ed
-])
89d86ed
-    fi
89d86ed
-
89d86ed
-    AC_MSG_CHECKING([for $QEMU version >= 1])
89d86ed
-    if $QEMU -version | grep -sq 'version @<:@1-@:>@'; then
89d86ed
-        AC_MSG_RESULT([yes])
89d86ed
-    else
89d86ed
-        AC_MSG_RESULT([no])
89d86ed
-        AC_MSG_FAILURE([$QEMU version must be >= 1.0.])
89d86ed
-    fi
89d86ed
-
88f5280
-    AC_MSG_CHECKING([that $QEMU -nographic -machine accel=kvm:tcg -device ? works])
88f5280
-    if $QEMU -nographic -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then
89d86ed
-        AC_MSG_RESULT([yes])
89d86ed
-    else
89d86ed
-        AC_MSG_RESULT([no])
88f5280
-        AC_MSG_FAILURE([$QEMU -nographic -machine accel=kvm:tcg -device ? doesn't work.])
89d86ed
-    fi
89d86ed
-
89d86ed
-    AC_MSG_CHECKING([for virtio-serial support in $QEMU])
88f5280
-    if $QEMU $QEMU_OPTIONS -nographic -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then
89d86ed
-        AC_MSG_RESULT([yes])
89d86ed
-    else
89d86ed
-        AC_MSG_RESULT([no])
89d86ed
-        AC_MSG_FAILURE(
89d86ed
-[I did not find virtio-serial support in
89d86ed
-$QEMU.
89d86ed
-
89d86ed
-virtio-serial support in qemu or KVM is essential for libguestfs
89d86ed
-to operate.
89d86ed
-
89d86ed
-Usually this means that you have to install a newer version of qemu
89d86ed
-and/or KVM.  Please read the relevant section in the README file for
89d86ed
-more information about this.
89d86ed
-
89d86ed
-You can override this test by setting the environment variable
89d86ed
-vmchannel_test=no
89d86ed
-
89d86ed
-However if you don't have the right support in your qemu, then this
89d86ed
-just delays the pain.
89d86ed
-
89d86ed
-If I am using the wrong qemu or you want to compile qemu from source
89d86ed
-and install it in another location, then you should configure with
89d86ed
-the --with-qemu option.
89d86ed
-])
89d86ed
-    fi
89d86ed
 fi
89d86ed
 
89d86ed
 dnl Enable packet dumps when in verbose mode.  This generates lots
88f5280
diff --git a/src/launch-appliance.c b/src/launch-appliance.c
7dda85d
index 86f8ad8..9fb0bbd 100644
88f5280
--- a/src/launch-appliance.c
88f5280
+++ b/src/launch-appliance.c
aa5ae27
@@ -770,30 +770,11 @@ test_qemu (guestfs_h *g)
b03e9cf
   if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0)
b03e9cf
     goto error;
89d86ed
 
b03e9cf
-  guestfs___cmd_add_arg (cmd2, g->qemu);
b03e9cf
-  guestfs___cmd_add_arg (cmd2, "-nographic");
b03e9cf
-  guestfs___cmd_add_arg (cmd2, "-version");
b03e9cf
-  guestfs___cmd_set_stdout_callback (cmd2, read_all, &g->app.qemu_version,
b03e9cf
-                                     CMD_STDOUT_FLAG_WHOLE_BUFFER);
b03e9cf
-  r = guestfs___cmd_run (cmd2);
b03e9cf
-  if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0)
b03e9cf
-    goto error;
88f5280
+  g->app.qemu_version = safe_strdup (g, "");
b03e9cf
 
b03e9cf
   parse_qemu_version (g);
b03e9cf
 
b03e9cf
-  guestfs___cmd_add_arg (cmd3, g->qemu);
b03e9cf
-  guestfs___cmd_add_arg (cmd3, "-nographic");
b03e9cf
-  guestfs___cmd_add_arg (cmd3, "-machine");
b03e9cf
-  guestfs___cmd_add_arg (cmd3, "accel=kvm:tcg");
b03e9cf
-  guestfs___cmd_add_arg (cmd3, "-device");
b03e9cf
-  guestfs___cmd_add_arg (cmd3, "?");
b03e9cf
-  guestfs___cmd_clear_capture_errors (cmd3);
b03e9cf
-  guestfs___cmd_set_stderr_to_stdout (cmd3);
b03e9cf
-  guestfs___cmd_set_stdout_callback (cmd3, read_all, &g->app.qemu_devices,
b03e9cf
-                                     CMD_STDOUT_FLAG_WHOLE_BUFFER);
b03e9cf
-  r = guestfs___cmd_run (cmd3);
b03e9cf
-  if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0)
b03e9cf
-    goto error;
88f5280
+  g->app.qemu_devices = safe_strdup (g, "");
89d86ed
 
89d86ed
   return 0;
b03e9cf
 
89d86ed
-- 
89d86ed
1.7.4.1
89d86ed