]> Git Repo - qemu.git/commitdiff
qapi: add dirty-bitmaps to query-named-block-nodes result
authorVladimir Sementsov-Ogievskiy <[email protected]>
Mon, 29 Jul 2019 20:35:56 +0000 (16:35 -0400)
committerJohn Snow <[email protected]>
Fri, 16 Aug 2019 22:29:43 +0000 (18:29 -0400)
Let's add a possibility to query dirty-bitmaps not only on root nodes.
It is useful when dealing both with snapshots and incremental backups.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: John Snow <[email protected]>
Message-id: 20190717173937[email protected]
[Added deprecation information. --js]
Signed-off-by: John Snow <[email protected]>
[Fixed spelling --js]

block/qapi.c
qapi/block-core.json
qemu-deprecated.texi

index 917435f02262a7b2190ffa2d7858ff2e5ffaf2cb..15f1030264731e02453b9eb006e9d7da3c7b9e24 100644 (file)
@@ -79,6 +79,11 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,
         info->backing_file = g_strdup(bs->backing_file);
     }
 
+    if (!QLIST_EMPTY(&bs->dirty_bitmaps)) {
+        info->has_dirty_bitmaps = true;
+        info->dirty_bitmaps = bdrv_query_dirty_bitmaps(bs);
+    }
+
     info->detect_zeroes = bs->detect_zeroes;
 
     if (blk && blk_get_public(blk)->throttle_group_member.throttle_state) {
index d72cf5f354b4922384b8c3599c4fb36df99331f1..e9364a4a2938c5d047c1e348059ede9acdf6b28f 100644 (file)
 # @write_threshold: configured write threshold for the device.
 #                   0 if disabled. (Since 2.3)
 #
+# @dirty-bitmaps: dirty bitmaps information (only present if node
+#                 has one or more dirty bitmaps) (Since 4.2)
+#
 # Since: 0.14.0
 #
 ##
             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
             '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
-            'write_threshold': 'int' } }
+            'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
 
 ##
 # @BlockDeviceIoStatus:
 #
 # @dirty-bitmaps: dirty bitmaps information (only present if the
 #                 driver has one or more dirty bitmaps) (Since 2.0)
+#                 Deprecated in 4.2; see BlockDeviceInfo instead.
 #
 # @io-status: @BlockDeviceIoStatus. Only present if the device
 #             supports it and the VM is configured to stop on errors
index f7680c08e10a0b0377fc60b21cd723fb8689dce9..00a4b6f35042f771f67db1e6a91df4df6f20d243 100644 (file)
@@ -154,6 +154,18 @@ The ``status'' field of the ``BlockDirtyInfo'' structure, returned by
 the query-block command is deprecated. Two new boolean fields,
 ``recording'' and ``busy'' effectively replace it.
 
+@subsection query-block result field dirty-bitmaps (Since 4.2)
+
+The ``dirty-bitmaps`` field of the ``BlockInfo`` structure, returned by
+the query-block command is itself now deprecated. The ``dirty-bitmaps``
+field of the ``BlockDeviceInfo`` struct should be used instead, which is the
+type of the ``inserted`` field in query-block replies, as well as the
+type of array items in query-named-block-nodes.
+
+Since the ``dirty-bitmaps`` field is optionally present in both the old and
+new locations, clients must use introspection to learn where to anticipate
+the field if/when it does appear in command output.
+
 @subsection query-cpus (since 2.12.0)
 
 The ``query-cpus'' command is replaced by the ``query-cpus-fast'' command.
This page took 0.034672 seconds and 4 git commands to generate.