rpms/libvirt/devel libvirt-0.6.3-fix-qemu-argv-detection-with-kvm-85.patch, NONE, 1.1 libvirt.spec, 1.133, 1.134

Mark McLoughlin markmc at fedoraproject.org
Thu May 21 10:43:04 UTC 2009


Author: markmc

Update of /cvs/pkgs/rpms/libvirt/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23487

Modified Files:
	libvirt.spec 
Added Files:
	libvirt-0.6.3-fix-qemu-argv-detection-with-kvm-85.patch 
Log Message:
* Thu May 21 2009 Mark McLoughlin <markmc at redhat.com> - 0.6.3-9.fc12
- Fix qemu argv detection with latest qemu (bug #501923)


libvirt-0.6.3-fix-qemu-argv-detection-with-kvm-85.patch:

--- NEW FILE libvirt-0.6.3-fix-qemu-argv-detection-with-kvm-85.patch ---
>From 2b3fcdc378e7bec5c1a78b81632756e92930fd24 Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange at redhat.com>
Date: Mon, 11 May 2009 15:14:24 +0000
Subject: [PATCH 1/1] Fix QEMU ARGV detection with kvm >= 85

---
 src/qemu_conf.c   |   18 ++++++++++++++----
 src/qemu_driver.c |   12 ++----------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 9cb71eb..a57d3ab 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -431,18 +431,28 @@ int qemudExtractVersionInfo(const char *qemu,
         return -1;
 
     char *help = NULL;
-    enum { MAX_HELP_OUTPUT_SIZE = 8192 };
+    enum { MAX_HELP_OUTPUT_SIZE = 1024*64 };
     int len = virFileReadLimFD(newstdout, MAX_HELP_OUTPUT_SIZE, &help);
-    if (len < 0)
+    if (len < 0) {
+        virReportSystemError(NULL, errno, "%s",
+                             _("Unable to read QEMU help output"));
         goto cleanup2;
+    }
 
     if (sscanf(help, "QEMU PC emulator version %u.%u.%u (kvm-%u)",
                &major, &minor, &micro, &kvm_version) != 4)
         kvm_version = 0;
 
-    if (!kvm_version && sscanf(help, "QEMU PC emulator version %u.%u.%u",
-               &major, &minor, &micro) != 3)
+    if (!kvm_version &&
+        sscanf(help, "QEMU PC emulator version %u.%u.%u",
+               &major, &minor, &micro) != 3) {
+        char *eol = strchr(help, '\n');
+        if (eol) *eol = '\0';
+        qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                         _("cannot parse QEMU version number in '%s'"),
+                         help);
         goto cleanup2;
+    }
 
     version = (major * 1000 * 1000) + (minor * 1000) + micro;
 
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 30642d5..bd60b29 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -1391,12 +1391,8 @@ static int qemudStartVMDaemon(virConnectPtr conn,
 
     if (qemudExtractVersionInfo(emulator,
                                 NULL,
-                                &qemuCmdFlags) < 0) {
-        qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                         _("Cannot determine QEMU argv syntax %s"),
-                         emulator);
+                                &qemuCmdFlags) < 0)
         goto cleanup;
-    }
 
     if (qemuPrepareHostDevices(conn, vm->def) < 0)
         goto cleanup;
@@ -3715,12 +3711,8 @@ static int qemudDomainChangeEjectableMedia(virConnectPtr conn,
 
     if (qemudExtractVersionInfo(vm->def->emulator,
                                 NULL,
-                                &qemuCmdFlags) < 0) {
-        qemudReportError(conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
-                         _("Cannot determine QEMU argv syntax %s"),
-                         vm->def->emulator);
+                                &qemuCmdFlags) < 0)
         return -1;
-    }
 
     if (qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE) {
         if (!(devname = qemudDiskDeviceName(conn, newdisk)))
-- 
1.6.0.6



Index: libvirt.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libvirt/devel/libvirt.spec,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -p -r1.133 -r1.134
--- libvirt.spec	21 May 2009 10:35:02 -0000	1.133
+++ libvirt.spec	21 May 2009 10:42:33 -0000	1.134
@@ -55,7 +55,7 @@
 Summary: Library providing a simple API virtualization
 Name: libvirt
 Version: 0.6.3
-Release: 8%{?dist}%{?extra_release}
+Release: 9%{?dist}%{?extra_release}
 License: LGPLv2+
 Group: Development/Libraries
 Source: libvirt-%{version}.tar.gz
@@ -72,6 +72,8 @@ Patch3: libvirt-0.6.3-refresh-qemu-caps.
 Patch4: libvirt-0.6.3-enable-qemu-0-10-migration.patch
 # Don't try to label a disk with no path (e.g. empty cdrom) (bz 499569)
 Patch5: libvirt-0.6.2-fix-nosource-label.patch
+# Fix qemu argv detection with latest qemu (bz 501923)
+Patch6: libvirt-0.6.3-fix-qemu-argv-detection-with-kvm-85.patch
 
 # Patches not for upstream.
 
@@ -232,6 +234,7 @@ of recent versions of Linux (and other O
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 %patch200 -p0
 
@@ -562,6 +565,9 @@ fi
 %endif
 
 %changelog
+* Thu May 21 2009 Mark McLoughlin <markmc at redhat.com> - 0.6.3-9.fc12
+- Fix qemu argv detection with latest qemu (bug #501923)
+
 * Sun May 10 2009 Cole Robinson <crobinso at redhat.com> - 0.6.2-8.fc12
 - Don't try to label a disk with no path (e.g. empty cdrom) (bug #499569)
 




More information about the scm-commits mailing list