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

[Xen-changelog] [linux-2.6.18-xen] sysrq: don't print error message in case of missing Xenstore entry


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Thu, 03 May 2018 08:22:02 +0000
  • Delivery-date: Thu, 03 May 2018 08:22:09 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xenproject.org>

# HG changeset patch
# User Juergen Gross <jgross@xxxxxxxx>
# Date 1525335134 -7200
#      Thu May 03 10:12:14 2018 +0200
# Node ID 0f354e1b83792d0cf6a91f638ac843b43ba48b4c
# Parent  615890cbff8250f89318c9b5cc59d4856e3140cc
sysrq: don't print error message in case of missing Xenstore entry

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@xxxxxxxx>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r 615890cbff82 -r 0f354e1b8379 drivers/xen/core/reboot.c
--- a/drivers/xen/core/reboot.c Wed Aug 30 15:00:42 2017 +0200
+++ b/drivers/xen/core/reboot.c Thu May 03 10:12:14 2018 +0200
@@ -213,9 +213,17 @@ static void sysrq_handler(struct xenbus_
        err = xenbus_transaction_start(&xbt);
        if (err)
                return;
-       if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) <= 0) {
-               printk(KERN_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)
+                       printk(KERN_ERR
+                              "Error %d reading sysrq code in control/sysrq\n",
+                              err);
                xenbus_transaction_end(xbt, 1);
                return;
        }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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