[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/24] qemu-iotests/199: add early shutdown case to bitmaps postco
From: |
Eric Blake |
Subject: |
[PULL 21/24] qemu-iotests/199: add early shutdown case to bitmaps postcopy |
Date: |
Mon, 27 Jul 2020 15:55:40 -0500 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Previous patches fixed two crashes which may occur on shutdown prior to
bitmaps postcopy finished. Check that it works now.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Tested-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200727194236.19551-21-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
tests/qemu-iotests/199 | 24 ++++++++++++++++++++++++
tests/qemu-iotests/199.out | 4 ++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 5fd34f0fcdfa..140930b2b12e 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -217,6 +217,30 @@ class
TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
sha = self.discards1_sha256 if i % 2 else self.all_discards_sha256
self.assert_qmp(result, 'return/sha256', sha)
+ def test_early_shutdown_destination(self):
+ self.start_postcopy()
+
+ self.vm_b_events += self.vm_b.get_qmp_events()
+ self.vm_b.shutdown()
+ # recreate vm_b, so there is no incoming option, which prevents
+ # loading bitmaps from disk
+ self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b)
+ self.vm_b.launch()
+ check_bitmaps(self.vm_b, 0)
+
+ # Bitmaps will be lost if we just shutdown the vm, as they are marked
+ # to skip storing to disk when prepared for migration. And that's
+ # correct, as actual data may be modified in target vm, so we play
+ # safe.
+ # Still, this mark would be taken away if we do 'cont', and bitmaps
+ # become persistent again. (see iotest 169 for such behavior case)
+ result = self.vm_a.qmp('query-status')
+ assert not result['return']['running']
+ self.vm_a_events += self.vm_a.get_qmp_events()
+ self.vm_a.shutdown()
+ self.vm_a.launch()
+ check_bitmaps(self.vm_a, 0)
+
if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2'])
diff --git a/tests/qemu-iotests/199.out b/tests/qemu-iotests/199.out
index ae1213e6f863..fbc63e62f885 100644
--- a/tests/qemu-iotests/199.out
+++ b/tests/qemu-iotests/199.out
@@ -1,5 +1,5 @@
-.
+..
----------------------------------------------------------------------
-Ran 1 tests
+Ran 2 tests
OK
--
2.27.0
- [PULL 10/24] migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup, (continued)
- [PULL 10/24] migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup, Eric Blake, 2020/07/27
- [PULL 15/24] migration/block-dirty-bitmap: keep bitmap state for all bitmaps, Eric Blake, 2020/07/27
- [PULL 14/24] migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete, Eric Blake, 2020/07/27
- [PULL 13/24] migration/block-dirty-bitmap: rename finish_lock to just lock, Eric Blake, 2020/07/27
- [PULL 16/24] migration/block-dirty-bitmap: relax error handling in incoming part, Eric Blake, 2020/07/27
- [PULL 17/24] migration/block-dirty-bitmap: cancel migration on shutdown, Eric Blake, 2020/07/27
- [PULL 18/24] migration/savevm: don't worry if bitmap migration postcopy failed, Eric Blake, 2020/07/27
- [PULL 20/24] qemu-iotests/199: check persistent bitmaps, Eric Blake, 2020/07/27
- [PULL 22/24] qemu-iotests/199: add source-killed case to bitmaps postcopy, Eric Blake, 2020/07/27
- [PULL 19/24] qemu-iotests/199: prepare for new test-cases addition, Eric Blake, 2020/07/27
- [PULL 21/24] qemu-iotests/199: add early shutdown case to bitmaps postcopy,
Eric Blake <=
- [PULL 23/24] iotests: Adjust which migration tests are quick, Eric Blake, 2020/07/27
- [PULL 24/24] migration: Fix typos in bitmap migration comments, Eric Blake, 2020/07/27
- Re: [PULL 00/24] bitmaps patches for -rc2, 2020-07-27, Peter Maydell, 2020/07/28