提交 a48aaf88 编写于 作者: Y Yuri Benditovich 提交者: Jason Wang

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: f19bcdfe ("virtio-pci: implement queue_enabled method")
Signed-off-by: NYuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: NJason Wang <jasowang@redhat.com>
上级 93ea4843
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册