[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/36] iotests: test bitmap moving inside 254
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 21/36] iotests: test bitmap moving inside 254 |
Date: |
Fri, 16 Aug 2019 19:13:03 -0400 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Test persistent bitmap copying with and without removal of original
bitmap.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
[Edited comment "bitmap1" --> "bitmap2" as per review. --js]
Signed-off-by: John Snow <address@hidden>
---
tests/qemu-iotests/254 | 30 +++++++++++++-
tests/qemu-iotests/254.out | 82 ++++++++++++++++++++++++++++++++++++++
2 files changed, 110 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/254 b/tests/qemu-iotests/254
index 8edba91c5d4..09584f3f7de 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()
diff --git a/tests/qemu-iotests/254.out b/tests/qemu-iotests/254.out
index d7394cf0026..d185c0532f6 100644
--- a/tests/qemu-iotests/254.out
+++ b/tests/qemu-iotests/254.out
@@ -1,5 +1,9 @@
{"execute": "block-dirty-bitmap-add", "arguments": {"name": "bitmap0", "node":
"drive0"}}
{"return": {}}
+{"execute": "block-dirty-bitmap-add", "arguments": {"name": "bitmap1", "node":
"drive0", "persistent": true}}
+{"return": {}}
+{"execute": "block-dirty-bitmap-add", "arguments": {"name": "bitmap2", "node":
"drive0", "persistent": true}}
+{"return": {}}
{
"execute": "transaction",
"arguments": {
@@ -31,6 +35,55 @@
"target": "bitmap0"
},
"type": "block-dirty-bitmap-merge"
+ },
+ {
+ "data": {
+ "name": "bitmap1",
+ "node": "snap",
+ "persistent": true
+ },
+ "type": "block-dirty-bitmap-add"
+ },
+ {
+ "data": {
+ "bitmaps": [
+ {
+ "name": "bitmap1",
+ "node": "base"
+ }
+ ],
+ "node": "snap",
+ "target": "bitmap1"
+ },
+ "type": "block-dirty-bitmap-merge"
+ },
+ {
+ "data": {
+ "name": "bitmap2",
+ "node": "snap",
+ "persistent": true
+ },
+ "type": "block-dirty-bitmap-add"
+ },
+ {
+ "data": {
+ "bitmaps": [
+ {
+ "name": "bitmap2",
+ "node": "base"
+ }
+ ],
+ "node": "snap",
+ "target": "bitmap2"
+ },
+ "type": "block-dirty-bitmap-merge"
+ },
+ {
+ "data": {
+ "name": "bitmap2",
+ "node": "base"
+ },
+ "type": "block-dirty-bitmap-remove"
}
]
}
@@ -40,6 +93,24 @@
}
query-block: device = drive0, node-name = snap, dirty-bitmaps:
[
+ {
+ "busy": false,
+ "count": 524288,
+ "granularity": 65536,
+ "name": "bitmap2",
+ "persistent": true,
+ "recording": true,
+ "status": "active"
+ },
+ {
+ "busy": false,
+ "count": 524288,
+ "granularity": 65536,
+ "name": "bitmap1",
+ "persistent": true,
+ "recording": true,
+ "status": "active"
+ },
{
"busy": false,
"count": 524288,
@@ -50,3 +121,14 @@ query-block: device = drive0, node-name = snap,
dirty-bitmaps:
"status": "active"
}
]
+
+bitmaps in backing image:
+[
+ {
+ "flags": [
+ "auto"
+ ],
+ "granularity": 65536,
+ "name": "bitmap1"
+ }
+]
--
2.21.0
- [Qemu-devel] [PULL 09/36] block/dirty-bitmap: add bdrv_dirty_bitmap_merge_internal, (continued)
- [Qemu-devel] [PULL 09/36] block/dirty-bitmap: add bdrv_dirty_bitmap_merge_internal, John Snow, 2019/08/16
- [Qemu-devel] [PULL 10/36] block/dirty-bitmap: add bdrv_dirty_bitmap_get, John Snow, 2019/08/16
- [Qemu-devel] [PULL 05/36] block/backup: Add mirror sync mode 'bitmap', John Snow, 2019/08/16
- [Qemu-devel] [PULL 14/36] iotests: teach run_job to cancel pending jobs, John Snow, 2019/08/16
- [Qemu-devel] [PULL 15/36] iotests: teach FilePath to produce multiple paths, John Snow, 2019/08/16
- [Qemu-devel] [PULL 13/36] iotests: add testing shim for script-style python tests, John Snow, 2019/08/16
- [Qemu-devel] [PULL 18/36] block/backup: loosen restriction on readonly bitmaps, John Snow, 2019/08/16
- [Qemu-devel] [PULL 16/36] iotests: Add virtio-scsi device helper, John Snow, 2019/08/16
- [Qemu-devel] [PULL 12/36] block/backup: add 'always' bitmap sync policy, John Snow, 2019/08/16
- [Qemu-devel] [PULL 11/36] block/backup: upgrade copy_bitmap to BdrvDirtyBitmap, John Snow, 2019/08/16
- [Qemu-devel] [PULL 21/36] iotests: test bitmap moving inside 254,
John Snow <=
- [Qemu-devel] [PULL 19/36] blockdev: reduce aio_context locked sections in bitmap add/remove, John Snow, 2019/08/16
- [Qemu-devel] [PULL 20/36] qapi: implement block-dirty-bitmap-remove transaction action, John Snow, 2019/08/16
- [Qemu-devel] [PULL 22/36] iotests/257: add Pattern class, John Snow, 2019/08/16
- [Qemu-devel] [PULL 25/36] block/backup: hoist bitmap check into QMP interface, John Snow, 2019/08/16
- [Qemu-devel] [PULL 23/36] iotests/257: add EmulatedBitmap class, John Snow, 2019/08/16
- [Qemu-devel] [PULL 29/36] block/backup: add backup_is_cluster_allocated, John Snow, 2019/08/16
- [Qemu-devel] [PULL 28/36] block/backup: centralize copy_bitmap initialization, John Snow, 2019/08/16
- [Qemu-devel] [PULL 30/36] block/backup: teach TOP to never copy unallocated regions, John Snow, 2019/08/16
- [Qemu-devel] [PULL 27/36] block/backup: improve sync=bitmap work estimates, John Snow, 2019/08/16
- [Qemu-devel] [PULL 34/36] block/backup: deal with zero detection, John Snow, 2019/08/16