From: Paolo Bonzini <pbonzini@redhat.com>
To: Li Qiang <liq3ea@163.com>,
thuth@redhat.com, lvivier@redhat.com, mst@redhat.com,
peter.maydell@linaro.org, marcandre.lureau@redhat.com,
berrange@redhat.com, jasowang@redhat.com
Cc: liq3ea@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] vhost-user: add fds inf 'vhost_set_vring_file' in qtest
Date: Sat, 15 Dec 2018 12:08:08 +0100 [thread overview]
Message-ID: <ec20980f-ab76-ceac-4ebe-79716dce336b@redhat.com> (raw)
In-Reply-To: <20181215012625.73315-3-liq3ea@163.com>
On 15/12/18 02:26, Li Qiang wrote:
> Currently, the vhost-user-test assumes the eventfd is available.
> However it's not true because the accel is qtest. So the
> 'vhost_set_vring_file' will not add fds to the msg and the server
> side of vhost-user-test will be broken. This patch avoid this.
>
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
> hw/virtio/vhost-user.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index e09bed0e4a..3b666f093c 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -23,6 +23,7 @@
> #include "migration/migration.h"
> #include "migration/postcopy-ram.h"
> #include "trace.h"
> +#include "sysemu/qtest.h"
>
> #include <sys/ioctl.h>
> #include <sys/socket.h>
> @@ -742,7 +743,7 @@ static int vhost_set_vring_file(struct vhost_dev *dev,
> .hdr.size = sizeof(msg.payload.u64),
> };
>
> - if (ioeventfd_enabled() && file->fd > 0) {
The bug is in ioeventfd_enabled. It should be !kvm_enabled() ||
kvm_eventfds_enabled().
Paolo
> + if ((qtest_enabled() || ioeventfd_enabled()) && file->fd > 0) {
> fds[fd_num++] = file->fd;
> } else {
> msg.payload.u64 |= VHOST_USER_VRING_NOFD_MASK;
>
next prev parent reply other threads:[~2018-12-15 11:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-15 1:26 [Qemu-devel] [PATCH 0/3] vhost-user-test fix Li Qiang
2018-12-15 1:26 ` [Qemu-devel] [PATCH 1/3] tests: vhost-user-test: initialize 'fd' in chr_read Li Qiang
2018-12-15 1:26 ` [Qemu-devel] [PATCH 2/3] vhost-user: add fds inf 'vhost_set_vring_file' in qtest Li Qiang
2018-12-15 11:08 ` Paolo Bonzini [this message]
2018-12-15 1:26 ` [Qemu-devel] [PATCH 3/3] util: check the return value of fcntl in qemu_set_{block, nonblock} Li Qiang
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=ec20980f-ab76-ceac-4ebe-79716dce336b@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@redhat.com \
--cc=jasowang@redhat.com \
--cc=liq3ea@163.com \
--cc=liq3ea@gmail.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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).