xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libxl: create xenstore nodes for control/feature-XXX flags
@ 2016-08-01  8:57 Paul Durrant
  2016-08-01 14:19 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Durrant @ 2016-08-01  8:57 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Paul Durrant, Ian Jackson

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@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 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 828f254..03b6339 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,
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxl: create xenstore nodes for control/feature-XXX flags
  2016-08-01  8:57 [PATCH] libxl: create xenstore nodes for control/feature-XXX flags Paul Durrant
@ 2016-08-01 14:19 ` Wei Liu
  2016-08-02 16:04   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2016-08-01 14:19 UTC (permalink / raw)
  To: Paul Durrant; +Cc: xen-devel, Ian Jackson, Wei Liu

On Mon, Aug 01, 2016 at 09:57:10AM +0100, Paul Durrant wrote:
> 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@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>

This is in accordance with docs/mis/xenstore-paths.markdown.

Acked-by: Wei Liu <wei.liu2@citrix.com>

> ---
>  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 828f254..03b6339 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,
> -- 
> 2.1.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxl: create xenstore nodes for control/feature-XXX flags
  2016-08-01 14:19 ` Wei Liu
@ 2016-08-02 16:04   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2016-08-02 16:04 UTC (permalink / raw)
  To: Paul Durrant; +Cc: xen-devel, Ian Jackson, Wei Liu

On Mon, Aug 01, 2016 at 03:19:35PM +0100, Wei Liu wrote:
> On Mon, Aug 01, 2016 at 09:57:10AM +0100, Paul Durrant wrote:
> > 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@citrix.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Wei Liu <wei.liu2@citrix.com>
> 
> This is in accordance with docs/mis/xenstore-paths.markdown.
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>

Pushed.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-02 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-01  8:57 [PATCH] libxl: create xenstore nodes for control/feature-XXX flags Paul Durrant
2016-08-01 14:19 ` Wei Liu
2016-08-02 16:04   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).