From: Jason Wang <jasowang@redhat.com>
To: "Eugenio Pérez" <eperezma@redhat.com>
Cc: qemu-trivial@nongnu.org, Laurent Vivier <lvivier@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>, Cindy Lu <lulu@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 2/2] vdpa: Check for existence of opts.vhostdev
Date: Mon, 15 Nov 2021 12:24:49 +0800 [thread overview]
Message-ID: <CACGkMEu737cb0UFgm3txQ6jbBJ-xwCphppFYz78BeSFMPGdeOA@mail.gmail.com> (raw)
In-Reply-To: <20211112193431.2379298-3-eperezma@redhat.com>
On Sat, Nov 13, 2021 at 3:35 AM Eugenio Pérez <eperezma@redhat.com> wrote:
>
> Since net_init_vhost_vdpa is trying to open it. Not specifying it in the
> command line crash qemu.
>
> Fixes: 7327813d17 ("vhost-vdpa: open device fd in net_init_vhost_vdpa()")
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
> ---
> net/vhost-vdpa.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index 6ffb29f4da..bbd3576f23 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -260,6 +260,10 @@ int net_init_vhost_vdpa(const Netdev *netdev, const char *name,
>
> assert(netdev->type == NET_CLIENT_DRIVER_VHOST_VDPA);
> opts = &netdev->u.vhost_vdpa;
> + if (!opts->vhostdev) {
> + error_setg(errp, "vdpa character device not specified with vhostdev");
> + return -1;
> + }
>
> vdpa_device_fd = qemu_open(opts->vhostdev, O_RDWR, errp);
> if (vdpa_device_fd == -1) {
> --
> 2.27.0
>
prev parent reply other threads:[~2021-11-15 4:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-12 19:34 [PATCH 0/2] vdpa: Check for existence of opts.vhostdev Eugenio Pérez
2021-11-12 19:34 ` [PATCH 1/2] vdpa: Replace qemu_open_old by qemu_open at Eugenio Pérez
2021-11-15 4:22 ` Jason Wang
2021-11-12 19:34 ` [PATCH 2/2] vdpa: Check for existence of opts.vhostdev Eugenio Pérez
2021-11-15 4:24 ` Jason Wang [this message]
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=CACGkMEu737cb0UFgm3txQ6jbBJ-xwCphppFYz78BeSFMPGdeOA@mail.gmail.com \
--to=jasowang@redhat.com \
--cc=eperezma@redhat.com \
--cc=lulu@redhat.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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).