Re: [PATCH] qemu: ignore failure of qemu -M ? on older qemu

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

 



On 02/14/2011 03:02 PM, Eric Blake wrote:
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 |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index ca7d842..cc5552c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -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)

ACK. The older code printed a warning on non-zero exit, but didn't fail, so this is proper.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]