diff mbox series

virtio-pci: fix wrong index in virtio_pci_queue_enabled

Message ID 20200727143807.19230-1-yuri.benditovich@daynix.com (mailing list archive)
State New, archived
Headers show
Series virtio-pci: fix wrong index in virtio_pci_queue_enabled | expand

Commit Message

Yuri Benditovich July 27, 2020, 2:38 p.m. UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1702608

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
---
 hw/virtio/virtio-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Wang July 28, 2020, 3:56 a.m. UTC | #1
On 2020/7/27 下午10:38, Yuri Benditovich wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1702608
>
> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>


Queued for rc2.

Thanks


> ---
>   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 ada1101d07..2b1f9cc67b 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(vdev, n);
diff mbox series

Patch

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index ada1101d07..2b1f9cc67b 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(vdev, n);