[PATCH 4/4] qemu: dump: Resume CPUs only when the VM is still alive

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

 



Check if the VM is alive after we possibly called into monitor to reset
the guest.
---
 src/qemu/qemu_driver.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f0e8994..9765af5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3683,15 +3683,17 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom,
             qemuDomainObjExitMonitor(driver, vm);
         }

-        if (resume && qemuProcessStartCPUs(driver, vm, dom->conn,
-                                           VIR_DOMAIN_RUNNING_UNPAUSED,
-                                           QEMU_ASYNC_JOB_DUMP) < 0) {
-            event = virDomainEventLifecycleNewFromObj(vm,
-                                             VIR_DOMAIN_EVENT_SUSPENDED,
-                                             VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
-            if (virGetLastError() == NULL)
-                virReportError(VIR_ERR_OPERATION_FAILED,
-                               "%s", _("resuming after dump failed"));
+        if (resume && virDomainObjIsActive(vm)) {
+            if (qemuProcessStartCPUs(driver, vm, dom->conn,
+                                     VIR_DOMAIN_RUNNING_UNPAUSED,
+                                     QEMU_ASYNC_JOB_DUMP) < 0) {
+                event = virDomainEventLifecycleNewFromObj(vm,
+                                                          VIR_DOMAIN_EVENT_SUSPENDED,
+                                                          VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
+                if (virGetLastError() == NULL)
+                    virReportError(VIR_ERR_OPERATION_FAILED,
+                                   "%s", _("resuming after dump failed"));
+            }
         }
     }

-- 
2.0.2

--
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]