Skip to contentSkip to conversation

libxl: allow guest to write "control/shutdown" xenstore node

PATCH New Ian Campbell 1 participant 1 message Feb 8, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: allow guest to write "control/shutdown" xenstore node

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1297182367 0
# Node ID a46b91cd8202726aecd9ddefd8e75faff48144d6 # Parent deaa7bc1a7ff6cfad7865394cb8b7205741004c9
libxl: allow guest to write "control/shutdown" xenstore node.

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.

tools/libxl/libxl_create.c +1 -1
diff -r deaa7bc1a7ff -r a46b91cd8202 tools/libxl/libxl_create.c
@@ -290,7 +290,7 @@ int libxl__domain_make(libxl_ctx *ctx, l
     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;