qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v9 6/9] qcow2: add bdrv_measure() support


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v9 6/9] qcow2: add bdrv_measure() support
Date: Tue, 11 Jul 2017 14:04:14 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/05/2017 07:57 AM, Stefan Hajnoczi wrote:
> Use qcow2_calc_prealloc_size() to get the required file size.
> 
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> Reviewed-by: Alberto Garcia <address@hidden>
> ---

> +            for (sector_num = 0;
> +                 sector_num < ssize / BDRV_SECTOR_SIZE;
> +                 sector_num += pnum) {
> +                int nb_sectors = MAX(ssize / BDRV_SECTOR_SIZE - sector_num,
> +                                     INT_MAX);
> +                BlockDriverState *file;
> +                int64_t ret;
> +
> +                ret = bdrv_get_block_status_above(in_bs, NULL,
> +                                                  sector_num, nb_sectors,
> +                                                  &pnum, &file);

Shouldn't that be MIN(), not MAX(), in the computation of nb_sectors?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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