[libvirt] [PATCH] qemu: Emit event if save fails

Michal Privoznik mprivozn at redhat.com
Mon Nov 5 15:05:39 UTC 2012


When we are doing a (managed-) save of a domain, we stop its processors
firstly. And if the process of saving fails for some reason we try to
wake them up again. However, if this fails, an event should be emitted
so mgmt application can decide what to do.
---

I am not completely sure about combination of event and
event detail, maybe we need to invent a new combination.
Suggestions?  VIR_DOMAIN_EVENT_STOPPED_FAILED means an
hypervisor error which may fit when 'cont' fails.

 src/qemu/qemu_driver.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 978af57..e1c6067 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2990,8 +2990,12 @@ endjob:
                 rc = qemuProcessStartCPUs(driver, vm, dom->conn,
                                           VIR_DOMAIN_RUNNING_SAVE_CANCELED,
                                           QEMU_ASYNC_JOB_SAVE);
-                if (rc < 0)
+                if (rc < 0) {
                     VIR_WARN("Unable to resume guest CPUs after save failure");
+                    event = virDomainEventNewFromObj(vm,
+                                                     VIR_DOMAIN_EVENT_STOPPED,
+                                                     VIR_DOMAIN_EVENT_STOPPED_FAILED);
+                }
             }
         }
         if (qemuDomainObjEndAsyncJob(driver, vm) == 0)
-- 
1.7.8.6




More information about the libvir-list mailing list