]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: ignore failure of qemu -M ? on older qemu
authorEric Blake <eblake@redhat.com>
Mon, 14 Feb 2011 20:00:22 +0000 (13:00 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 14 Feb 2011 22:33:33 +0000 (15:33 -0700)
https://bugzilla.redhat.com/show_bug.cgi?id=676563

Regression introduced in commit 2211518.

* src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes): Allow
non-zero exit status.

src/qemu/qemu_capabilities.c

index ca7d8420c5a0cdc1d7bbd4a694200c52798b194b..cc5552cc3878c9b5b494e6c04c462d68cd708f5c 100644 (file)
@@ -171,6 +171,7 @@ qemuCapsProbeMachineTypes(const char *binary,
     char *output;
     int ret = -1;
     virCommandPtr cmd;
+    int status;
 
     /* Make sure the binary we are about to try exec'ing exists.
      * Technically we could catch the exec() failure, but that's
@@ -186,7 +187,8 @@ qemuCapsProbeMachineTypes(const char *binary,
     virCommandSetOutputBuffer(cmd, &output);
     virCommandClearCaps(cmd);
 
-    if (virCommandRun(cmd, NULL) < 0)
+    /* Ignore failure from older qemu that did not understand '-M ?'.  */
+    if (virCommandRun(cmd, &status) < 0)
         goto cleanup;
 
     if (qemuCapsParseMachineTypesStr(output, machines, nmachines) < 0)