Skip to contentSkip to conversation

xen: don't print error message in case of missing Xenstore entry

PATCH Superseded Juergen Gross 2 participants 3 messages May 30, 2017 Xen hypervisor interface

lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH v2 1/1 xen: 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.

---
 drivers/xen/manage.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/xen/manage.c +10 -2
index c1ec8ee80924..60cf71f1b256 100644
@@ -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;
 	}
Signature · 1 line
2.12.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · 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.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel