[PATCH v6 15/25] iotests: run the persistent dirty bitmap test on parallels
"Denis V. Lunev" <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu.block,gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <[email protected]> |
From: Denis V. Lunev <[email protected]> parallels stores persistent dirty bitmaps now, so test 165 applies to it as well. The bitmap name is the only format specific bit: parallels keeps it as the UUID identifying the bitmap in the image, so a name like 'bitmap0' is rejected on store. test_reopen_rw is skipped, as parallels has no bdrv_reopen_prepare() and blockdev-reopen fails with "does not support reopening files". Skipped cases do not show up in the reference output, so 165.out stays as it is. test_persistent covers what the series adds: it dirties the bitmap, records its hash, restarts the VM twice and compares the hash again, which passes only if the bitmap survives both the store on inactivation and the load on open. Cc: Stefan Hajnoczi <[email protected]> Signed-off-by: Denis V. Lunev <[email protected]> --- tests/qemu-iotests/165 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165 index b3b1709d71..5fd411974d 100755 --- a/tests/qemu-iotests/165 +++ b/tests/qemu-iotests/165 @@ -27,6 +27,12 @@ from iotests import qemu_img disk = os.path.join(iotests.test_dir, 'disk') disk_size = 0x40000000 # 1G +# parallels stores a bitmap name as the UUID identifying it in the image +if iotests.imgfmt == 'parallels': + bitmap_name = 'b2c9e1a4-5d3f-4e8b-9a7c-6f0d1e2b3a45' +else: + bitmap_name = 'bitmap0' + # regions for qemu_io: (start, count) in bytes regions1 = ((0x0fff00, 0x10000), (0x200000, 0x100000)) @@ -50,12 +56,12 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): def getSha256(self): result = self.vm.qmp('x-debug-block-dirty-bitmap-sha256', - node='drive0', name='bitmap0') + node='drive0', name=bitmap_name) return result['return']['sha256'] def checkBitmap(self, sha256): result = self.vm.qmp('x-debug-block-dirty-bitmap-sha256', - node='drive0', name='bitmap0') + node='drive0', name=bitmap_name) self.assert_qmp(result, 'return/sha256', sha256); def writeRegions(self, regions): @@ -65,7 +71,7 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): def qmpAddBitmap(self): self.vm.qmp('block-dirty-bitmap-add', node='drive0', - name='bitmap0', persistent=True) + name=bitmap_name, persistent=True) def test_persistent(self): self.vm = self.mkVm() @@ -100,6 +106,8 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): self.vm.shutdown() + # parallels has no bdrv_reopen_prepare() yet + @iotests.skip_for_formats(('parallels',)) def test_reopen_rw(self): self.vm = self.mkVm() self.vm.launch() @@ -115,7 +123,7 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): assert sha256_1 != sha256_2 # Otherwise, it's not very interesting. self.vm.cmd('block-dirty-bitmap-clear', node='drive0', - name='bitmap0') + name=bitmap_name) # Start with regions1 @@ -152,6 +160,6 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): if __name__ == '__main__': - iotests.main(supported_fmts=['qcow2'], + iotests.main(supported_fmts=['qcow2', 'parallels'], supported_protocols=['file'], unsupported_imgopts=['compat']) -- 2.53.0