[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/32] block: export dirty bitmap information in que
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 20/32] block: export dirty bitmap information in query-block |
Date: |
Wed, 24 Oct 2012 11:50:44 +0200 |
From: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 7 +++++++
qapi-schema.json | 18 +++++++++++++++++-
2 files changed, 24 insertions(+), 1 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));
diff --git a/qapi-schema.json b/qapi-schema.json
index 36278cc..dfcbb67 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -661,6 +661,18 @@
{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
##
+# @BlockDirtyInfo:
+#
+# Block dirty bitmap information.
+#
+# @count: number of dirty bytes according to the dirty bitmap
+#
+# Since: 1.3
+##
+{ 'type': 'BlockDirtyInfo',
+ 'data': {'count': 'int'} }
+
+##
# @BlockInfo:
#
# Block device information. This structure describes a virtual device and
@@ -679,6 +691,9 @@
# @tray_open: #optional True if the device has a tray and it is open
# (only present if removable is true)
#
+# @dirty: #optional dirty bitmap information (only present if the dirty
+# bitmap is enabled)
+#
# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
# supports it and the VM is configured to stop on errors
#
@@ -690,7 +705,8 @@
{ 'type': 'BlockInfo',
'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
'locked': 'bool', '*inserted': 'BlockDeviceInfo',
- '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus'} }
+ '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
+ '*dirty': 'BlockDirtyInfo' } }
##
# @query-block:
--
1.7.6.5
- [Qemu-devel] [PATCH 14/32] monitor: Prevent removing fd from set during init, (continued)
- [Qemu-devel] [PATCH 14/32] monitor: Prevent removing fd from set during init, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 09/32] qemu-iotests: Add 043 backing file chain infinite loop test, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 17/32] block: add bdrv_query_stats, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 15/32] qemu-config: Add new -add-fd command line option, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 19/32] block: introduce new dirty bitmap functionality, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 21/32] block: rename block_job_complete to block_job_completed, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 13/32] monitor: Enable adding an inherited fd to an fd set, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 22/32] block: add block-job-complete, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 16/32] block: add bdrv_query_info, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 18/32] block: add bdrv_open_backing_file, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 20/32] block: export dirty bitmap information in query-block,
Kevin Wolf <=
- [Qemu-devel] [PATCH 25/32] qmp: add drive-mirror command, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 24/32] mirror: introduce mirror job, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 23/32] block: introduce BLOCK_JOB_READY event, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 31/32] qemu-iotests: add testcases for mirroring on-source-error/on-target-error, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 29/32] mirror: add support for on-source-error/on-target-error, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 30/32] qmp: add pull_event function, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 32/32] osdep: Less restrictive F_SEFL in qemu_dup_flags(), Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 27/32] qemu-iotests: add mirroring test case, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 26/32] mirror: implement completion, Kevin Wolf, 2012/10/24
- [Qemu-devel] [PATCH 28/32] iostatus: forward block_job_iostatus_reset to block job, Kevin Wolf, 2012/10/24