diff options
author | Roman Kagan | 2021-11-11 16:33:53 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2022-01-07 11:19:55 +0100 |
commit | 5d33ae4b7a9a1f57cca4fde1dc8d16bc46d0f604 (patch) | |
tree | af27f30faf5eb9aa4b44aeccfae9a1812e007b87 /hw/pci | |
parent | vhost-user: stick to -errno error return convention (diff) | |
download | qemu-5d33ae4b7a9a1f57cca4fde1dc8d16bc46d0f604.tar.gz qemu-5d33ae4b7a9a1f57cca4fde1dc8d16bc46d0f604.tar.xz 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 'hw/pci')
0 files changed, 0 insertions, 0 deletions