WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxl: return an error if connection to xenstore fails
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Thu, 02 Dec 2010 12:35:25 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Thu, 02 Dec 2010 04:36:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libxl: return an error if connection to xenstore fails, Ian Campbell <=