summaryrefslogtreecommitdiff
path: root/drivers/xen
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2017-05-30 20:52:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-08 10:08:37 +0100
commit244cff7066f6b517ef30bba757e1837d5b8b3aa7 (patch)
tree2fb18c918f11fe5e0d8d23b627e5638a1df93c7c /drivers/xen
parentc90b65d8b8fb664aa6b50ecbe0fad19ca249b54b (diff)
xen: don't print error message in case of missing Xenstore entry
[ Upstream commit 4e93b6481c87ea5afde944a32b4908357ec58992 ] 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> Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/manage.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 357a8db859c9..9122ba25bb00 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 **vec,
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;
}