diff options
author | Roman Kagan | 2021-11-11 16:33:50 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2022-01-07 11:19:55 +0100 |
commit | 2d88d9c65cc9680ff33cf8cc0b71ab1532e2f394 (patch) | |
tree | cb2d1968a705d2e17d8e085b09acb8de832c64db | |
parent | vhost-backend: avoid overflow on memslots_limit (diff) | |
download | qemu-2d88d9c65cc9680ff33cf8cc0b71ab1532e2f394.tar.gz qemu-2d88d9c65cc9680ff33cf8cc0b71ab1532e2f394.tar.xz qemu-2d88d9c65cc9680ff33cf8cc0b71ab1532e2f394.zip |
vhost-backend: stick to -errno error return convention
Almost all VhostOps methods in kernel_ops follow the convention of
returning negated errno on error.
Adjust the only one that doesn't.
Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-7-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
-rw-r--r-- | hw/virtio/vhost-backend.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c index 44f7dbb243..e409a865ae 100644 --- a/hw/virtio/vhost-backend.c +++ b/hw/virtio/vhost-backend.c @@ -47,7 +47,7 @@ static int vhost_kernel_cleanup(struct vhost_dev *dev) assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_KERNEL); - return close(fd); + return close(fd) < 0 ? -errno : 0; } static int vhost_kernel_memslots_limit(struct vhost_dev *dev) |