[libvirt] [PATCH 9/9] Fix QEMU domain state after a save attempt fails

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

 



When a VM save attempt failed, the VM would be left in a paused
state. It is neccessary to resume CPU execution upon failure
if it was running originally

* src/qemu/qemu_driver.c: Resume CPUs upon save failure
---
 src/qemu/qemu_driver.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 09412f9..f298eac 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4099,6 +4099,16 @@ static int qemudDomainSave(virDomainPtr dom,
     }
 
 endjob:
+    if (ret != 0 && header.was_running) {
+        qemuDomainObjEnterMonitorWithDriver(driver, vm);
+        rc = qemuMonitorStartCPUs(priv->mon, dom->conn);
+        qemuDomainObjExitMonitorWithDriver(driver, vm);
+        if (rc < 0)
+            VIR_WARN0("Unable to resume guest CPUs after save failure");
+        else
+            vm->state = VIR_DOMAIN_RUNNING;
+    }
+
     if (vm &&
         qemuDomainObjEndJob(vm) == 0)
             vm = NULL;
-- 
1.6.6

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