tests/qtest/migration: Use defer for all tests
Change all invocations of migrate_start to use defer. The uri parameter will be removed from that function in subsequent patches. Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Link: https://lore.kernel.org/r/20260505160915.25558-11-farosas@suse.de Signed-off-by: Peter Xu <peterx@redhat.com>
Fabiano Rosas committed
May 5, 2026 at 13:09 UTC
897d7b053bccc8f36624daf768334417779d3d5a
1 file changed
+8
-6
tests/qtest/migration/misc-tests.c
+8
-6
@@ -28,9 +28,11 @@ static void test_baddest(char *name, MigrateCommon *args)
28
29
args->start.hide_stderr = true;
30
31
- if (migrate_start(&from, &to, "tcp:127.0.0.1:0", &args->start)) {
31
+ if (migrate_start(&from, &to, "defer", &args->start)) {
32
return;
33
}
34
+
35
+ migrate_incoming_qmp(to, "tcp:127.0.0.1:0", NULL, "{}");
36
migrate_qmp(from, to, "tcp:127.0.0.1:0", NULL, "{}");
37
wait_for_migration_fail(from, false);
38
migrate_end(from, to, false);
@@ -52,8 +54,7 @@ static void test_analyze_script(char *name, MigrateCommon *args)
54
return;
55
}
56
55
- /* dummy url */
56
- if (migrate_start(&from, &to, "tcp:127.0.0.1:0", &args->start)) {
57
+ if (migrate_start(&from, &to, "defer", &args->start)) {
58
return;
59
}
60
@@ -69,6 +70,7 @@ static void test_analyze_script(char *name, MigrateCommon *args)
70
uri = g_strdup_printf("exec:cat > %s", file);
71
72
migrate_ensure_converge(from);
73
+ migrate_incoming_qmp(to, "tcp:127.0.0.1:0", NULL, "{}");
74
migrate_qmp(from, to, uri, NULL, "{}");
75
wait_for_migration_complete(from);
76
@@ -178,13 +180,15 @@ static void do_test_validate_uri_channel(MigrateCommon *args)
180
QTestState *from, *to;
181
QObject *channels;
182
181
- if (migrate_start(&from, &to, args->listen_uri, &args->start)) {
183
+ if (migrate_start(&from, &to, "defer", &args->start)) {
184
return;
185
}
186
187
/* Wait for the first serial output from the source */
188
wait_for_serial("src_serial");
189
190
+ migrate_incoming_qmp(to, "tcp:127.0.0.1:0", NULL, "{}");
191
+
192
/*
193
* 'uri' and 'channels' validation is checked even before the migration
194
* starts.
@@ -248,7 +252,6 @@ static void test_validate_caps_pair(char *test_path, MigrateCommon *args)
252
253
static void test_validate_uri_channels_both_set(char *name, MigrateCommon *args)
254
{
251
- args->listen_uri = "defer",
255
args->connect_uri = "tcp:127.0.0.1:0",
256
args->connect_channels = ("[ { ""'channel-type': 'main',"
257
" 'addr': { 'transport': 'socket',"
@@ -263,7 +266,6 @@ static void test_validate_uri_channels_both_set(char *name, MigrateCommon *args)
266
267
static void test_validate_uri_channels_none_set(char *name, MigrateCommon *args)
268
{
266
- args->listen_uri = "defer";
269
args->start.hide_stderr = true;
270
271
do_test_validate_uri_channel(args);