From be9b274df12d03fe2366fdbb58a37f537c3d2ff1 Mon Sep 17 00:00:00 2001 From: Paul Durrant Date: Fri, 16 Dec 2011 14:54:13 +0000 Subject: libxl: Add hvm specific ro and rw nodes. The hvmloader node was created by libxl__create_device_model() but it needs to be moved earlier so that it can parent the new rw generation-id-address node. Signed-off-by: Paul Durrant Signed-off-by: Ian Jackson Committed-by: Ian Jackson Acked-by: Ian Jackson --- tools/libxl/libxl_create.c | 8 ++++++++ tools/libxl/libxl_dm.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index a60f87a604..c0eaff5ef8 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -423,6 +423,10 @@ retry_transaction: libxl__xs_mkdir(gc, t, libxl__sprintf(gc, "%s/control", dom_path), roperm, ARRAY_SIZE(roperm)); + if (info->type == LIBXL_DOMAIN_TYPE_HVM) + libxl__xs_mkdir(gc, t, + libxl__sprintf(gc, "%s/hvmloader", dom_path), + roperm, ARRAY_SIZE(roperm)); libxl__xs_mkdir(gc, t, libxl__sprintf(gc, "%s/control/shutdown", dom_path), @@ -433,6 +437,10 @@ retry_transaction: libxl__xs_mkdir(gc, t, libxl__sprintf(gc, "%s/data", dom_path), rwperm, ARRAY_SIZE(rwperm)); + if (info->type == LIBXL_DOMAIN_TYPE_HVM) + libxl__xs_mkdir(gc, t, + libxl__sprintf(gc, "%s/hvmloader/generation-id-address", dom_path), + rwperm, ARRAY_SIZE(rwperm)); xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string)); xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/name", vm_path), info->name, strlen(info->name)); diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 97d91b454b..3ebd806522 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -827,10 +827,10 @@ int libxl__create_device_model(libxl__gc *gc, goto out; } - path = libxl__sprintf(gc, "/local/domain/%d/hvmloader", info->domid); - xs_mkdir(ctx->xsh, XBT_NULL, path); - libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/bios", path), + path = xs_get_domain_path(ctx->xsh, info->domid); + libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", path), "%s", libxl__domain_bios(gc, info)); + free(path); path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", info->domid); xs_mkdir(ctx->xsh, XBT_NULL, path); -- cgit v1.2.3