From 4d5fb44ec928d4158dac60e983e4421317b91c2b Mon Sep 17 00:00:00 2001 Message-Id: <4d5fb44ec928d4158dac60e983e4421317b91c2b.1350312451.git.minovotn@redhat.com> In-Reply-To: References: From: Paolo Bonzini Date: Tue, 18 Sep 2012 15:25:08 +0200 Subject: [PATCH 05/27] block: return count of dirty sectors, not chunks RH-Author: Paolo Bonzini Message-id: <1347981910-9069-6-git-send-email-pbonzini@redhat.com> Patchwork-id: 41996 O-Subject: [RHEL 6.4/6.3.z qemu-kvm PATCH v3 5/7] block: return count of dirty sectors, not chunks Bugzilla: 844627 RH-Acked-by: Laszlo Ersek RH-Acked-by: Jeffrey Cody RH-Acked-by: Miroslav Rezanina Bugzilla: 844627 Upstream status: not yet applied Signed-off-by: Paolo Bonzini Conflicts: block-migration.c --- block.c | 2 +- block/mirror.c | 2 +- 2 file modificati, 2 inserzioni(+), 2 rimozioni(-) Signed-off-by: Michal Novotny --- block.c | 2 +- block/mirror.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index d7fffd6..176dce2 100644 --- a/block.c +++ b/block.c @@ -3479,7 +3479,7 @@ void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, int64_t bdrv_get_dirty_count(BlockDriverState *bs) { if (bs->dirty_bitmap) { - return hbitmap_count(bs->dirty_bitmap) >> BDRV_LOG_SECTORS_PER_DIRTY_CHUNK; + return hbitmap_count(bs->dirty_bitmap); } else { return 0; } diff --git a/block/mirror.c b/block/mirror.c index ee780d5..c41c2d2 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -223,7 +223,7 @@ static void coroutine_fn mirror_run(void *opaque) */ } else { /* Publish progress */ - s->common.offset = end * BDRV_SECTOR_SIZE - cnt * BLOCK_SIZE; + s->common.offset = (end - cnt) * BDRV_SECTOR_SIZE; if (s->common.speed) { delay_ms = ratelimit_calculate_delay(&s->limit, BDRV_SECTORS_PER_DIRTY_CHUNK); -- 1.7.11.7