diff options
author | Jason Wang <jasowang@redhat.com> | 2019-03-25 11:40:36 +0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2019-05-17 17:00:12 +0800 |
commit | 23bfaf77fa801ba30bb136de7cec47728eb02f4b (patch) | |
tree | c7ef1f748984a222eca2d7418a471bcd4c2d2ebd /include | |
parent | d8276573da58e8ce78dab8c46dd660efd664bcb7 (diff) | |
download | qemu-23bfaf77fa801ba30bb136de7cec47728eb02f4b.zip |
vhost_net: don't set backend for the uninitialized virtqueue
We used to set backend unconditionally, this won't work for some
guests (e.g windows driver) who may not initialize all virtqueues. For
kernel backend, this will fail since it may try to validate the rings
during setting backend.
Fixing this by simply skipping the backend set when we find desc is
not ready.
Reviewed-by: Michael S. Tsirkin<mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/virtio/virtio.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index ce9516236a..7140381e3a 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -282,6 +282,7 @@ typedef struct VirtIORNGConf VirtIORNGConf; VIRTIO_F_IOMMU_PLATFORM, false) hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); +bool virtio_queue_enabled(VirtIODevice *vdev, int n); hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n); hwaddr virtio_queue_get_used_addr(VirtIODevice *vdev, int n); hwaddr virtio_queue_get_desc_size(VirtIODevice *vdev, int n); |