Commit 845b2204 authored by Vladimir Sementsov-Ogievskiy's avatar Vladimir Sementsov-Ogievskiy Committed by Eric Blake
Browse files

qemu-iotests/199: add early shutdown case to bitmaps postcopy



Previous patches fixed two crashes which may occur on shutdown prior to
bitmaps postcopy finished. Check that it works now.

Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: default avatarAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Tested-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20200727194236.19551-21-vsementsov@virtuozzo.com>
Signed-off-by: default avatarEric Blake <eblake@redhat.com>
parent d4c6fcc0
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -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'])
+2 −2
Original line number Diff line number Diff line
.
..
----------------------------------------------------------------------
Ran 1 tests
Ran 2 tests

OK