[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] 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(-)

Index: libvirt-tpm/src/qemu/qemu_capabilities.c
===================================================================
--- libvirt-tpm.orig/src/qemu/qemu_capabilities.c
+++ 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)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]