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

[Xen-changelog] [xen-unstable] libxenlight: returns errors if xc and/or

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxenlight: returns errors if xc and/or xs has not been initialized properly.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 08 Jan 2010 04:00:35 -0800
Delivery-date: Fri, 08 Jan 2010 04:01:29 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1262951134 0
# Node ID dda8dc485d67a15af00ff01766118e932a83afd3
# Parent  5254234fdb71d7d77910b1f86e2abfab201e7451
libxenlight: returns errors if xc and/or xs has not been initialized properly.

fixed segfault when xenstore or xc are not available.

Signed-off-by: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |   10 ++++++++++
 1 files changed, 10 insertions(+)

diff -r 5254234fdb71 -r dda8dc485d67 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Fri Jan 08 11:44:58 2010 +0000
+++ b/tools/libxl/libxl.c       Fri Jan 08 11:45:34 2010 +0000
@@ -45,7 +45,17 @@ int libxl_ctx_init(struct libxl_ctx *ctx
         return ERROR_NOMEM;
 
     ctx->xch = xc_interface_open();
+    if (ctx->xch == -1) {
+        free(ctx->alloc_ptrs);
+        return ERROR_FAIL;
+    }
+
     ctx->xsh = xs_daemon_open();
+    if (!ctx->xsh) {
+        xc_interface_close(ctx->xch);
+        free(ctx->alloc_ptrs);
+        return ERROR_FAIL;
+    }
     return 0;
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxenlight: returns errors if xc and/or xs has not been initialized properly., Xen patchbot-unstable <=