PostcopyRecoveryFailStage postcopy_recovery_fail_stage;
} MigrateCommon;
-static int test_migrate_start(QTestState **from, QTestState **to,
- const char *uri, MigrateStart *args)
+static int migrate_start(QTestState **from, QTestState **to,
+ const char *uri, MigrateStart *args)
{
g_autofree gchar *arch_source = NULL;
g_autofree gchar *arch_target = NULL;
return 0;
}
-static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
+static void migrate_end(QTestState *from, QTestState *to, bool test_dest)
{
unsigned char dest_byte_a, dest_byte_b, dest_byte_c, dest_byte_d;
{
QTestState *from, *to;
- if (test_migrate_start(&from, &to, "defer", &args->start)) {
+ if (migrate_start(&from, &to, "defer", &args->start)) {
return -1;
}
args->postcopy_data = NULL;
}
- test_migrate_end(from, to, true);
+ migrate_end(from, to, true);
}
static void test_postcopy_common(MigrateCommon *args)
};
QTestState *from, *to;
- if (test_migrate_start(&from, &to, "tcp:127.0.0.1:0", &args)) {
+ if (migrate_start(&from, &to, "tcp:127.0.0.1:0", &args)) {
return;
}
migrate_qmp(from, to, "tcp:127.0.0.1:0", NULL, "{}");
wait_for_migration_fail(from, false);
- test_migrate_end(from, to, false);
+ migrate_end(from, to, false);
}
#ifndef _WIN32
}
/* dummy url */
- if (test_migrate_start(&from, &to, "tcp:127.0.0.1:0", &args)) {
+ if (migrate_start(&from, &to, "tcp:127.0.0.1:0", &args)) {
return;
}
g_test_message("Failed to analyze the migration stream");
g_test_fail();
}
- test_migrate_end(from, to, false);
+ migrate_end(from, to, false);
cleanup("migfile");
}
#endif
QTestState *from, *to;
void *data_hook = NULL;
- if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) {
+ if (migrate_start(&from, &to, args->listen_uri, &args->start)) {
return;
}
args->end_hook(from, to, data_hook);
}
- test_migrate_end(from, to, args->result == MIG_TEST_SUCCEED);
+ migrate_end(from, to, args->result == MIG_TEST_SUCCEED);
}
static void file_dirty_offset_region(void)
void *data_hook = NULL;
bool check_offset = false;
- if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) {
+ if (migrate_start(&from, &to, args->listen_uri, &args->start)) {
return;
}
args->end_hook(from, to, data_hook);
}
- test_migrate_end(from, to, args->result == MIG_TEST_SUCCEED);
+ migrate_end(from, to, args->result == MIG_TEST_SUCCEED);
}
static void test_precopy_unix_plain(void)
g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
QTestState *from, *to;
- if (test_migrate_start(&from, &to, uri, false, true, NULL, NULL)) {
+ if (migrate_start(&from, &to, uri, false, true, NULL, NULL)) {
return;
}
/* Check whether shared RAM has been really skipped */
g_assert_cmpint(read_ram_property_int(from, "transferred"), <, 1024 * 1024);
- test_migrate_end(from, to, true);
+ migrate_end(from, to, true);
}
#endif
qobject_unref(rsp);
}
-static void test_migrate_precopy_fd_socket(void)
+static void test_precopy_fd_socket(void)
{
MigrateCommon args = {
.listen_uri = "defer",
return NULL;
}
-static void test_migrate_precopy_fd_file(void)
+static void test_precopy_fd_file(void)
{
MigrateCommon args = {
.listen_uri = "defer",
g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
QTestState *from, *to;
- if (test_migrate_start(&from, &to, uri, args)) {
+ if (migrate_start(&from, &to, uri, args)) {
return;
}
wait_for_migration_complete(from);
}
- test_migrate_end(from, to, false);
+ migrate_end(from, to, false);
}
static void test_validate_uuid(void)
{
QTestState *from, *to;
- if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) {
+ if (migrate_start(&from, &to, args->listen_uri, &args->start)) {
return;
}
* starts.
*/
migrate_qmp_fail(from, args->connect_uri, args->connect_channels, "{}");
- test_migrate_end(from, to, false);
+ migrate_end(from, to, false);
}
static void test_validate_uri_channels_both_set(void)
* To make things even worse, we need to run the initial stage at
* 3MB/s so we enter autoconverge even when host is (over)loaded.
*/
-static void test_migrate_auto_converge(void)
+static void test_auto_converge(void)
{
g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
MigrateStart args = {};
uint64_t prev_dirty_sync_cnt, dirty_sync_cnt;
int max_try_count, hit = 0;
- if (test_migrate_start(&from, &to, uri, &args)) {
+ if (migrate_start(&from, &to, uri, &args)) {
return;
}
wait_for_serial("dest_serial");
wait_for_migration_complete(from);
- test_migrate_end(from, to, true);
+ migrate_end(from, to, true);
}
static void *
};
QTestState *from, *to, *to2;
- if (test_migrate_start(&from, &to, "defer", &args)) {
+ if (migrate_start(&from, &to, "defer", &args)) {
return;
}
/*
* Ensure the source QEMU finishes its cancellation process before we
- * proceed with the setup of the next migration. The test_migrate_start()
+ * proceed with the setup of the next migration. The 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
.only_target = true,
};
- if (test_migrate_start(&from, &to2, "defer", &args)) {
+ if (migrate_start(&from, &to2, "defer", &args)) {
return;
}
wait_for_serial("dest_serial");
wait_for_migration_complete(from);
- test_migrate_end(from, to2, true);
+ migrate_end(from, to2, true);
}
static void calc_dirty_rate(QTestState *who, uint64_t calc_time)
* And see if dirty limit migration works correctly.
* This test case involves many passes, so it runs in slow mode only.
*/
-static void test_migrate_dirty_limit(void)
+static void test_dirty_limit(void)
{
g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
QTestState *from, *to;
};
/* Start src, dst vm */
- if (test_migrate_start(&from, &to, args.listen_uri, &args.start)) {
+ if (migrate_start(&from, &to, args.listen_uri, &args.start)) {
return;
}
};
/* Restart dst vm, src vm already show up so we needn't wait anymore */
- if (test_migrate_start(&from, &to, args.listen_uri, &args.start)) {
+ if (migrate_start(&from, &to, args.listen_uri, &args.start)) {
return;
}
wait_for_serial("dest_serial");
wait_for_migration_complete(from);
- test_migrate_end(from, to, true);
+ migrate_end(from, to, true);
}
static bool kvm_dirty_ring_supported(void)
/* migration_test_add("/migration/ignore_shared", test_ignore_shared); */
#ifndef _WIN32
migration_test_add("/migration/precopy/fd/tcp",
- test_migrate_precopy_fd_socket);
+ test_precopy_fd_socket);
migration_test_add("/migration/precopy/fd/file",
- test_migrate_precopy_fd_file);
+ test_precopy_fd_file);
#endif
migration_test_add("/migration/validate_uuid", test_validate_uuid);
migration_test_add("/migration/validate_uuid_error",
*/
if (g_test_slow()) {
migration_test_add("/migration/auto_converge",
- test_migrate_auto_converge);
+ test_auto_converge);
if (g_str_equal(arch, "x86_64") &&
has_kvm && kvm_dirty_ring_supported()) {
migration_test_add("/migration/dirty_limit",
- test_migrate_dirty_limit);
+ test_dirty_limit);
}
}
migration_test_add("/migration/multifd/tcp/uri/plain/none",