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

[libvirt] [PATCH 5/5] Parallels: add events emiting while creating domain.



---
 src/parallels/parallels_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index cd1baa0..174313b 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -2430,6 +2430,7 @@ parallelsDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
 {
     parallelsConnPtr privconn = domain->conn->privateData;
     virDomainObjPtr privdom = NULL;
+    virObjectEventPtr event = NULL;
     int ret = -1;
 
     virCheckFlags(VIR_DOMAIN_START_PAUSED |
@@ -2457,9 +2458,15 @@ parallelsDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
 
     ret = parallelsStart(privdom);
     if (ret == 0) {
+        event = virDomainEventLifecycleNewFromObj(privdom,
+                                         VIR_DOMAIN_EVENT_STARTED,
+                                         VIR_DOMAIN_EVENT_STARTED_BOOTED);
         virDomainObjSetState(privdom, VIR_DOMAIN_RUNNING,
                              VIR_DOMAIN_RUNNING_BOOTED);
     } else {
+        event = virDomainEventLifecycleNewFromObj(privdom,
+                                         VIR_DOMAIN_EVENT_CRASHED,
+                                         VIR_DOMAIN_EVENT_CRASHED_PANICKED);
         virDomainObjSetState(privdom, VIR_DOMAIN_CRASHED,
                              VIR_DOMAIN_CRASHED_UNKNOWN);
     }
@@ -2469,6 +2476,8 @@ parallelsDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
  cleanup:
     if (privdom)
         virObjectUnlock(privdom);
+    if (event)
+        virObjectEventStateQueue(privconn->domainEventState, event);
 
     return ret;
 }
-- 
1.9.1


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