提交 87dffe86 编写于 作者: V Vitaly Kuznetsov 提交者: Boris Ostrovsky

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.
Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: NWei Liu <wei.liu2@citrix.com>
Signed-off-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
上级 11da3a7f
......@@ -280,9 +280,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path,
/*
* 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.
* might happen in those cases. ERANGE is observed when we get
* an empty value (''), this happens when we acknowledge the
* request by writing '\0' below.
*/
if (err != -ENOENT)
if (err != -ENOENT && err != -ERANGE)
pr_err("Error %d reading sysrq code in control/sysrq\n",
err);
xenbus_transaction_end(xbt, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册