All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "Juergen Gross" <jgross@suse.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	xen-devel@lists.xenproject.org,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH] libxl: create control/sysrq xenstore node
Date: Wed, 5 Sep 2018 09:22:03 +0100	[thread overview]
Message-ID: <20180905082203.7ofguktml6qkl4vv@zion.uk.xensource.com> (raw)
In-Reply-To: <87k1o118cc.fsf@vitty.brq.redhat.com>

Also CC Linux maintainers.

On Tue, Sep 04, 2018 at 07:27:31PM +0200, Vitaly Kuznetsov wrote:
> Wei Liu <wei.liu2@citrix.com> writes:
> 
> > 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@redhat.com>
> >
> > Hmm... this node isn't documented.
> >
> 
> But libxl already writes it, see libxl_send_sysrq().

I think your patch is fine.

What I wanted to do is to document this node. :p

> 
> > Can you point me to the code in Linux?
> >
> 
> Sure,
> 
> drivers/xen/manage.c:

Alright, it appears DomU only expects a single character to be written.

I have written the following diff, do you think it is sensible? I
believe this is Linux only, but I have CC Roger for correction.


diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index 60c8b3fbe5..33d281915c 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -410,6 +410,14 @@ by udev ("0") or will be run by the toolstack directly ("1").
 
 ### Platform Feature and Control Paths
 
+#### ~/control/sysrq = (""|COMMAND) [w]
+
+This is the PV SysRq control node. A toolstack can write a single character
+representing a magic SysRq key understood by the Linux kernel.  The guest
+acknowledges a request by writing the empty string back to the command node.
+
+This protocol is Linux only.
+
 #### ~/control/shutdown = (""|COMMAND) [w]
 
 This is the PV shutdown control node. A toolstack can write various


Wei.

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

  reply	other threads:[~2018-09-05  8:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 11:39 [PATCH] libxl: create control/sysrq xenstore node Vitaly Kuznetsov
2018-09-04 16:51 ` Wei Liu
2018-09-04 17:27   ` Vitaly Kuznetsov
2018-09-05  8:22     ` Wei Liu [this message]
2018-09-05 10:12       ` Roger Pau Monné
2018-09-05 10:15       ` Vitaly Kuznetsov
2018-09-05  8:22 ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180905082203.7ofguktml6qkl4vv@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=vkuznets@redhat.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.