qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] virtio: allow mapping up to max queue size


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH] virtio: allow mapping up to max queue size
Date: Tue, 13 May 2014 09:57:26 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

* Michael S. Tsirkin (address@hidden) wrote:
> It's a loop from i < num_sg  and the array is VIRTQUEUE_MAX_SIZE - so
> it's OK if the value read is VIRTQUEUE_MAX_SIZE.
> 
> Not a big problem in practice as people don't use
> such big queues, but it's inelegant.
> 
> Reported-by: "Dr. David Alan Gilbert" <address@hidden>
> Cc: address@hidden
> Signed-off-by: Michael S. Tsirkin <address@hidden>

Reviewed-by: Dr. David Alan Gilbert <address@hidden>

> ---
>  hw/virtio/virtio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 7f4e7ec..3557c17 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -430,7 +430,7 @@ void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
>      unsigned int i;
>      hwaddr len;
>  
> -    if (num_sg >= VIRTQUEUE_MAX_SIZE) {
> +    if (num_sg > VIRTQUEUE_MAX_SIZE) {
>          error_report("virtio: map attempt out of bounds: %zd > %d",
>                       num_sg, VIRTQUEUE_MAX_SIZE);
>          exit(1);
> -- 
> MST
> 
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

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