]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
xen: don't print error message in case of missing Xenstore entry
authorJuergen Gross <jgross@suse.com>
Tue, 30 May 2017 18:52:26 +0000 (20:52 +0200)
committerJuergen Gross <jgross@suse.com>
Wed, 7 Jun 2017 07:48:02 +0000 (09:48 +0200)
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>
drivers/xen/manage.c

index c1ec8ee80924837914ecc0fb2f3ca09cfd00bbcc..60cf71f1b2562893e83b223470d0e2e47fab55fb 100644 (file)
@@ -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;
        }