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

Re: [Xen-devel] [PATCH] libxl: create control/sysrq xenstore node



On Tue, Sep 04, 2018 at 01:39:29PM +0200, Vitaly Kuznetsov wrote:
> 'xl sysrq' command doesn't work with modern Linux guests with the following
> message in guest's log:
> 
>  xen:manage: sysrq_handler: Error -13 writing sysrq in control/sysrq
> 
> xenstore trace confirms:
> 
>  IN 0x24bd9a0 20180904 04:36:32 WRITE (control/sysrq )
>  OUT 0x24bd9a0 20180904 04:36:32 ERROR (EACCES )
> 
> The problem seems to be in the fact that we don't pre-create control/sysrq
> xenstore node and libxl_send_sysrq() doing libxl__xs_printf() creates it as
> read-only. As we want to allow guests to clean 'control/sysrq' after the
> requested action is performed, we need to make this node writable.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>

Hmm... this node isn't documented.

Can you point me to the code in Linux?

> ---
> - Linux code will need to be modified too. With this patch we get something
> like
> 
>  sysrq: SysRq : Emergency Sync
>  xen:manage: Error -34 reading sysrq code in control/sysrq
>  Emergency Sync complete
> 
> This new ERANGE fault happens because after we clean control/sysrq node
> xenstore watch in the guest is re-asserted but the value is empty ("") so
> xenbus_scanf() fails "%c" parsing.
> 
> It seems the feature is long broken.
> ---
>  tools/libxl/libxl_create.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index b7b44e280b..d60f952f73 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -692,6 +692,9 @@ retry_transaction:
>                          GCSPRINTF("%s/control/feature-s4", dom_path),
>                          rwperm, ARRAY_SIZE(rwperm));
>      }
> +    libxl__xs_mknod(gc, t,
> +                    GCSPRINTF("%s/control/sysrq", dom_path),
> +                    rwperm, ARRAY_SIZE(rwperm));
>      libxl__xs_mknod(gc, t,
>                      GCSPRINTF("%s/device/suspend/event-channel", dom_path),
>                      rwperm, ARRAY_SIZE(rwperm));
> -- 
> 2.14.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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