aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJuraj Marcin <jmarcin@redhat.com>2024-09-20 18:13:02 +0200
committerPeter Xu <peterx@redhat.com>2024-10-08 15:28:55 -0400
commit9adcdd49e39149b494b7b6174ef0b7f2d906845b (patch)
tree3d75b270e26994572776b9c3a334e26cd1756753 /tests
parentccf6b78275816c9dec84d3a40e9aa3b6ba6ebc06 (diff)
downloadqemu-9adcdd49e39149b494b7b6174ef0b7f2d906845b.zip
qemu-9adcdd49e39149b494b7b6174ef0b7f2d906845b.tar.gz
qemu-9adcdd49e39149b494b7b6174ef0b7f2d906845b.tar.bz2
tests/migration-test: Wait for cancellation sooner in multifd cancel
The source QEMU might not finish the cancellation of the migration before we start setting up the next attempt. During the setup, the test_migrate_start() function and others might need to interact with the source in a way that is not possible unless the migration is fully canceled. For example, setting capabilities when the migration is still running leads to an error. By moving the wait before the setup, we ensure this does not happen. Cc: Peter Xu <peterx@redhat.com> Signed-off-by: Juraj Marcin <jmarcin@redhat.com> Link: https://lore.kernel.org/r/20240920161319.2337625-1-jmarcin@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/migration-test.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 814ec10..95e45b5 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -3267,6 +3267,16 @@ static void test_multifd_tcp_cancel(void)
qtest_wait_qemu(to);
qtest_quit(to);
+ /*
+ * Ensure the source QEMU finishes its cancellation process before we
+ * proceed with the setup of the next migration. The test_migrate_start()
+ * function and others might want to interact with the source in a way that
+ * is not possible while the migration is not canceled properly. For
+ * example, setting migration capabilities when the migration is still
+ * running leads to an error.
+ */
+ wait_for_migration_status(from, "cancelled", NULL);
+
args = (MigrateStart){
.only_target = true,
};
@@ -3282,8 +3292,6 @@ static void test_multifd_tcp_cancel(void)
/* Start incoming migration from the 1st socket */
migrate_incoming_qmp(to2, "tcp:127.0.0.1:0", "{}");
- wait_for_migration_status(from, "cancelled", NULL);
-
migrate_ensure_non_converge(from);
migrate_qmp(from, to2, NULL, NULL, "{}");