[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 23/45] block: export dirty bitmap information in
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH v2 23/45] block: export dirty bitmap information in query-block |
Date: |
Wed, 26 Sep 2012 17:56:29 +0200 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
v1->v2: new
block.c | 6 ++++++
qapi-schema.json | 20 ++++++++++++++++++--
2 file modificati, 24 inserzioni(+), 2 rimozioni(-)
diff --git a/block.c b/block.c
index 2c1273c..074325d 100644
--- a/block.c
+++ b/block.c
@@ -2697,6 +2697,12 @@ 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;
+ }
+
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 26ac21f..dd418b8 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -604,7 +604,7 @@
'*backing_file': 'str', 'backing_file_depth': 'int',
'encrypted': 'bool', 'encryption_key_missing': 'bool',
'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
- 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
+ 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
##
# @BlockDeviceIoStatus:
@@ -622,6 +622,18 @@
{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
##
+# @BlockDirtyInfo:
+#
+# Block dirty bitmap information.
+#
+# @count: number of dirty sectors according to the dirty bitmap
+#
+# Since: 1.3
+##
+{ 'type': 'BlockDirtyInfo',
+ 'data': {'count': 'int'} }
+
+##
# @BlockInfo:
#
# Block device information. This structure describes a virtual device and
@@ -640,6 +652,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
#
@@ -651,7 +666,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.12
- Re: [Qemu-devel] [PATCH v2 14/45] block: introduce block job error, (continued)
- [Qemu-devel] [PATCH v2 16/45] blkdebug: process all set_state rules in the old state, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 17/45] qemu-iotests: map underscore to dash in QMP argument names, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 20/45] block: add bdrv_query_stats, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 19/45] block: add bdrv_query_info, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 18/45] qemu-iotests: add tests for streaming error handling, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 22/45] block: introduce new dirty bitmap functionality, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 23/45] block: export dirty bitmap information in query-block,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v2 26/45] mirror: introduce mirror job, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 24/45] block: add block-job-complete, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 27/45] qmp: add drive-mirror command, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 32/45] qmp: add pull_event function, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 36/45] block: implement dirty bitmap using HBitmap, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 37/45] block: make round_to_clusters public, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 39/45] block: return count of dirty sectors, not chunks, Paolo Bonzini, 2012/09/26