[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 22/42] migration-test: Create guest_use_dirty_log()
From: |
Juan Quintela |
Subject: |
[PATCH 22/42] migration-test: Create guest_use_dirty_log() |
Date: |
Fri, 9 Jun 2023 00:49:23 +0200 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
tests/qtest/migration-test.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 9671c4c6e5..69a3728e4b 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -156,6 +156,7 @@ typedef struct {
gchar *arch_opts;
gchar *arch_source;
gchar *arch_target;
+ gchar *kvm_opts;
const gchar *memory_size;
const gchar *name;
unsigned start_address;
@@ -208,9 +209,16 @@ static void guest_destroy(GuestState *vm)
g_free(vm->arch_opts);
g_free(vm->arch_source);
g_free(vm->arch_target);
+ g_free(vm->kvm_opts);
g_free(vm);
}
+static void guest_use_dirty_ring(GuestState *vm)
+{
+ g_assert(vm->kvm_opts == NULL);
+ vm->kvm_opts = g_strdup(",dirty-ring-size=4096");
+}
+
/*
* Wait for some output in the serial output file,
* we get an 'A' followed by an endless string of 'B's
@@ -608,8 +616,6 @@ typedef struct {
bool use_shmem;
/* only launch the target process */
bool only_target;
- /* Use dirty ring if true; dirty logging otherwise */
- bool use_dirty_ring;
const char *opts_source;
const char *opts_target;
} MigrateStart;
@@ -708,7 +714,6 @@ static void test_migrate_start(GuestState *from, GuestState
*to,
const gchar *ignore_stderr = NULL;
g_autofree char *shmem_opts = NULL;
g_autofree char *shmem_path = NULL;
- const char *kvm_opts = NULL;
got_src_stop = false;
got_dst_resume = false;
@@ -733,16 +738,12 @@ static void test_migrate_start(GuestState *from,
GuestState *to,
from->memory_size, shmem_path);
}
- if (args->use_dirty_ring) {
- kvm_opts = ",dirty-ring-size=4096";
- }
-
cmd_source = g_strdup_printf("-accel kvm%s -accel tcg "
"-name %s,debug-threads=on "
"-m %s "
"-serial file:%s/src_serial "
"%s %s %s %s %s",
- kvm_opts ? kvm_opts : "",
+ from->kvm_opts ? from->kvm_opts : "",
from->name,
from->memory_size, tmpfs,
from->arch_opts ? from->arch_opts : "",
@@ -764,7 +765,7 @@ static void test_migrate_start(GuestState *from, GuestState
*to,
"-serial file:%s/dest_serial "
"-incoming %s "
"%s %s %s %s %s",
- kvm_opts ? kvm_opts : "",
+ to->kvm_opts ? to->kvm_opts : "",
to->name,
to->memory_size, tmpfs, uri,
to->arch_opts ? to->arch_opts : "",
@@ -1555,9 +1556,6 @@ static void test_precopy_unix_dirty_ring(void)
GuestState *from = guest_create("source");
GuestState *to = guest_create("target");
MigrateCommon args = {
- .start = {
- .use_dirty_ring = true,
- },
.listen_uri = uri,
.connect_uri = uri,
/*
@@ -1567,6 +1565,8 @@ static void test_precopy_unix_dirty_ring(void)
.live = true,
};
+ guest_use_dirty_ring(from);
+ guest_use_dirty_ring(to);
test_precopy_common(from, to, &args);
}
@@ -2588,6 +2588,9 @@ static int64_t get_limit_rate(QTestState *who)
static GuestState *dirtylimit_start_vm(void)
{
GuestState *vm = guest_create("dirtylimit-test");
+
+ guest_use_dirty_ring(vm);
+
g_autofree gchar *
cmd = g_strdup_printf("-accel kvm,dirty-ring-size=4096 "
"-name dirtylimit-test,debug-threads=on "
--
2.40.1
- [PATCH 12/42] migration-test: Enable back ignore-shared test, (continued)
- [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, 2023/06/08
- [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 <=
- [PATCH 23/42] migration-test: Move serial to GuestState, Juan Quintela, 2023/06/08
- [PATCH 24/42] migration-test: Re-enable multifd_cancel test, Juan Quintela, 2023/06/08
- [PATCH 26/42] migration-test: create guest_use_shmem(), Juan Quintela, 2023/06/08
- [PATCH 29/42] migration-test: Create the migration unix socket by guest, Juan Quintela, 2023/06/08
- [PATCH 25/42] migration-test: We were not waiting for "target" to finish, Juan Quintela, 2023/06/08
- [PATCH 27/42] migration-test: Create guest_extra_opts(), Juan Quintela, 2023/06/08
- [PATCH 28/42] migration-test: Create guest_hide_stderr(), Juan Quintela, 2023/06/08