Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
virtio-pci: fix wrong index in virtio_pci_queue_enabled
We should use the index passed by the caller instead of the queue_sel
when checking the enablement of a specific virtqueue.

This is reported in https://bugzilla.redhat.com/show_bug.cgi?id=1702608

Fixes: f19bcdf ("virtio-pci: implement queue_enabled method")
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
  • Loading branch information
ybendito authored and jasowang committed Jul 28, 2020
1 parent 93ea484 commit a48aaf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/virtio/virtio-pci.c
Expand Up @@ -1113,7 +1113,7 @@ static bool virtio_pci_queue_enabled(DeviceState *d, int n)
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);

if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
return proxy->vqs[vdev->queue_sel].enabled;
return proxy->vqs[n].enabled;
}

return virtio_queue_enabled_legacy(vdev, n);
Expand Down

0 comments on commit a48aaf8

Please sign in to comment.