[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V7 17/24] migration-test: memory_backend
From: |
Steve Sistare |
Subject: |
[PATCH V7 17/24] migration-test: memory_backend |
Date: |
Wed, 15 Jan 2025 11:00:43 -0800 |
Allow each migration test to define its own memory backend, replacing
the standard "-m <size>" specification.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
---
tests/qtest/migration/framework.c | 15 +++++++++++----
tests/qtest/migration/framework.h | 5 +++++
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/tests/qtest/migration/framework.c
b/tests/qtest/migration/framework.c
index 47ce078..81a0e49 100644
--- a/tests/qtest/migration/framework.c
+++ b/tests/qtest/migration/framework.c
@@ -210,6 +210,7 @@ int migrate_start(QTestState **from, QTestState **to, const
char *uri,
const char *machine_alias, *machine_opts = "";
g_autofree char *machine = NULL;
const char *bootpath;
+ g_autofree char *memory_backend = NULL;
if (args->use_shmem) {
if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) {
@@ -285,6 +286,12 @@ int migrate_start(QTestState **from, QTestState **to,
const char *uri,
memory_size, shmem_path);
}
+ if (args->memory_backend) {
+ memory_backend = g_strdup_printf(args->memory_backend, memory_size);
+ } else {
+ memory_backend = g_strdup_printf("-m %s ", memory_size);
+ }
+
if (args->use_dirty_ring) {
kvm_opts = ",dirty-ring-size=4096";
}
@@ -303,12 +310,12 @@ int migrate_start(QTestState **from, QTestState **to,
const char *uri,
cmd_source = g_strdup_printf("-accel kvm%s -accel tcg "
"-machine %s,%s "
"-name source,debug-threads=on "
- "-m %s "
+ "%s "
"-serial file:%s/src_serial "
"%s %s %s %s",
kvm_opts ? kvm_opts : "",
machine, machine_opts,
- memory_size, tmpfs,
+ memory_backend, tmpfs,
arch_opts ? arch_opts : "",
shmem_opts ? shmem_opts : "",
args->opts_source ? args->opts_source : "",
@@ -323,13 +330,13 @@ int migrate_start(QTestState **from, QTestState **to,
const char *uri,
cmd_target = g_strdup_printf("-accel kvm%s -accel tcg "
"-machine %s,%s "
"-name target,debug-threads=on "
- "-m %s "
+ "%s "
"-serial file:%s/dest_serial "
"-incoming %s "
"%s %s %s %s",
kvm_opts ? kvm_opts : "",
machine, machine_opts,
- memory_size, tmpfs, uri,
+ memory_backend, tmpfs, uri,
arch_opts ? arch_opts : "",
shmem_opts ? shmem_opts : "",
args->opts_target ? args->opts_target : "",
diff --git a/tests/qtest/migration/framework.h
b/tests/qtest/migration/framework.h
index e9fc4ec..d368fcf 100644
--- a/tests/qtest/migration/framework.h
+++ b/tests/qtest/migration/framework.h
@@ -109,6 +109,11 @@ typedef struct {
const char *opts_target;
/* suspend the src before migrating to dest. */
bool suspend_me;
+ /*
+ * Format string for the main memory backend, containing one %s where the
+ * size is plugged in. If omitted, "-m %s" is used.
+ */
+ const char *memory_backend;
} MigrateStart;
typedef enum PostcopyRecoveryFailStage {
--
1.8.3.1
- [PATCH V7 04/24] physmem: fd-based shared memory, (continued)
- [PATCH V7 04/24] physmem: fd-based shared memory, Steve Sistare, 2025/01/15
- [PATCH V7 02/24] physmem: fix qemu_ram_alloc_from_fd size calculation, Steve Sistare, 2025/01/15
- [PATCH V7 05/24] memory: add RAM_PRIVATE, Steve Sistare, 2025/01/15
- [PATCH V7 07/24] migration: cpr-state, Steve Sistare, 2025/01/15
- [PATCH V7 09/24] hostmem-memfd: preserve for cpr, Steve Sistare, 2025/01/15
- [PATCH V7 06/24] machine: aux-ram-share option, Steve Sistare, 2025/01/15
- [PATCH V7 11/24] migration: enhance migrate_uri_parse, Steve Sistare, 2025/01/15
- [PATCH V7 12/24] migration: incoming channel, Steve Sistare, 2025/01/15
- [PATCH V7 14/24] migration: VMSTATE_FD, Steve Sistare, 2025/01/15
- [PATCH V7 13/24] migration: SCM_RIGHTS for QEMUFile, Steve Sistare, 2025/01/15
- [PATCH V7 17/24] migration-test: memory_backend,
Steve Sistare <=
- [PATCH V7 15/24] migration: cpr-transfer save and load, Steve Sistare, 2025/01/15
- [PATCH V7 10/24] hostmem-shm: preserve for cpr, Steve Sistare, 2025/01/15
- [PATCH V7 16/24] migration: cpr-transfer mode, Steve Sistare, 2025/01/15
- [PATCH V7 22/24] tests/qtest: assert qmp connected, Steve Sistare, 2025/01/15
- [PATCH V7 21/24] tests/qtest: enhance migration channels, Steve Sistare, 2025/01/15
- [PATCH V7 24/24] migration: cpr-transfer documentation, Steve Sistare, 2025/01/15
- [PATCH V7 18/24] tests/qtest: optimize migrate_set_ports, Steve Sistare, 2025/01/15
- [PATCH V7 19/24] tests/qtest: defer connection, Steve Sistare, 2025/01/15
- [PATCH V7 20/24] migration-test: defer connection, Steve Sistare, 2025/01/15
- [PATCH V7 23/24] migration-test: cpr-transfer, Steve Sistare, 2025/01/15