[libvirt] [v0.9.12-maint v2 11/12] Don't ignore return value of qemuProcessKill

Guido Günther agx at sigxcpu.org
Thu Sep 12 08:19:08 UTC 2013


From: "Daniel P. Berrange" <berrange at redhat.com>

When calling qemuProcessKill from the virDomainDestroy impl
in QEMU, do not ignore the return value. This ensures that
if QEMU fails to respond to SIGKILL, the caller will know
about the failure.

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
(cherry picked from commit f1b4021b38f9485c50d386af6f682ecfc8025af5)
---
 src/qemu/qemu_driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0053ed1..eefdf75 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1839,7 +1839,11 @@ qemuDomainDestroyFlags(virDomainPtr dom,
             goto cleanup;
         }
     } else {
-        ignore_value(qemuProcessKill(driver, vm, VIR_QEMU_PROCESS_KILL_FORCE));
+        if (qemuProcessKill(driver, vm, VIR_QEMU_PROCESS_KILL_FORCE) < 0) {
+            qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                            _("failed to kill qemu process with SIGTERM"));
+            goto cleanup;
+        }
     }
 
     /* We need to prevent monitor EOF callback from doing our work (and sending
-- 
1.8.4.rc3




More information about the libvir-list mailing list