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

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

 



---
 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 d0f49b9..6a64ef4 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -2433,6 +2433,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 |
@@ -2460,9 +2461,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);
     }
@@ -2472,6 +2479,8 @@ parallelsDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
  cleanup:
     if (privdom)
         virObjectUnlock(privdom);
+    if (event)
+        virObjectEventStateQueue(privconn->domainEventState, event);
 
     return ret;
 }
-- 
1.9.1

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