[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/26] libvhost-user: Remove unnecessary FD flag chec
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 20/26] libvhost-user: Remove unnecessary FD flag check for event file descriptors |
Date: |
Tue, 12 Mar 2019 22:55:32 -0400 |
From: Xie Yongji <address@hidden>
The vu_check_queue_msg_file() has checked the FD flag. So let's
delete the redundant check after it.
Signed-off-by: Xie Yongji <address@hidden>
Signed-off-by: Zhang Yu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
contrib/libvhost-user/libvhost-user.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/contrib/libvhost-user/libvhost-user.c
b/contrib/libvhost-user/libvhost-user.c
index df72d3e440..219a1fd06f 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -907,10 +907,8 @@ vu_set_vring_kick_exec(VuDev *dev, VhostUserMsg *vmsg)
dev->vq[index].kick_fd = -1;
}
- if (!(vmsg->payload.u64 & VHOST_USER_VRING_NOFD_MASK)) {
- dev->vq[index].kick_fd = vmsg->fds[0];
- DPRINT("Got kick_fd: %d for vq: %d\n", vmsg->fds[0], index);
- }
+ dev->vq[index].kick_fd = vmsg->fds[0];
+ DPRINT("Got kick_fd: %d for vq: %d\n", vmsg->fds[0], index);
dev->vq[index].started = true;
if (dev->iface->queue_set_started) {
@@ -995,9 +993,7 @@ vu_set_vring_call_exec(VuDev *dev, VhostUserMsg *vmsg)
dev->vq[index].call_fd = -1;
}
- if (!(vmsg->payload.u64 & VHOST_USER_VRING_NOFD_MASK)) {
- dev->vq[index].call_fd = vmsg->fds[0];
- }
+ dev->vq[index].call_fd = vmsg->fds[0];
DPRINT("Got call_fd: %d for vq: %d\n", vmsg->fds[0], index);
@@ -1020,9 +1016,7 @@ vu_set_vring_err_exec(VuDev *dev, VhostUserMsg *vmsg)
dev->vq[index].err_fd = -1;
}
- if (!(vmsg->payload.u64 & VHOST_USER_VRING_NOFD_MASK)) {
- dev->vq[index].err_fd = vmsg->fds[0];
- }
+ dev->vq[index].err_fd = vmsg->fds[0];
return false;
}
--
MST
- [Qemu-devel] [PULL 00/26] pci, pc, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 23/26] vhost-user-blk: Add support to get/set inflight buffer, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 26/26] i386, acpi: check acpi_memory_hotplug capacity in pre_plug, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 25/26] gen_pcie_root_port: Add ACS (Access Control Services) capability, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 24/26] pcie: Add a simple PCIe ACS (Access Control Services) helper function, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 21/26] libvhost-user: Introduce vu_queue_map_desc(), Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 22/26] libvhost-user: Support tracking inflight I/O in shared memory, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 19/26] vhost-user: Support transferring inflight buffer between qemu and backend, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 20/26] libvhost-user: Remove unnecessary FD flag check for event file descriptors,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 17/26] nvdimm: use *function* directly instead of allocating it again, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 18/26] nvdimm: use NVDIMM_ACPI_IO_LEN for the proper IO size, Michael S. Tsirkin, 2019/03/12
- [Qemu-devel] [PULL 16/26] nvdimm: fix typo in nvdimm_build_nvdimm_devices argument, Michael S. Tsirkin, 2019/03/12
- Re: [Qemu-devel] [PULL 00/26] pci, pc, virtio: features, fixes, cleanups, Peter Maydell, 2019/03/13