]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
block: remove 'dirty-bitmaps' field from 'BlockInfo' struct
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 19 Feb 2021 19:22:36 +0000 (19:22 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 18 Mar 2021 09:22:55 +0000 (09:22 +0000)
The same data is available in the 'BlockDeviceInfo' struct.

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
block/qapi.c
docs/system/deprecated.rst
docs/system/removed-features.rst
qapi/block-core.json
tests/qemu-iotests/194
tests/qemu-iotests/236
tests/qemu-iotests/246
tests/qemu-iotests/254
tests/qemu-iotests/260
tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test

index 3acc118c445b6bbf77fa88b4044aa434f96bdd1c..943e7b15ad220dc4c5b6f7fc56f8a62cc94f7ce6 100644 (file)
@@ -383,11 +383,6 @@ static void bdrv_query_info(BlockBackend *blk, BlockInfo **p_info,
         info->io_status = blk_iostatus(blk);
     }
 
-    if (bs && !QLIST_EMPTY(&bs->dirty_bitmaps)) {
-        info->has_dirty_bitmaps = true;
-        info->dirty_bitmaps = bdrv_query_dirty_bitmaps(bs);
-    }
-
     if (bs && bs->drv) {
         info->has_inserted = true;
         info->inserted = bdrv_block_device_info(blk, bs, false, errp);
index eadba0f28859270f9d3f4e63a4aacdd5a2fa5080..c7e80fa73108d8c16855487b09252a0c5fc42461 100644 (file)
@@ -198,19 +198,6 @@ Use arguments ``base-node`` and ``top-node`` instead.
 
 Specify the properties for the object as top-level arguments instead.
 
-``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.
-
 ``nbd-server-add`` and ``nbd-server-remove`` (since 5.2)
 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
index 47fdfe6f72bbd538d464e6cfcf60c753bd61e6af..d164d3f290df20c60d0940c31b6aafd803f42726 100644 (file)
@@ -127,6 +127,15 @@ The ``status`` field of the ``BlockDirtyInfo`` structure, returned by
 these commands is removed. Two new boolean fields, ``recording`` and
 ``busy`` effectively replace it.
 
+``query-block`` result field ``dirty-bitmaps`` (removed in 6.0)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The ``dirty-bitmaps`` field of the ``BlockInfo`` structure, returned by
+the query-block command is itself now removed. 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.
+
 Human Monitor Protocol (HMP) commands
 -------------------------------------
 
index 2a0c345c2cf4063b1efb34abf4d86b2b6c5e0491..0399449e132b333999233d285bdfb78d3a380718 100644 (file)
 # @tray_open: True if the device's tray is open
 #             (only present if it has a tray)
 #
-# @dirty-bitmaps: dirty bitmaps information (only present if the
-#                 driver has one or more dirty bitmaps) (Since 2.0)
-#
 # @io-status: @BlockDeviceIoStatus. Only present if the device
 #             supports it and the VM is configured to stop on errors
 #             (supported device models: virtio-blk, IDE, SCSI except
 # @inserted: @BlockDeviceInfo describing the device if media is
 #            present
 #
-# Features:
-# @deprecated: Member @dirty-bitmaps is deprecated.  Use @inserted
-#              member @dirty-bitmaps instead.
-#
 # Since:  0.14
 ##
 { 'struct': 'BlockInfo',
   'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
-           '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
-           '*dirty-bitmaps': { 'type': ['BlockDirtyInfo'],
-                               'features': [ 'deprecated' ] } } }
+           '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } }
 
 ##
 # @BlockMeasureInfo:
index 3889266afaacd37f04646d830a5a7a04852eff0a..e44b8df7280e2d10e7934d5db9d76af7f799a217 100755 (executable)
@@ -95,7 +95,7 @@ with iotests.FilePath('source.img') as source_img_path, \
     iotests.log(event, filters=[iotests.filter_qmp_event])
 
     iotests.log('Check bitmaps on source:')
-    iotests.log(source_vm.qmp('query-block')['return'][0]['dirty-bitmaps'])
+    iotests.log(source_vm.qmp('query-block')['return'][0]['inserted']['dirty-bitmaps'])
 
     iotests.log('Check bitmaps on target:')
-    iotests.log(dest_vm.qmp('query-block')['return'][0]['dirty-bitmaps'])
+    iotests.log(dest_vm.qmp('query-block')['return'][0]['inserted']['dirty-bitmaps'])
index f6c44517d6b5a838eeb0a6cf70cd796fea0bf0e7..20419bbb9e54bb08bfdc6390f03e7caf8399d613 100755 (executable)
@@ -39,7 +39,7 @@ overwrite = [("0xab", "0",         "64k"), # Full overwrite
 
 def query_bitmaps(vm):
     res = vm.qmp("query-block")
-    return { "bitmaps": { device['device']: device.get('dirty-bitmaps', []) for
+    return { "bitmaps": { device['device']: device.get('inserted', {}).get('dirty-bitmaps', []) for
                           device in res['return'] } }
 
 with iotests.FilePath('img') as img_path, \
index fa3102c546c1e0d19a0100cc00224c1fb2831bc0..5932a0e8a97bdd5975a4bc0813f9b8e299e4fadf 100755 (executable)
@@ -30,7 +30,8 @@ gran_large = 128 * 1024
 
 def query_bitmaps(vm):
     res = vm.qmp("query-block")
-    return { "bitmaps": { device['device']: device.get('dirty-bitmaps', []) for
+    return { "bitmaps": { device['device']: device.get('inserted', {})
+                          .get('dirty-bitmaps', []) for
                           device in res['return'] } }
 
 with iotests.FilePath('img') as img_path, \
index 49da94840741a2fd8956dbfe4f54342e6093fe32..108bf5f894c6b3328c144a5de1eea280e22ba3b4 100755 (executable)
@@ -73,7 +73,7 @@ vm.qmp_log('transaction', indent=2, actions=[
 result = vm.qmp('query-block')['return'][0]
 log("query-block: device = {}, node-name = {}, dirty-bitmaps:".format(
     result['device'], result['inserted']['node-name']))
-log(result['dirty-bitmaps'], indent=2)
+log(result['inserted']['dirty-bitmaps'], indent=2)
 log("\nbitmaps in backing image:")
 log(result['inserted']['image']['backing-image']['format-specific'] \
     ['data']['bitmaps'], indent=2)
index a35cb7b61f183dbd8ca30503b3801541cfb39f31..2ec64a9b9952cd26ac7c795fca36d8209396d345 100755 (executable)
@@ -32,8 +32,9 @@ size = 64 * 1024 * 3
 
 def print_bitmap(msg, vm):
     result = vm.qmp('query-block')['return'][0]
-    if 'dirty-bitmaps' in result:
-        bitmap = result['dirty-bitmaps'][0]
+    info = result.get("inserted", {})
+    if 'dirty-bitmaps' in info:
+        bitmap = info['dirty-bitmaps'][0]
         log('{}: name={} dirty-clusters={}'.format(msg, bitmap['name'],
             bitmap['count'] // 64 // 1024))
     else:
index dbf10e58d3b2dc0cb426a3fce4fffece1b3a6dff..d046ebeb949c6abae79ff8e749e862db3bd6824d 100755 (executable)
@@ -67,10 +67,12 @@ def event_dist(e1, e2):
 def check_bitmaps(vm, count):
     result = vm.qmp('query-block')
 
+    info = result['return'][0].get('inserted', {})
+
     if count == 0:
-        assert 'dirty-bitmaps' not in result['return'][0]
+        assert 'dirty-bitmaps' not in info
     else:
-        assert len(result['return'][0]['dirty-bitmaps']) == count
+        assert len(info['dirty-bitmaps']) == count
 
 
 class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):