From: elohimes@gmail.com
To: mst@redhat.com, stefanha@gmail.com, marcandre.lureau@redhat.com,
berrange@redhat.com, jasowang@redhat.com,
maxime.coquelin@redhat.com, yury-kotov@yandex-team.ru,
wrfsh@yandex-team.ru
Cc: qemu-devel@nongnu.org, zhangyu31@baidu.com, chaiwen@baidu.com,
nixun@baidu.com, lilin24@baidu.com,
Xie Yongji <xieyongji@baidu.com>
Subject: [Qemu-devel] [PATCH v7 2/7] libvhost-user: Remove unnecessary FD flag check for event file descriptors
Date: Thu, 28 Feb 2019 16:53:50 +0800 [thread overview]
Message-ID: <20190228085355.9614-3-xieyongji@baidu.com> (raw)
In-Reply-To: <20190228085355.9614-1-xieyongji@baidu.com>
From: Xie Yongji <xieyongji@baidu.com>
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 <xieyongji@baidu.com>
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
---
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 3f14b4138b..16fec3a3fd 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;
}
--
2.17.1
next prev parent reply other threads:[~2019-02-28 8:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-28 8:53 [Qemu-devel] [PATCH v7 0/7] vhost-user-blk: Add support for backend reconnecting elohimes
2019-02-28 8:53 ` [Qemu-devel] [PATCH v7 1/7] vhost-user: Support transferring inflight buffer between qemu and backend elohimes
2019-02-28 8:53 ` elohimes [this message]
2019-02-28 8:53 ` [Qemu-devel] [PATCH v7 3/7] libvhost-user: Introduce vu_queue_map_desc() elohimes
2019-02-28 8:53 ` [Qemu-devel] [PATCH v7 4/7] libvhost-user: Support tracking inflight I/O in shared memory elohimes
2019-11-16 17:42 ` [Qemu-devel] [PULL 22/26] " Marc-André Lureau
2019-11-18 9:15 ` Yongji Xie
2019-02-28 8:53 ` [Qemu-devel] [PATCH v7 5/7] vhost-user-blk: Add support to get/set inflight buffer elohimes
2019-02-28 8:53 ` [Qemu-devel] [PATCH v7 6/7] vhost-user-blk: Add support to reconnect backend elohimes
2019-02-28 8:53 ` [Qemu-devel] [PATCH v7 7/7] contrib/vhost-user-blk: enable inflight I/O tracking elohimes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190228085355.9614-3-xieyongji@baidu.com \
--to=elohimes@gmail.com \
--cc=berrange@redhat.com \
--cc=chaiwen@baidu.com \
--cc=jasowang@redhat.com \
--cc=lilin24@baidu.com \
--cc=marcandre.lureau@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=mst@redhat.com \
--cc=nixun@baidu.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=wrfsh@yandex-team.ru \
--cc=xieyongji@baidu.com \
--cc=yury-kotov@yandex-team.ru \
--cc=zhangyu31@baidu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).