mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] xen: don't print error message in case of missing Xenstore entry
@ 2017-05-30 18:52 Juergen Gross
  2017-05-30 19:47 ` Boris Ostrovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2017-05-30 18:52 UTC (permalink / raw)
  To: linux-kernel, xen-devel; +Cc: boris.ostrovsky, Juergen Gross

When registering for the Xenstore watch of the node control/sysrq the
handler will be called at once. Don't issue an error message if the
Xenstore node isn't there, as it will be created only when an event
is being triggered.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/xen/manage.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index c1ec8ee80924..60cf71f1b256 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -277,8 +277,16 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path,
 	err = xenbus_transaction_start(&xbt);
 	if (err)
 		return;
-	if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) < 0) {
-		pr_err("Unable to read sysrq code in control/sysrq\n");
+	err = xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key);
+	if (err < 0) {
+		/*
+		 * 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.
+		 */
+		if (err != -ENOENT)
+			pr_err("Error %d reading sysrq code in control/sysrq\n",
+			       err);
 		xenbus_transaction_end(xbt, 1);
 		return;
 	}
-- 
2.12.3

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

* Re: [PATCH v2] xen: don't print error message in case of missing Xenstore entry
  2017-05-30 18:52 [PATCH v2] xen: don't print error message in case of missing Xenstore entry Juergen Gross
@ 2017-05-30 19:47 ` Boris Ostrovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Ostrovsky @ 2017-05-30 19:47 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, xen-devel

On 05/30/2017 02:52 PM, Juergen Gross wrote:
> When registering for the Xenstore watch of the node control/sysrq the
> handler will be called at once. Don't issue an error message if the
> Xenstore node isn't there, as it will be created only when an event
> is being triggered.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

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

end of thread, other threads:[~2017-05-30 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-30 18:52 [PATCH v2] xen: don't print error message in case of missing Xenstore entry Juergen Gross
2017-05-30 19:47 ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®