qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 02/19] block: Detect unaligned length in bdr


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH 02/19] block: Detect unaligned length in bdrv_qiov_is_aligned()
Date: Fri, 06 Dec 2013 12:12:22 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 12/06/2013 10:22 AM, Kevin Wolf wrote:
> For an O_DIRECT request to succeed, it's not only necessary that all
> base addresses in the qiov are aligned, but also that each lengh in it

s/lengh/length/

> is aligned.
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  block.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/block.c b/block.c
> index 382ea71..613201b 100644
> --- a/block.c
> +++ b/block.c
> @@ -4349,6 +4349,9 @@ bool bdrv_qiov_is_aligned(BlockDriverState *bs, 
> QEMUIOVector *qiov)
>          if ((uintptr_t) qiov->iov[i].iov_base % bs->buffer_alignment) {
>              return false;
>          }
> +        if (qiov->iov[i].iov_len % bs->buffer_alignment) {
> +            return false;
> +        }
>      }
>  
>      return true;
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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