History

xen/manage: don't complain about an empty value in control/sysrq node

When guest receives a sysrq request from the host it acknowledges it by writing '\0' to control/sysrq xenstore node. This, however, make xenstore watch fire again but xenbus_scanf() fails to parse empty value with "%c" format string: sysrq: SysRq : Emergency Sync Emergency Sync complete xen:manage: Error -34 reading sysrq code in control/sysrq Ignore -ERANGE the same way we already ignore -ENOENT, empty value in control/sysrq is totally legal.

Vitaly Kuznetsov committed 8 years ago

Commit 87dffe81 parent 11da3a71 file · +4 −2Browse files

Unified · Split

drivers/xen/manage.c+4−2
@@ -280,9 +280,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, · 279 unmodified lines
280280 /*
281281 * The Xenstore watch fires directly after registering it and
282282 * after a suspend/resume cycle. So ENOENT is no error but
283− * might happen in those cases.
283+ * might happen in those cases. ERANGE is observed when we get
284+ * an empty value (''), this happens when we acknowledge the
285+ * request by writing '\0' below.
284286 */
285− if (err != -ENOENT)
287+ if (err != -ENOENT && err != -ERANGE)
286288 pr_err("Error %d reading sysrq code in control/sysrq\n",
287289 err);
288290 xenbus_transaction_end(xbt, 1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t