Bug 591661

Summary: Upstream qemu has changed the version string
Product: [Community] Virtualization Tools Reporter: Chris Lalancette <clalance>
Component: libvirtAssignee: Chris Lalancette <clalance>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, crobinso, Jes.Sorensen, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-21 16:48:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Lalancette 2010-05-12 19:37:24 UTC
Description of problem:
The version string that qemu used to print out looked like:

QEMU PC emulator version x.yy.zz (qemu-kvm-

And libvirt expected this.  Recently (on April 28, qemu commit f75ca1ae205f24dae296c82d534c37746f87232f), this has changed to look like:

QEMU emulator version x.yy.zz (qemu-kvm-

Note the lack of "PC".  We need to update qemudParseHelpStr() to be able to handle this new version.

Comment 1 Chris Lalancette 2010-05-12 19:52:07 UTC
I've got the following patch for this:

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 5fa8c0a..08a2865 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1260,6 +1260,8 @@ static unsigned long long qemudComputeCmdFlags(const char 
  * whether it is KVM QEMU or mainline QEMU.
  */
 #define QEMU_VERSION_STR    "QEMU PC emulator version"
+/* in Qemu 0.13, the version string changed to remove the PC part */
+#define QEMU_VERSION_STR_013 "QEMU emulator version"
 #define QEMU_KVM_VER_PREFIX "(qemu-kvm-"
 #define KVM_VER_PREFIX      "(kvm-"
 
@@ -1277,11 +1279,13 @@ int qemudParseHelpStr(const char *qemu,
 
     *flags = *version = *is_kvm = *kvm_version = 0;
 
-    if (!STRPREFIX(p, QEMU_VERSION_STR))
+    if (STRPREFIX(p, QEMU_VERSION_STR))
+        p += strlen(QEMU_VERSION_STR);
+    else if (STRPREFIX(p, QEMU_VERSION_STR_013))
+        p += strlen(QEMU_VERSION_STR_013);
+    else
         goto fail;
 
-    p += strlen(QEMU_VERSION_STR);
-
     SKIP_BLANKS(p);
 
     major = virParseNumber(&p);


Jes is going to test it out for me and get back to me about it.

Chris Lalancette

Comment 2 Chris Lalancette 2010-05-20 20:06:19 UTC
This is now upstream.  Marking as MODIFIED.

Chris Lalancette