qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv2 08/20] block: honour alignment and limit in bd


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCHv2 08/20] block: honour alignment and limit in bdrv_co_discard
Date: Thu, 19 Sep 2013 14:09:22 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

On 09/17/2013 07:48 AM, Peter Lieven wrote:
> Signed-off-by: Peter Lieven <address@hidden>
> ---
>  block.c |   34 +++++++++++++++++++++++++++++++++-
>  1 file changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index 74ec342..ecc5be4 100644
> --- a/block.c
> +++ b/block.c
> @@ -4181,7 +4181,39 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs, 
> int64_t sector_num,
>      }
>  
>      if (bs->drv->bdrv_co_discard) {
> -        return bs->drv->bdrv_co_discard(bs, sector_num, nb_sectors);
> +        /* if no limit is specified in the BlockDriverState use a default
> +         * of 32768 512-byte sectors (16 MiB) per request.
> +         */
> +        int max_discard = bs->max_discard ? bs->max_discard : 32768;

Worth having a named constant instead of a magic number?

-- 
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]