Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>

+10 -2
+10 -2
drivers/xen/manage.c
··· 277 277 err = xenbus_transaction_start(&xbt); 278 278 if (err) 279 279 return; 280 - if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) < 0) { 281 - pr_err("Unable to read sysrq code in control/sysrq\n"); 280 + err = xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key); 281 + if (err < 0) { 282 + /* 283 + * The Xenstore watch fires directly after registering it and 284 + * after a suspend/resume cycle. So ENOENT is no error but 285 + * might happen in those cases. 286 + */ 287 + if (err != -ENOENT) 288 + pr_err("Error %d reading sysrq code in control/sysrq\n", 289 + err); 282 290 xenbus_transaction_end(xbt, 1); 283 291 return; 284 292 }