[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 08/12] dirty-bitmap: Change bdrv_get_dirty() to
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 08/12] dirty-bitmap: Change bdrv_get_dirty() to take bytes |
Date: |
Wed, 12 Apr 2017 19:48:25 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 04/12/2017 07:25 PM, John Snow wrote:
>> +++ b/migration/block.c
>> @@ -537,8 +537,7 @@ static int mig_save_device_dirty(QEMUFile *f,
>> BlkMigDevState *bmds,
>> } else {
>> blk_mig_unlock();
>> }
>> - if (bdrv_get_dirty(bs, bmds->dirty_bitmap, sector)) {
>> -
>> + if (bdrv_get_dirty(bs, bmds->dirty_bitmap, sector *
>> BDRV_SECTOR_SIZE)) {
>
> This one is a little weirder now though, isn't it? We're asking for the
> dirty status of a single byte, technically. In practice, the scaling
> factor will always cover the entire sector, but it reads a lot jankier now.
>
>> if (total_sectors - sector < BDRV_SECTORS_PER_DIRTY_CHUNK) {
>> nr_sectors = total_sectors - sector;
>> } else {
>>
>
> Oh well, it was always janky...
True. Think of it as "is the granularity (which may be a sector, a
cluster, or even some other size) that contains 'offset' dirty?". I
really think migration/block.c will be easier to read once converted to
byte operations everywhere, but have not yet tackled it (it was hard
enough tackling mirror, backup, commit, and stream in parallel for the
previous series).
>
> Reviewed-by: John Snow <address@hidden>
>
Thanks for the reviews, by the way, even if the prerequisite patches
still haven't been fully reviewed.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 03/12] dirty-bitmap: Drop unused functions, (continued)
[Qemu-devel] [PATCH 04/12] dirty-bitmap: Track size in bytes, Eric Blake, 2017/04/12
[Qemu-devel] [PATCH 06/12] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset, Eric Blake, 2017/04/12
[Qemu-devel] [PATCH 05/12] dirty-bitmap: Set iterator start by offset, not sector, Eric Blake, 2017/04/12
[Qemu-devel] [PATCH 08/12] dirty-bitmap: Change bdrv_get_dirty() to take bytes, Eric Blake, 2017/04/12
[Qemu-devel] [PATCH 07/12] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes, Eric Blake, 2017/04/12
[Qemu-devel] [PATCH 09/12] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes, Eric Blake, 2017/04/12
[Qemu-devel] [PATCH 10/12] mirror: Switch mirror_dirty_init() to byte-based iteration, Eric Blake, 2017/04/12
[Qemu-devel] [PATCH 11/12] dirty-bitmap: Switch bdrv_set_dirty() to bytes, Eric Blake, 2017/04/12
[Qemu-devel] [PATCH 12/12] dirty-bitmap: Convert internal hbitmap size/granularity, Eric Blake, 2017/04/12