qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1] virtio-mmio: update queue size on guest write


From: Stefano Garzarella
Subject: Re: [PATCH v1] virtio-mmio: update queue size on guest write
Date: Tue, 24 Dec 2019 16:02:18 +0100

On Tue, Dec 24, 2019 at 11:14:46AM +0300, Denis Plotnikov wrote:
> Some guests read back queue size after writing it.
> Always update the on size write otherwise they might be confused.
> 
> Signed-off-by: Denis Plotnikov <address@hidden>
> ---
>  hw/virtio/virtio-mmio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

When I reviewed the Michael's patch for pci transport, I planned to do
the same but I postponed for several reason.

Thanks for doing that!

Reviewed-by: Stefano Garzarella <address@hidden>

> 
> diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
> index 94d934c44b..1e40a74869 100644
> --- a/hw/virtio/virtio-mmio.c
> +++ b/hw/virtio/virtio-mmio.c
> @@ -295,8 +295,9 @@ static void virtio_mmio_write(void *opaque, hwaddr 
> offset, uint64_t value,
>          break;
>      case VIRTIO_MMIO_QUEUE_NUM:
>          trace_virtio_mmio_queue_write(value, VIRTQUEUE_MAX_SIZE);
> +        virtio_queue_set_num(vdev, vdev->queue_sel, value);
> +
>          if (proxy->legacy) {
> -            virtio_queue_set_num(vdev, vdev->queue_sel, value);
>              virtio_queue_update_rings(vdev, vdev->queue_sel);
>          } else {
>              proxy->vqs[vdev->queue_sel].num = value;
> -- 
> 2.17.0
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]