]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-net: setup vhost_dev and notifiers for cvq only when feature is negotiated
authorSi-Wei Liu <si-wei.liu@oracle.com>
Sat, 7 May 2022 02:28:12 +0000 (19:28 -0700)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 16 May 2022 20:15:40 +0000 (16:15 -0400)
commitaa8581945a13712ff3eed0ad3ba7a9664fc1604b
tree1bf06bd45b132b3f38e563a45ce710a97737782d
parent18aa91cddd8caa14aae094f9b59c0381959cb320
virtio-net: setup vhost_dev and notifiers for cvq only when feature is negotiated

When the control virtqueue feature is absent or not negotiated,
vhost_net_start() still tries to set up vhost_dev and install
vhost notifiers for the control virtqueue, which results in
erroneous ioctl calls with incorrect queue index sending down
to driver. Do that only when needed.

Fixes: 22288fe ("virtio-net: vhost control virtqueue support")
Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <1651890498-24478-2-git-send-email-si-wei.liu@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/virtio-net.c