summaryrefslogtreecommitdiff
path: root/block-migration.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-01-21 17:09:45 +0100
committerKevin Wolf <kwolf@redhat.com>2013-01-25 18:18:34 +0100
commit50717e941b9f306a45292621999eeafbaa954418 (patch)
treefce87f84ffc40ead2ad1b654d7439cc24678f4a7 /block-migration.c
parentacc906c6c5d5745fe7a3a2ed1bb5f0b1d6d1f21b (diff)
downloadqemu-50717e941b9f306a45292621999eeafbaa954418.tar.gz
qemu-50717e941b9f306a45292621999eeafbaa954418.tar.bz2
qemu-50717e941b9f306a45292621999eeafbaa954418.zip
block: allow customizing the granularity of the dirty bitmap
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block-migration.c')
-rw-r--r--block-migration.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block-migration.c b/block-migration.c
index 9d0b037029..9ac7de6d78 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -23,7 +23,8 @@
#include "sysemu/blockdev.h"
#include <assert.h>
-#define BLOCK_SIZE (BDRV_SECTORS_PER_DIRTY_CHUNK << BDRV_SECTOR_BITS)
+#define BLOCK_SIZE (1 << 20)
+#define BDRV_SECTORS_PER_DIRTY_CHUNK (BLOCK_SIZE >> BDRV_SECTOR_BITS)
#define BLK_MIG_FLAG_DEVICE_BLOCK 0x01
#define BLK_MIG_FLAG_EOS 0x02
@@ -254,7 +255,7 @@ static void set_dirty_tracking(int enable)
BlkMigDevState *bmds;
QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
- bdrv_set_dirty_tracking(bmds->bs, enable);
+ bdrv_set_dirty_tracking(bmds->bs, enable ? BLOCK_SIZE : 0);
}
}