#endif
}
-void test_postcopy_recovery_common(MigrateCommon *args)
+void test_postcopy_recovery_common(MigrateCommon *args,
+ PostcopyRecoveryFailStage fail_stage)
{
QTestState *from, *to;
g_autofree char *uri = NULL;
wait_for_postcopy_status(to, "postcopy-paused");
wait_for_postcopy_status(from, "postcopy-paused");
- if (args->postcopy_recovery_fail_stage) {
+ if (fail_stage) {
/*
* Test when a wrong socket specified for recover, and then the
* ability to kick it out, and continue with a correct socket.
*/
- postcopy_recover_fail(from, to, args->postcopy_recovery_fail_stage);
+ postcopy_recover_fail(from, to, fail_stage);
/* continue with a good recovery */
}
* refer to existing ones with live=true), or use live=off by default.
*/
bool live;
-
- /* Postcopy specific fields */
- PostcopyRecoveryFailStage postcopy_recovery_fail_stage;
} MigrateCommon;
void wait_for_serial(const char *side);
void migrate_end(QTestState *from, QTestState *to, bool test_dest);
void test_postcopy_common(MigrateCommon *args);
-void test_postcopy_recovery_common(MigrateCommon *args);
+void test_postcopy_recovery_common(MigrateCommon *args,
+ PostcopyRecoveryFailStage fail_stage);
int test_precopy_common(MigrateCommon *args);
void test_file_common(MigrateCommon *args, bool stop_src);
void *migrate_hook_start_precopy_tcp_multifd_common(QTestState *from,
static void test_postcopy_recovery(char *name, MigrateCommon *args)
{
- test_postcopy_recovery_common(args);
+ test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE);
}
static void test_postcopy_recovery_fail_handshake(char *name,
MigrateCommon *args)
{
- args->postcopy_recovery_fail_stage = POSTCOPY_FAIL_RECOVERY;
-
- test_postcopy_recovery_common(args);
+ test_postcopy_recovery_common(args, POSTCOPY_FAIL_RECOVERY);
}
static void test_postcopy_recovery_fail_reconnect(char *name,
MigrateCommon *args)
{
- args->postcopy_recovery_fail_stage = POSTCOPY_FAIL_CHANNEL_ESTABLISH;
-
- test_postcopy_recovery_common(args);
+ test_postcopy_recovery_common(args, POSTCOPY_FAIL_CHANNEL_ESTABLISH);
}
static void test_postcopy_preempt_recovery(char *name, MigrateCommon *args)
{
args->start.caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] = true;
- test_postcopy_recovery_common(args);
+ test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE);
}
static void migration_test_add_postcopy_smoke(MigrationTestEnv *env)
args->start_hook = migrate_hook_start_tls_psk_match;
args->end_hook = migrate_hook_end_tls_psk;
- test_postcopy_recovery_common(args);
+ test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE);
}
static void test_multifd_postcopy_recovery_tls_psk(char *name,
args->start.caps[MIGRATION_CAPABILITY_MULTIFD] = true;
- test_postcopy_recovery_common(args);
+ test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE);
}
/* This contains preempt+recovery+tls test altogether */
args->start.caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] = true;
- test_postcopy_recovery_common(args);
+ test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE);
}
static void test_multifd_postcopy_preempt_recovery_tls_psk(char *name,
args->start.caps[MIGRATION_CAPABILITY_MULTIFD] = true;
args->start.caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] = true;
- test_postcopy_recovery_common(args);
+ test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE);
}
static void test_precopy_unix_tls_psk(char *name, MigrateCommon *args)