* [PATCH] xen/manage: don't complain about an empty value in control/sysrq node
@ 2018-09-06 11:26 Vitaly Kuznetsov
0 siblings, 0 replies; 6+ messages in thread
From: Vitaly Kuznetsov @ 2018-09-06 11:26 UTC (permalink / raw)
To: xen-devel; +Cc: Juergen Gross, Boris Ostrovsky, Wei Liu, linux-kernel
When guest receives a sysrq request from the host it acknowledges it by
writing '\0' to control/sysrq xenstore node. This, however, make xenstore
watch fire again but xenbus_scanf() fails to parse empty value with "%c"
format string:
sysrq: SysRq : Emergency Sync
Emergency Sync complete
xen:manage: Error -34 reading sysrq code in control/sysrq
Ignore -ERANGE the same way we already ignore -ENOENT, empty value in
control/sysrq is totally legal.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
This is a follow-up to my Xen toolstack patch:
https://lists.xenproject.org/archives/html/xen-devel/2018-09/msg00266.html
without it we're seeing -EPERM on write and the issue I'm trying to address
here stays hidden.
---
drivers/xen/manage.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index c93d8ef8df34..5bb01a62f214 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -280,9 +280,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path,
/*
* The Xenstore watch fires directly after registering it and
* after a suspend/resume cycle. So ENOENT is no error but
- * might happen in those cases.
+ * might happen in those cases. ERANGE is observed when we get
+ * an empty value (''), this happens when we acknowledge the
+ * request by writing '\0' below.
*/
- if (err != -ENOENT)
+ if (err != -ENOENT && err != -ERANGE)
pr_err("Error %d reading sysrq code in control/sysrq\n",
err);
xenbus_transaction_end(xbt, 1);
--
2.14.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] xen/manage: don't complain about an empty value in control/sysrq node
2018-09-06 11:26 Vitaly Kuznetsov
2018-09-06 13:00 ` Wei Liu
2018-09-06 13:00 ` Wei Liu
@ 2018-09-06 19:41 ` Boris Ostrovsky
2018-09-06 19:41 ` Boris Ostrovsky
3 siblings, 0 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2018-09-06 19:41 UTC (permalink / raw)
To: Vitaly Kuznetsov, xen-devel; +Cc: linux-kernel, Juergen Gross, Wei Liu
On 09/06/2018 07:26 AM, Vitaly Kuznetsov wrote:
> When guest receives a sysrq request from the host it acknowledges it by
> writing '\0' to control/sysrq xenstore node. This, however, make xenstore
> watch fire again but xenbus_scanf() fails to parse empty value with "%c"
> format string:
>
> sysrq: SysRq : Emergency Sync
> Emergency Sync complete
> xen:manage: Error -34 reading sysrq code in control/sysrq
>
> Ignore -ERANGE the same way we already ignore -ENOENT, empty value in
> control/sysrq is totally legal.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>
Applied to for-linus-19b.
-boris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen/manage: don't complain about an empty value in control/sysrq node
2018-09-06 11:26 Vitaly Kuznetsov
` (2 preceding siblings ...)
2018-09-06 19:41 ` Boris Ostrovsky
@ 2018-09-06 19:41 ` Boris Ostrovsky
3 siblings, 0 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2018-09-06 19:41 UTC (permalink / raw)
To: Vitaly Kuznetsov, xen-devel; +Cc: Juergen Gross, Wei Liu, linux-kernel
On 09/06/2018 07:26 AM, Vitaly Kuznetsov wrote:
> When guest receives a sysrq request from the host it acknowledges it by
> writing '\0' to control/sysrq xenstore node. This, however, make xenstore
> watch fire again but xenbus_scanf() fails to parse empty value with "%c"
> format string:
>
> sysrq: SysRq : Emergency Sync
> Emergency Sync complete
> xen:manage: Error -34 reading sysrq code in control/sysrq
>
> Ignore -ERANGE the same way we already ignore -ENOENT, empty value in
> control/sysrq is totally legal.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>
Applied to for-linus-19b.
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen/manage: don't complain about an empty value in control/sysrq node
2018-09-06 11:26 Vitaly Kuznetsov
2018-09-06 13:00 ` Wei Liu
@ 2018-09-06 13:00 ` Wei Liu
2018-09-06 19:41 ` Boris Ostrovsky
2018-09-06 19:41 ` Boris Ostrovsky
3 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2018-09-06 13:00 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: xen-devel, linux-kernel, Boris Ostrovsky, Juergen Gross, Wei Liu
On Thu, Sep 06, 2018 at 01:26:08PM +0200, Vitaly Kuznetsov wrote:
> When guest receives a sysrq request from the host it acknowledges it by
> writing '\0' to control/sysrq xenstore node. This, however, make xenstore
> watch fire again but xenbus_scanf() fails to parse empty value with "%c"
> format string:
>
> sysrq: SysRq : Emergency Sync
> Emergency Sync complete
> xen:manage: Error -34 reading sysrq code in control/sysrq
>
> Ignore -ERANGE the same way we already ignore -ENOENT, empty value in
> control/sysrq is totally legal.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen/manage: don't complain about an empty value in control/sysrq node
2018-09-06 11:26 Vitaly Kuznetsov
@ 2018-09-06 13:00 ` Wei Liu
2018-09-06 13:00 ` Wei Liu
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2018-09-06 13:00 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: Juergen Gross, xen-devel, Boris Ostrovsky, Wei Liu, linux-kernel
On Thu, Sep 06, 2018 at 01:26:08PM +0200, Vitaly Kuznetsov wrote:
> When guest receives a sysrq request from the host it acknowledges it by
> writing '\0' to control/sysrq xenstore node. This, however, make xenstore
> watch fire again but xenbus_scanf() fails to parse empty value with "%c"
> format string:
>
> sysrq: SysRq : Emergency Sync
> Emergency Sync complete
> xen:manage: Error -34 reading sysrq code in control/sysrq
>
> Ignore -ERANGE the same way we already ignore -ENOENT, empty value in
> control/sysrq is totally legal.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] xen/manage: don't complain about an empty value in control/sysrq node
@ 2018-09-06 11:26 Vitaly Kuznetsov
2018-09-06 13:00 ` Wei Liu
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Vitaly Kuznetsov @ 2018-09-06 11:26 UTC (permalink / raw)
To: xen-devel; +Cc: linux-kernel, Boris Ostrovsky, Juergen Gross, Wei Liu
When guest receives a sysrq request from the host it acknowledges it by
writing '\0' to control/sysrq xenstore node. This, however, make xenstore
watch fire again but xenbus_scanf() fails to parse empty value with "%c"
format string:
sysrq: SysRq : Emergency Sync
Emergency Sync complete
xen:manage: Error -34 reading sysrq code in control/sysrq
Ignore -ERANGE the same way we already ignore -ENOENT, empty value in
control/sysrq is totally legal.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
This is a follow-up to my Xen toolstack patch:
https://lists.xenproject.org/archives/html/xen-devel/2018-09/msg00266.html
without it we're seeing -EPERM on write and the issue I'm trying to address
here stays hidden.
---
drivers/xen/manage.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index c93d8ef8df34..5bb01a62f214 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -280,9 +280,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path,
/*
* The Xenstore watch fires directly after registering it and
* after a suspend/resume cycle. So ENOENT is no error but
- * might happen in those cases.
+ * might happen in those cases. ERANGE is observed when we get
+ * an empty value (''), this happens when we acknowledge the
+ * request by writing '\0' below.
*/
- if (err != -ENOENT)
+ if (err != -ENOENT && err != -ERANGE)
pr_err("Error %d reading sysrq code in control/sysrq\n",
err);
xenbus_transaction_end(xbt, 1);
--
2.14.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-09-06 19:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 11:26 [PATCH] xen/manage: don't complain about an empty value in control/sysrq node Vitaly Kuznetsov
2018-09-06 11:26 Vitaly Kuznetsov
2018-09-06 13:00 ` Wei Liu
2018-09-06 13:00 ` Wei Liu
2018-09-06 19:41 ` Boris Ostrovsky
2018-09-06 19:41 ` Boris Ostrovsky
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.