OSDN Git Service

xen/manage: don't complain about an empty value in control/sysrq node
authorVitaly Kuznetsov <vkuznets@redhat.com>
Thu, 6 Sep 2018 11:26:08 +0000 (13:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:52:13 +0000 (08:52 +0200)
commit6899f2fe641c66569327284ce02242f9cc4f7b8d
tree9c570a45db48abff1e21bc4c51596caa7703c4bf
parentcd65a43f4dfb75a6bb5211ce28e65e5429b7c499
xen/manage: don't complain about an empty value in control/sysrq node

[ Upstream commit 87dffe86d406bee8782cac2db035acb9a28620a7 ]

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: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/manage.c