[PATCH 2/3] libxl: register for domain events immediately after creation

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

 



A small fix for the possiblitiy of jumping to an error path before
registering for domain events, preventing receiving important ones
like shutdown and death.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/libxl/libxl_driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 50fbe5c..99643e3 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -690,6 +690,9 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     }
 
     vm->def->id = domid;
+    if (libxlDomEventsRegister(vm) < 0)
+        goto error;
+
     if ((dom_xml = virDomainDefFormat(vm->def, 0)) == NULL)
         goto error;
 
@@ -700,9 +703,6 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         goto error;
     }
 
-    if (libxlDomEventsRegister(vm) < 0)
-        goto error;
-
     if (libxlDomainSetVcpuAffinities(driver, vm) < 0)
         goto error;
 
-- 
1.8.1.4

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