Skip to content

Commit 883706d

Browse files
jgross1gregkh
authored andcommitted
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>
1 parent 298455f commit 883706d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

drivers/xen/manage.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,16 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
275275
err = xenbus_transaction_start(&xbt);
276276
if (err)
277277
return;
278-
if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) < 0) {
279-
pr_err("Unable to read sysrq code in control/sysrq\n");
278+
err = xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key);
279+
if (err < 0) {
280+
/*
281+
* The Xenstore watch fires directly after registering it and
282+
* after a suspend/resume cycle. So ENOENT is no error but
283+
* might happen in those cases.
284+
*/
285+
if (err != -ENOENT)
286+
pr_err("Error %d reading sysrq code in control/sysrq\n",
287+
err);
280288
xenbus_transaction_end(xbt, 1);
281289
return;
282290
}

0 commit comments

Comments
 (0)