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>
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);
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)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
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
-------------------------------------
# @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:
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'])
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, \
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, \
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)
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:
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):