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

[Xen-devel] [XEN PATCH] libxl: fix cleanup bug in initiate_domain_create()

In case of errors, we immediately call domcreate_complete()
which cleans up the console_xswait object. Make sure it is initialized
before we start cleanup.

Signed-off-by: Paweł Marczewski <pawel@xxxxxxxxxxxxxxxxxxxxxx>
This is a follow up to my previous patch, 'libxl: wait for console path before
firing console_available'. We discovered the bug when running integration tests
for Qubes OS (and verified that this patch helps). Sorry for the trouble.

 tools/libxl/libxl_create.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index ada942bc8d..fc36c4263d 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1102,6 +1102,8 @@ static void initiate_domain_create(libxl__egc *egc,
     libxl_domain_config *const d_config = dcs->guest_config;
     const int restore_fd = dcs->restore_fd;
+    libxl__xswait_init(&dcs->console_xswait);
     domid = dcs->domid;
@@ -1153,8 +1155,6 @@ static void initiate_domain_create(libxl__egc *egc,
     if (ret)
         goto error_out;
-    libxl__xswait_init(&dcs->console_xswait);
     if (restore_fd >= 0 || dcs->soft_reset) {
         LOGD(DEBUG, domid, "restoring, not running bootloader");
         domcreate_bootloader_done(egc, &dcs->bl, 0);

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.