]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
libxl: allow guest to write "control/shutdown" xenstore node.
authorIan Campbell <ian.campbell@citrix.com>
Fri, 11 Feb 2011 17:56:24 +0000 (17:56 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 11 Feb 2011 17:56:24 +0000 (17:56 +0000)
The PV shutdown/reboot/suspend protocol requires that the guest
acknowledge a request by clearing the node therefore it is necessary
to allow the guest to write to the node.

Currently libxl is quite relaxed about this protocol and doesn't
reeally seem to mind that the guest is unable to write the node to
perform the acknowledgement. However in a followup patch libxl needs
to be able to detect that a guest has acknowledged a suspend request.

A side effect of this change is that an empty "control/shutdown" node
is created upon domain creation instead of only being created when a
shutdown/reboot/suspend is requested. This should not (and does not
in my tests) have any negative impact on the guest.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_create.c

index 260d3c0a91319ae7302d9d5ebbd82969e1d4e235..d94480e8014a71a379583339dc3b176762e6a8e1 100644 (file)
@@ -287,7 +287,7 @@ int libxl__domain_make(libxl_ctx *ctx, libxl_domain_create_info *info,
     libxl__gc gc = LIBXL_INIT_GC(ctx); /* fixme: should be done by caller */
     int flags, ret, i, rc;
     char *uuid_string;
-    char *rw_paths[] = { "device", "device/suspend/event-channel" , "data"};
+    char *rw_paths[] = { "control/shutdown", "device", "device/suspend/event-channel" , "data"};
     char *ro_paths[] = { "cpu", "memory", "device", "error", "drivers",
                          "control", "attr", "messages" };
     char *dom_path, *vm_path;