[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 34/36] block: return count of dirty sectors, not
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [RFC PATCH 34/36] block: return count of dirty sectors, not chunks |
Date: |
Fri, 15 Jun 2012 17:05:57 +0200 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
block-migration.c | 2 +-
block.c | 2 +-
block/mirror.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block-migration.c b/block-migration.c
index fd2ffff..6fdce1a 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -485,7 +485,7 @@ static int64_t get_remaining_dirty(void)
dirty += bdrv_get_dirty_count(bmds->bs);
}
- return dirty * BLOCK_SIZE;
+ return dirty << BDRV_SECTOR_BITS;
}
static int is_stage2_completed(void)
diff --git a/block.c b/block.c
index 35ceed5..b1d653f 100644
--- a/block.c
+++ b/block.c
@@ -4075,7 +4075,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 fcedd66..cc9f1fb 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -212,7 +212,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_ns = ratelimit_calculate_delay(&s->limit,
BDRV_SECTORS_PER_DIRTY_CHUNK);
--
1.7.10.2
- Re: [Qemu-devel] [RFC PATCH 13/36] block: introduce block job error, (continued)
- [Qemu-devel] [RFC PATCH 20/36] block: forward bdrv_iostatus_reset to block job, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 21/36] block: introduce new dirty bitmap functionality, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 22/36] block: add mirror job, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 19/36] block: add target info to QMP query-blockjobs command, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 25/36] mirror: add support for on_source_error/on_target_error, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 24/36] mirror: support querying target file, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 29/36] mirror: implement completion, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 34/36] block: return count of dirty sectors, not chunks,
Paolo Bonzini <=
- [Qemu-devel] [RFC PATCH 33/36] mirror: perform COW if the cluster size is bigger than the granularity, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 26/36] block: live snapshot documentation tweaks, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 35/36] block: allow customizing the granularity of the dirty bitmap, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 36/36] mirror: allow customizing the granularity, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 17/36] block: add bdrv_query_stats, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 30/36] add hierarchical bitmap data type and test cases, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 18/36] block: make device optional in BlockInfo, Paolo Bonzini, 2012/06/15