aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-08-01 15:23:44 +0200
committerKevin Wolf <kwolf@redhat.com>2012-10-24 10:26:19 +0200
commitb9a9b3a4626aa099f829e2a6036bfaa0c8e47700 (patch)
treef36184a6c253e8a874f830b52a5a3852a8672f7e /block.c
parent1755da16e32c15b22a521e8a38539e4b5cf367f3 (diff)
downloadqemu-b9a9b3a4626aa099f829e2a6036bfaa0c8e47700.zip
qemu-b9a9b3a4626aa099f829e2a6036bfaa0c8e47700.tar.gz
qemu-b9a9b3a4626aa099f829e2a6036bfaa0c8e47700.tar.bz2
block: export dirty bitmap information in query-block
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/block.c b/block.c
index 2c3d3da..ad5e240 100644
--- a/block.c
+++ b/block.c
@@ -2837,6 +2837,13 @@ BlockInfo *bdrv_query_info(BlockDriverState *bs)
info->io_status = bs->iostatus;
}
+ if (bs->dirty_bitmap) {
+ info->has_dirty = true;
+ info->dirty = g_malloc0(sizeof(*info->dirty));
+ info->dirty->count = bdrv_get_dirty_count(bs) *
+ BDRV_SECTORS_PER_DIRTY_CHUNK * BDRV_SECTOR_SIZE;
+ }
+
if (bs->drv) {
info->has_inserted = true;
info->inserted = g_malloc0(sizeof(*info->inserted));