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

[Xen-devel] [PATCH] libxl: return an error if connection to xenstore fails



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1291293181 0
# Node ID 41f894c00dc1c969889a5974be8d05361ac5cec2
# Parent  658a68a831c3c336af505f456b475a9936490b91
libxl: return an error if connection to xenstore fails

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 658a68a831c3 -r 41f894c00dc1 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Thu Dec 02 12:33:01 2010 +0000
+++ b/tools/libxl/libxl_device.c        Thu Dec 02 12:33:01 2010 +0000
@@ -429,6 +429,11 @@ int libxl__wait_for_device_model(libxl_c
     char **l = NULL;
 
     xsh = xs_daemon_open();
+    if (xsh == NULL) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unable to open xenstore 
connection");
+        goto err;
+    }
+
     path = libxl__sprintf(&gc, "/local/domain/0/device-model/%d/state", domid);
     xs_watch(xsh, path, path);
     tv.tv_sec = LIBXL_DEVICE_MODEL_START_TIMEOUT;
@@ -469,6 +474,7 @@ again:
     xs_unwatch(xsh, path, path);
     xs_daemon_close(xsh);
     LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model not ready");
+err:
     libxl__free_all(&gc);
     return -1;
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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