Skip to contentSkip to conversation

Adapt libvirt's Qemu version parser for Qemu 1.0

PATCH In review Stefan Berger 2 participants 3 messages Dec 2, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Adapt libvirt's Qemu version parser for Qemu 1.0

Qemu 1.0 does not show a micro version like 0.15.50 did. Adapt the Qemu version parser to handle this.

---
 src/qemu/qemu_capabilities.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
src/qemu/qemu_capabilities.c +10 -1
Index: libvirt-tpm/src/qemu/qemu_capabilities.c
===================================================================
@@ -1147,15 +1147,24 @@ int qemuCapsParseHelpStr(const char *qem
     ++p;
 
     minor = virParseNumber(&p);
-    if (minor == -1 || *p != '.')
+    if (minor == -1)
         goto fail;
 
+    if (major == 0 && *p != '.')
+        goto fail;
+
+    if (major > 0 && *p != '.') {
+        micro = 0;
+        goto skip_micro;
+    }
+
     ++p;
 
     micro = virParseNumber(&p);
     if (micro == -1)
         goto fail;
 
+skip_micro:
     SKIP_BLANKS(p);
 
     if (STRPREFIX(p, QEMU_KVM_VER_PREFIX)) {
#1 lore raw
Quoted 6 lines · Stefan Berger

Qemu 1.0 does not show a micro version like 0.15.50 did. Adapt the Qemu version parser to handle this.

---
 src/qemu/qemu_capabilities.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

While this solves the problem, I prefer Jirka's version as being more complete. NACK.

Signature · 2 lines
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#2 lore raw
Quoted 10 lines · Eric Blake
Quoted 6 lines · Stefan Berger

Qemu 1.0 does not show a micro version like 0.15.50 did. Adapt the Qemu version parser to handle this.

---
  src/qemu/qemu_capabilities.c |   11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)

While this solves the problem, I prefer Jirka's version as being more complete. NACK.

No problem.
What's unfortunate about it is that the parser was not flexible to handle it, thus 0.9.8 will presumably be the first version to accept Qemu 1.0.

Stefan