# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1273563541 -3600
# Node ID 4ede18e45935dcf1a6a4d0824873dbd05a63d148
# Parent 2457ae69bdf53c74daee6b90e6fd02a9c8c029ae
libxl: More cpupool fixes.
Signed-off-by: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
---
tools/libxl/libxl.c | 3 ++-
tools/libxl/libxl_utils.c | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff -r 2457ae69bdf5 -r 4ede18e45935 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Tue May 11 08:37:25 2010 +0100
+++ b/tools/libxl/libxl.c Tue May 11 08:39:01 2010 +0100
@@ -169,7 +169,8 @@ retry_transaction:
xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/uuid", vm_path), uuid_string,
strlen(uuid_string));
xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/name", vm_path), info->name,
strlen(info->name));
- xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name", vm_path),
info->poolname, strlen(info->poolname));
+ if (info->poolname)
+ xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name", vm_path),
info->poolname, strlen(info->poolname));
libxl_xs_writev(ctx, t, dom_path, info->xsdata);
libxl_xs_writev(ctx, t, libxl_sprintf(ctx, "%s/platform", dom_path),
info->platformdata);
diff -r 2457ae69bdf5 -r 4ede18e45935 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Tue May 11 08:37:25 2010 +0100
+++ b/tools/libxl/libxl_utils.c Tue May 11 08:39:01 2010 +0100
@@ -84,6 +84,8 @@ char *libxl_poolid_to_name(struct libxl_
char path[strlen("/local/pool") + 12];
char *s;
+ if (poolid == 0)
+ return "Pool-0";
snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
s = xs_read(ctx->xsh, XBT_NULL, path, &len);
libxl_ptr_add(ctx, s);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|