[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen staging] virtio-pci: fix wrong index in virtio_pci_queue_enabled



commit a48aaf882b100b30111b5c7c75e1d9e83fe76cfd
Author:     Yuri Benditovich <yuri.benditovich@xxxxxxxxxx>
AuthorDate: Mon Jul 27 17:38:07 2020 +0300
Commit:     Jason Wang <jasowang@xxxxxxxxxx>
CommitDate: Tue Jul 28 16:54:46 2020 +0800

    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: f19bcdfedd53 ("virtio-pci: implement queue_enabled method")
    Signed-off-by: Yuri Benditovich <yuri.benditovich@xxxxxxxxxx>
    Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
---
 hw/virtio/virtio-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 4ad3ad81a2..ccdf54e81c 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -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);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.