[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxl: create xenstore nodes for control/feature-XXX flags



commit 09a4ef83511ba33e08b3c712497ec0d67a5ec6d7
Author:     Paul Durrant <paul.durrant@xxxxxxxxxx>
AuthorDate: Mon Aug 1 09:57:10 2016 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Tue Aug 2 17:03:10 2016 +0100

    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 <paul.durrant@xxxxxxxxxx>
    Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl_create.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index d7db9e9..04f8ae9 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -646,6 +646,23 @@ retry_transaction:
                     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));
     libxl__xs_mknod(gc, t,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.