qemu-server/test/MigrationTest
Fabian Ebner 0783c3c271 migration: move finishing block jobs to phase2 for better/uniform error handling
avoids the possibility to die during phase3_cleanup and instead of needing to
duplicate the cleanup ourselves, benefit from phase2_cleanup doing so.

The duplicate cleanup was also very incomplete: it didn't stop the remote kvm
process (leading to 'VM already running' when trying to migrate again
afterwards), but it removed its disks, and it didn't unlock the config, didn't
close the tunnel and didn't cancel the block-dirty bitmaps.

Since migrate_cancel should do nothing after the (non-storage) migrate process
has completed, even that cleanup step is fine here.

Since phase3 is empty at the moment, the order of operations is still the same.

Also add a test, that would complain about finish_tunnel not being called before
this patch. That test also checks that local disks are not already removed
before finishing the block jobs.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-18 18:30:41 +02:00
..
QemuMigrateMock.pm migration: move finishing block jobs to phase2 for better/uniform error handling 2021-04-18 18:30:41 +02:00
QmMock.pm test: migration: add parse_volume_id calls 2021-04-18 18:30:41 +02:00
Shared.pm test: migration: add parse_volume_id calls 2021-04-18 18:30:41 +02:00