-#!/usr/bin/env python
+#!/usr/bin/env python3
+# group: rw quick
#
# Tests for temporary external snapshot when we have bitmaps.
#
import iotests
from iotests import qemu_img_create, file_path, log, filter_qmp_event
-iotests.verify_image_format(supported_fmts=['qcow2'])
+iotests.script_initialize(
+ supported_fmts=['qcow2'],
+ unsupported_imgopts=['compat']
+)
base, top = file_path('base', 'top')
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: