]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Don't ignore return value of qemuProcessKill
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 27 Sep 2012 09:07:03 +0000 (10:07 +0100)
committerGuido Günther <agx@sigxcpu.org>
Thu, 12 Sep 2013 15:35:31 +0000 (17:35 +0200)
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@redhat.com>
(cherry picked from commit f1b4021b38f9485c50d386af6f682ecfc8025af5)

src/qemu/qemu_driver.c

index 0053ed12acaa8bc5991d0545b604a1b2539e65b6..eefdf75d341fd70f66b8cde64a25ea1b14735f28 100644 (file)
@@ -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