[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 18/55] vhost-backend: stick to -errno error return convention
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 18/55] vhost-backend: stick to -errno error return convention |
Date: |
Fri, 7 Jan 2022 20:04:27 -0500 |
From: Roman Kagan <rvkagan@yandex-team.ru>
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>
---
hw/virtio/vhost-backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
--
MST
- Re: [PULL v3 12/55] virtio-pci: add support for configure interrupt, (continued)
Re: [PULL v3 12/55] virtio-pci: add support for configure interrupt, Cédric Le Goater, 2022/01/09
[PULL v3 13/55] trace-events,pci: unify trace events format, Michael S. Tsirkin, 2022/01/07
[PULL v3 14/55] vhost-user-blk: reconnect on any error during realize, Michael S. Tsirkin, 2022/01/07
[PULL v3 15/55] chardev/char-socket: tcp_chr_recv: don't clobber errno, Michael S. Tsirkin, 2022/01/07
[PULL v3 16/55] chardev/char-socket: tcp_chr_sync_read: don't clobber errno, Michael S. Tsirkin, 2022/01/07
[PULL v3 17/55] vhost-backend: avoid overflow on memslots_limit, Michael S. Tsirkin, 2022/01/07
[PULL v3 18/55] vhost-backend: stick to -errno error return convention,
Michael S. Tsirkin <=
[PULL v3 20/55] vhost-user: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/07
[PULL v3 19/55] vhost-vdpa: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/07
[PULL v3 22/55] vhost-user-blk: propagate error return from generic vhost, Michael S. Tsirkin, 2022/01/07
[PULL v3 21/55] vhost: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/07
[PULL v3 24/55] pcie_aer: Don't trigger a LSI if none are defined, Michael S. Tsirkin, 2022/01/07
[PULL v3 23/55] pci: Export the pci_intx() function, Michael S. Tsirkin, 2022/01/07
[PULL v3 26/55] hw/smbios: Use qapi for SmbiosEntryPointType, Michael S. Tsirkin, 2022/01/07
[PULL v3 25/55] smbios: Rename SMBIOS_ENTRY_POINT_* enums, Michael S. Tsirkin, 2022/01/07
[PULL v3 27/55] hw/i386: expose a "smbios-entry-point-type" PC machine property, Michael S. Tsirkin, 2022/01/07
[PULL v3 31/55] util/oslib-posix: Introduce and use MemsetContext for touch_all_pages(), Michael S. Tsirkin, 2022/01/07