[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 16/17] block: Make bdrv_is_allocated() byte-base
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH 16/17] block: Make bdrv_is_allocated() byte-based |
Date: |
Wed, 19 Apr 2017 12:54:48 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 |
On 04/18/2017 05:15 PM, John Snow wrote:
>> @@ -279,9 +280,9 @@ static int mig_save_device_bulk(QEMUFile *f,
>> BlkMigDevState *bmds)
>> /* Skip unallocated sectors; intentionally treats failure as
>> * an allocated sector */
>> while (cur_sector < total_sectors &&
>> - !bdrv_is_allocated(blk_bs(bb), cur_sector,
>> - MAX_IS_ALLOCATED_SEARCH, &nr_sectors)) {
>> - cur_sector += nr_sectors;
>> + !bdrv_is_allocated(blk_bs(bb), cur_sector * BDRV_SECTOR_SIZE,
>> + MAX_IS_ALLOCATED_SEARCH, &count)) {
>> + cur_sector += DIV_ROUND_UP(count, BDRV_SECTOR_SIZE);
>
> Hm, what's the story here, why are we rounding this up? If, in theory,
> we have a partially allocated cluster won't we advance past that?
This is rounding to sectors, not clusters (that is, the code is supposed
to advance cur_sector identically pre- and post-patch). As to whether
the overall algorithm makes sense, or could use some tweaking by
converting migration/block.c to do everything by bytes instead of by
sectors, I haven't yet given that any serious time.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH 09/17] mirror: Switch mirror_cow_align() to byte-based, (continued)
- [Qemu-block] [PATCH 09/17] mirror: Switch mirror_cow_align() to byte-based, Eric Blake, 2017/04/11
- [Qemu-block] [PATCH 11/17] mirror: Switch mirror_iteration() to byte-based, Eric Blake, 2017/04/11
- [Qemu-block] [PATCH 12/17] backup: Switch BackupBlockJob to byte-based, Eric Blake, 2017/04/11
- [Qemu-block] [PATCH 13/17] backup: Switch block_backup.h to byte-based, Eric Blake, 2017/04/11
- [Qemu-block] [PATCH 14/17] backup: Switch backup_do_cow() to byte-based, Eric Blake, 2017/04/11
- [Qemu-block] [PATCH 15/17] backup: Switch backup_run() to byte-based, Eric Blake, 2017/04/11
- [Qemu-block] [PATCH 16/17] block: Make bdrv_is_allocated() byte-based, Eric Blake, 2017/04/11
- Re: [Qemu-block] [PATCH 16/17] block: Make bdrv_is_allocated() byte-based, John Snow, 2017/04/19
[Qemu-block] [PATCH 17/17] block: Make bdrv_is_allocated_above() byte-based, Eric Blake, 2017/04/11
Re: [Qemu-block] [PATCH 00/17] make bdrv_is_allocated[_above] byte-based, John Snow, 2017/04/17