[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxenlight: returns errors if xc and/or xs has not been initialized properly.
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |