summary refs log tree commit diff stats
path: root/python/qemu/utils/accel.py
diff options
context:
space:
mode:
authorRoman Kagan <rvkagan@yandex-team.ru>2021-11-11 18:33:53 +0300
committerMichael S. Tsirkin <mst@redhat.com>2022-01-07 05:19:55 -0500
commit5d33ae4b7a9a1f57cca4fde1dc8d16bc46d0f604 (patch)
treeaf27f30faf5eb9aa4b44aeccfae9a1812e007b87 /python/qemu/utils/accel.py
parent025faa872bcf919259465419bee443b8a3ce3da1 (diff)
downloadfocaccia-qemu-5d33ae4b7a9a1f57cca4fde1dc8d16bc46d0f604.tar.gz
focaccia-qemu-5d33ae4b7a9a1f57cca4fde1dc8d16bc46d0f604.zip
vhost: stick to -errno error return convention
The generic vhost code expects that many of the VhostOps methods in the
respective backends set errno on errors.  However, none of the existing
backends actually bothers to do so.  In a number of those methods errno
from the failed call is clobbered by successful later calls to some
library functions; on a few code paths the generic vhost code then
negates and returns that errno, thus making failures look as successes
to the caller.

As a result, in certain scenarios (e.g. live migration) the device
doesn't notice the first failure and goes on through its state
transitions as if everything is ok, instead of taking recovery actions
(break and reestablish the vhost-user connection, cancel migration, etc)
before it's too late.

To fix this, consolidate on the convention to return negated errno on
failures throughout generic vhost, and use it for error propagation.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-10-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'python/qemu/utils/accel.py')
0 files changed, 0 insertions, 0 deletions