diff mbox

Adapt libvirt's Qemu version parser for Qemu 1.0

Message ID 4ED93037.7070902@linux.vnet.ibm.com
State New
Headers show

Commit Message

Stefan Berger Dec. 2, 2011, 8:08 p.m. UTC
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(-)

Comments

Eric Blake Dec. 2, 2011, 8:32 p.m. UTC | #1
On 12/02/2011 01:08 PM, Stefan Berger wrote:
> 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.
Stefan Berger Dec. 2, 2011, 8:52 p.m. UTC | #2
On 12/02/2011 03:32 PM, Eric Blake wrote:
> On 12/02/2011 01:08 PM, Stefan Berger wrote:
>> 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
diff mbox

Patch

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)) {