[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/42] migration-test: test_migrate_start() always return 0
From: |
Juan Quintela |
Subject: |
[PATCH 14/42] migration-test: test_migrate_start() always return 0 |
Date: |
Fri, 9 Jun 2023 00:49:15 +0200 |
So make it return void instead and adjust all callers.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
tests/qtest/migration-test.c | 38 ++++++++++--------------------------
1 file changed, 10 insertions(+), 28 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 5837060138..b57811da75 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -629,8 +629,8 @@ typedef struct {
bool postcopy_preempt;
} MigrateCommon;
-static int test_migrate_start(QTestState **from, QTestState **to,
- const char *uri, MigrateStart *args)
+static void test_migrate_start(QTestState **from, QTestState **to,
+ const char *uri, MigrateStart *args)
{
g_autofree gchar *arch_source = NULL;
g_autofree gchar *arch_target = NULL;
@@ -745,8 +745,6 @@ static int test_migrate_start(QTestState **from, QTestState
**to,
if (args->use_shmem) {
unlink(shmem_path);
}
-
- return 0;
}
static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
@@ -1155,9 +1153,7 @@ static int migrate_postcopy_prepare(QTestState **from_ptr,
g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
QTestState *from, *to;
- if (test_migrate_start(&from, &to, uri, &args->start)) {
- return -1;
- }
+ test_migrate_start(&from, &to, uri, &args->start);
if (args->start_hook) {
args->postcopy_data = args->start_hook(from, to);
@@ -1387,9 +1383,7 @@ static void test_baddest(void)
};
QTestState *from, *to;
- if (test_migrate_start(&from, &to, "tcp:127.0.0.1:0", &args)) {
- return;
- }
+ test_migrate_start(&from, &to, "tcp:127.0.0.1:0", &args);
migrate_qmp(from, "tcp:127.0.0.1:0", "{}");
wait_for_migration_fail(from, false);
test_migrate_end(from, to, false);
@@ -1400,9 +1394,7 @@ static void test_precopy_common(MigrateCommon *args)
QTestState *from, *to;
void *data_hook = NULL;
- if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) {
- return;
- }
+ test_migrate_start(&from, &to, args->listen_uri, &args->start);
if (args->start_hook) {
data_hook = args->start_hook(from, to);
@@ -1592,9 +1584,7 @@ static void test_ignore_shared(void)
.use_shmem = true
};
- if (test_migrate_start(&from, &to, uri, &args)) {
- return;
- }
+ test_migrate_start(&from, &to, uri, &args);
migrate_set_capability(from, "x-ignore-shared", true);
migrate_set_capability(to, "x-ignore-shared", true);
@@ -1893,9 +1883,7 @@ static void do_test_validate_uuid(MigrateStart *args,
bool should_fail)
g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
QTestState *from, *to;
- if (test_migrate_start(&from, &to, uri, args)) {
- return;
- }
+ test_migrate_start(&from, &to, uri, args);
/*
* UUID validation is at the begin of migration. So, the main process of
@@ -1990,9 +1978,7 @@ static void test_migrate_auto_converge(void)
*/
const int64_t init_pct = 5, inc_pct = 25, max_pct = 95;
- if (test_migrate_start(&from, &to, uri, &args)) {
- return;
- }
+ test_migrate_start(&from, &to, uri, &args);
migrate_set_capability(from, "auto-converge", true);
migrate_set_parameter_int(from, "cpu-throttle-initial", init_pct);
@@ -2302,9 +2288,7 @@ static void test_multifd_tcp_cancel(void)
QTestState *from, *to, *to2;
g_autofree char *uri = NULL;
- if (test_migrate_start(&from, &to, "defer", &args)) {
- return;
- }
+ test_migrate_start(&from, &to, "defer", &args);
migrate_ensure_non_converge(from);
@@ -2337,9 +2321,7 @@ static void test_multifd_tcp_cancel(void)
.only_target = true,
};
- if (test_migrate_start(&from, &to2, "defer", &args)) {
- return;
- }
+ test_migrate_start(&from, &to2, "defer", &args);
migrate_set_parameter_int(to2, "multifd-channels", 16);
--
2.40.1
- [PATCH 11/42] migration-test: Update test_ignore_shared to use args, (continued)
- [PATCH 11/42] migration-test: Update test_ignore_shared to use args, Juan Quintela, 2023/06/08
- [PATCH 12/42] migration-test: Enable back ignore-shared test, Juan Quintela, 2023/06/08
- [PATCH 13/42] migration-test: Check for shared memory like for everything else, Juan Quintela, 2023/06/08
- [PATCH 15/42] migration-test: migrate_postcopy_prepare() always return 0, Juan Quintela, 2023/06/08
- [PATCH 14/42] migration-test: test_migrate_start() always return 0,
Juan Quintela <=
- [PATCH 16/42] migration-test: Create do_migrate(), Juan Quintela, 2023/06/08
- [PATCH 17/42] migration-test: Introduce GuestState, Juan Quintela, 2023/06/08
- [PATCH 18/42] migration-test: Create guest before calling do_test_validate_uuid(), Juan Quintela, 2023/06/08
- [PATCH 19/42] migration-test: Create guest before calling test_precopy_common(), Juan Quintela, 2023/06/08
- [PATCH 20/42] migration-test: Create guest before calling test_postcopy_common(), Juan Quintela, 2023/06/08
- [PATCH 21/42] migration-test: Move common guest code to guest_create(), Juan Quintela, 2023/06/08
- [PATCH 22/42] migration-test: Create guest_use_dirty_log(), Juan Quintela, 2023/06/08