[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 07/11] tests/qtest/migration: Define a machine for all archite
From: |
Fabiano Rosas |
Subject: |
[PATCH v3 07/11] tests/qtest/migration: Define a machine for all architectures |
Date: |
Wed, 18 Oct 2023 11:07:32 -0300 |
Stop relying on defaults and select a machine explicitly for every
architecture.
This is a prerequisite for being able to select machine types for
migration using different QEMU binaries for source and destination.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
tests/qtest/migration-test.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index e1c110537b..40de320fcc 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -743,6 +743,7 @@ static int test_migrate_start(QTestState **from, QTestState
**to,
const char *kvm_opts = NULL;
const char *arch = qtest_get_arch();
const char *memory_size;
+ const char *machine;
if (args->use_shmem) {
if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) {
@@ -755,11 +756,13 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
got_dst_resume = false;
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
memory_size = "150M";
+ machine = "pc";
arch_opts = g_strdup_printf("-drive file=%s,format=raw", bootpath);
start_address = X86_TEST_MEM_START;
end_address = X86_TEST_MEM_END;
} else if (g_str_equal(arch, "s390x")) {
memory_size = "128M";
+ machine = "s390-ccw-virtio";
arch_opts = g_strdup_printf("-bios %s", bootpath);
start_address = S390_TEST_MEM_START;
end_address = S390_TEST_MEM_END;
@@ -771,10 +774,12 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
"'nvramrc=hex .\" _\" begin %x %x "
"do i c@ 1 + i c! 1000 +loop .\" B\" 0 "
"until'", end_address, start_address);
+ machine = "pseries";
arch_opts = g_strdup("-nodefaults -machine vsmt=8");
} else if (strcmp(arch, "aarch64") == 0) {
memory_size = "150M";
- arch_opts = g_strdup_printf("-machine virt,gic-version=max -cpu max "
+ machine = "virt";
+ arch_opts = g_strdup_printf("-machine gic-version=max -cpu max "
"-kernel %s", bootpath);
start_address = ARM_TEST_MEM_START;
end_address = ARM_TEST_MEM_END;
@@ -810,11 +815,13 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
}
cmd_source = g_strdup_printf("-accel kvm%s -accel tcg "
+ "-machine %s "
"-name source,debug-threads=on "
"-m %s "
"-serial file:%s/src_serial "
"%s %s %s %s %s",
kvm_opts ? kvm_opts : "",
+ machine,
memory_size, tmpfs,
arch_opts ? arch_opts : "",
arch_source ? arch_source : "",
@@ -829,12 +836,14 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
}
cmd_target = g_strdup_printf("-accel kvm%s -accel tcg "
+ "-machine %s "
"-name target,debug-threads=on "
"-m %s "
"-serial file:%s/dest_serial "
"-incoming %s "
"%s %s %s %s %s",
kvm_opts ? kvm_opts : "",
+ machine,
memory_size, tmpfs, uri,
arch_opts ? arch_opts : "",
arch_target ? arch_target : "",
--
2.35.3
- [PATCH v3 00/11] tests/migration-test: Allow testing older machine types, Fabiano Rosas, 2023/10/18
- [PATCH v3 01/11] tests/qtest: Allow qtest_qemu_binary to use a custom environment variable, Fabiano Rosas, 2023/10/18
- [PATCH v3 02/11] tests/qtest: Introduce qtest_init_with_env, Fabiano Rosas, 2023/10/18
- [PATCH v3 05/11] tests/qtest: Introduce qtest_resolve_machine_alias, Fabiano Rosas, 2023/10/18
- [PATCH v3 06/11] tests/qtest/migration: Introduce find_common_machine_version, Fabiano Rosas, 2023/10/18
- [PATCH v3 07/11] tests/qtest/migration: Define a machine for all architectures,
Fabiano Rosas <=
- [PATCH v3 08/11] tests/qtest/migration: Specify the geometry of the bootsector, Fabiano Rosas, 2023/10/18
- [PATCH v3 11/11] tests/qtest: Don't print messages from query instances, Fabiano Rosas, 2023/10/18
- [PATCH v3 03/11] tests/qtest: Allow qtest_get_machines to use an alternate QEMU binary, Fabiano Rosas, 2023/10/18
- [PATCH v3 04/11] tests/qtest: Introduce qtest_has_machine_with_env, Fabiano Rosas, 2023/10/18
- [PATCH v3 09/11] tests/qtest/migration: Set q35 as the default machine for x86_86, Fabiano Rosas, 2023/10/18
- [PATCH v3 10/11] tests/qtest/migration: Support more than one QEMU binary, Fabiano Rosas, 2023/10/18
- Re: [PATCH v3 10/11] tests/qtest/migration: Support more than one QEMU binary, Peter Xu, 2023/10/18