static int migrate_postcopy_prepare(QTestState **from_ptr,
QTestState **to_ptr,
+ void **hook_data,
MigrateCommon *args)
{
QTestState *from, *to;
}
if (args->start_hook) {
- args->postcopy_data = args->start_hook(from, to);
+ *hook_data = args->start_hook(from, to);
}
migrate_ensure_non_converge(from);
}
static void migrate_postcopy_complete(QTestState *from, QTestState *to,
- MigrateCommon *args)
+ void *hook_data, MigrateCommon *args)
{
MigrationTestEnv *env = migration_get_env();
}
if (args->end_hook) {
- args->end_hook(from, to, args->postcopy_data);
- args->postcopy_data = NULL;
+ args->end_hook(from, to, hook_data);
}
migrate_end(from, to, true);
void test_postcopy_common(MigrateCommon *args)
{
+ void *hook_data = NULL;
QTestState *from, *to;
- if (migrate_postcopy_prepare(&from, &to, args)) {
+ if (migrate_postcopy_prepare(&from, &to, &hook_data, args)) {
return;
}
migrate_postcopy_start(from, to, &src_state);
- migrate_postcopy_complete(from, to, args);
+ migrate_postcopy_complete(from, to, hook_data, args);
}
static void wait_for_postcopy_status(QTestState *one, const char *status)
{
QTestState *from, *to;
g_autofree char *uri = NULL;
+ void *hook_data = NULL;
/*
* Always enable OOB QMP capability for recovery tests, migrate-recover is
/* Always hide errors for postcopy recover tests since they're expected */
args->start.hide_stderr = true;
- if (migrate_postcopy_prepare(&from, &to, args)) {
+ if (migrate_postcopy_prepare(&from, &to, &hook_data, args)) {
return;
}
/* Restore the postcopy bandwidth to unlimited */
migrate_set_parameter_int(from, "max-postcopy-bandwidth", 0);
- migrate_postcopy_complete(from, to, args);
+ migrate_postcopy_complete(from, to, hook_data, args);
}
int test_precopy_common(MigrateCommon *args)