Bug 591661 - Upstream qemu has changed the version string
Summary: Upstream qemu has changed the version string
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Chris Lalancette
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-12 19:37 UTC by Chris Lalancette
Modified: 2010-07-21 16:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-21 16:48:14 UTC
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.