Skip to content
Snippets Groups Projects
Commit c8295404 authored by Eugenio Pérez's avatar Eugenio Pérez Committed by Michael S. Tsirkin
Browse files

vdpa: Check for existence of opts.vhostdev


Since net_init_vhost_vdpa is trying to open it. Not specifying it in the
command line crash qemu.

Fixes: 7327813d ("vhost-vdpa: open device fd in net_init_vhost_vdpa()")
Signed-off-by: default avatarEugenio Pérez <eperezma@redhat.com>
Message-Id: <20211112193431.2379298-3-eperezma@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 0351152b
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment