aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/254
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2019-07-29 16:35:54 -0400
committerJohn Snow <jsnow@redhat.com>2019-08-16 16:28:03 -0400
commit3f7b2fa8cd476fe871ce1d996c640317730752a0 (patch)
treee1097a4da568f91f36827c09e5fd5fc951960422 /tests/qemu-iotests/254
parentc4e4b0fa598ddc9cee6ba7a06899ce0a8dae6c61 (diff)
iotests: test bitmap moving inside 254
Test persistent bitmap copying with and without removal of original bitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190708220502.12977-4-jsnow@redhat.com [Edited comment "bitmap1" --> "bitmap2" as per review. --js] Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/254')
-rwxr-xr-xtests/qemu-iotests/25430
1 files changed, 28 insertions, 2 deletions
diff --git a/tests/qemu-iotests/254 b/tests/qemu-iotests/254
index 8edba91c5d..09584f3f7d 100755
--- a/tests/qemu-iotests/254
+++ b/tests/qemu-iotests/254
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Test external snapshot with bitmap copying.
+# Test external snapshot with bitmap copying and moving.
#
# Copyright (c) 2019 Virtuozzo International GmbH. All rights reserved.
#
@@ -32,6 +32,10 @@ vm = iotests.VM().add_drive(disk, opts='node-name=base')
vm.launch()
vm.qmp_log('block-dirty-bitmap-add', node='drive0', name='bitmap0')
+vm.qmp_log('block-dirty-bitmap-add', node='drive0', name='bitmap1',
+ persistent=True)
+vm.qmp_log('block-dirty-bitmap-add', node='drive0', name='bitmap2',
+ persistent=True)
vm.hmp_qemu_io('drive0', 'write 0 512K')
@@ -39,16 +43,38 @@ vm.qmp_log('transaction', indent=2, actions=[
{'type': 'blockdev-snapshot-sync',
'data': {'device': 'drive0', 'snapshot-file': top,
'snapshot-node-name': 'snap'}},
+
+ # copy non-persistent bitmap0
{'type': 'block-dirty-bitmap-add',
'data': {'node': 'snap', 'name': 'bitmap0'}},
{'type': 'block-dirty-bitmap-merge',
'data': {'node': 'snap', 'target': 'bitmap0',
- 'bitmaps': [{'node': 'base', 'name': 'bitmap0'}]}}
+ 'bitmaps': [{'node': 'base', 'name': 'bitmap0'}]}},
+
+ # copy persistent bitmap1, original will be saved to base image
+ {'type': 'block-dirty-bitmap-add',
+ 'data': {'node': 'snap', 'name': 'bitmap1', 'persistent': True}},
+ {'type': 'block-dirty-bitmap-merge',
+ 'data': {'node': 'snap', 'target': 'bitmap1',
+ 'bitmaps': [{'node': 'base', 'name': 'bitmap1'}]}},
+
+ # move persistent bitmap2, original will be removed and not saved
+ # to base image
+ {'type': 'block-dirty-bitmap-add',
+ 'data': {'node': 'snap', 'name': 'bitmap2', 'persistent': True}},
+ {'type': 'block-dirty-bitmap-merge',
+ 'data': {'node': 'snap', 'target': 'bitmap2',
+ 'bitmaps': [{'node': 'base', 'name': 'bitmap2'}]}},
+ {'type': 'block-dirty-bitmap-remove',
+ 'data': {'node': 'base', 'name': 'bitmap2'}}
], filters=[iotests.filter_qmp_testfiles])
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("\nbitmaps in backing image:")
+log(result['inserted']['image']['backing-image']['format-specific'] \
+ ['data']['bitmaps'], indent=2)
vm.shutdown()