From: Paul Durrant Date: Mon, 1 Aug 2016 08:57:10 +0000 (+0100) Subject: libxl: create xenstore nodes for control/feature-XXX flags X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~646 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=09a4ef83511ba33e08b3c712497ec0d67a5ec6d7;p=xen.git libxl: create xenstore nodes for control/feature-XXX flags The xenstore-paths documentation specifies various control/feature-XXX flags to allow a guest to tell a toolstack about its abilities to respond to values written to control/shutdown. However, because the parent control xenstore key is created read-only to the guest, unless empty nodes for the feature flags are also created reat/write by the toolstack, the guest will not be able to set any flags. This patch adds code to create all specified feature flag nodes at domain creation time. Signed-off-by: Paul Durrant Cc: Ian Jackson Cc: Wei Liu Acked-by: Wei Liu --- diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index d7db9e9da7..04f8ae987c 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -645,6 +645,23 @@ retry_transaction: libxl__xs_mknod(gc, t, GCSPRINTF("%s/control/shutdown", dom_path), rwperm, ARRAY_SIZE(rwperm)); + libxl__xs_mknod(gc, t, + GCSPRINTF("%s/control/feature-poweroff", dom_path), + rwperm, ARRAY_SIZE(rwperm)); + libxl__xs_mknod(gc, t, + GCSPRINTF("%s/control/feature-reboot", dom_path), + rwperm, ARRAY_SIZE(rwperm)); + libxl__xs_mknod(gc, t, + GCSPRINTF("%s/control/feature-suspend", dom_path), + rwperm, ARRAY_SIZE(rwperm)); + if (info->type == LIBXL_DOMAIN_TYPE_HVM) { + libxl__xs_mknod(gc, t, + GCSPRINTF("%s/control/feature-s3", dom_path), + rwperm, ARRAY_SIZE(rwperm)); + libxl__xs_mknod(gc, t, + GCSPRINTF("%s/control/feature-s4", dom_path), + rwperm, ARRAY_SIZE(rwperm)); + } libxl__xs_mknod(gc, t, GCSPRINTF("%s/device/suspend/event-channel", dom_path), rwperm, ARRAY_SIZE(rwperm));