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 <dplotnikov@virtuozzo.com>
> ---
> 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 <sgarzare@redhat.com>
>
> 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
>
>