aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2023-10-18 16:27:36 -0300
committerJuan Quintela <quintela@redhat.com>2023-10-20 08:51:41 +0200
commitc99613910106fd9a79005a3e8f47b1ce7d46dbc4 (patch)
tree134dbf79b4fe9a3a3fa2b4cd2de07c951ea28018 /tests
parentdcf389cbc84c2b714d49887775918c5f03f73864 (diff)
downloadqemu-c99613910106fd9a79005a3e8f47b1ce7d46dbc4.zip
qemu-c99613910106fd9a79005a3e8f47b1ce7d46dbc4.tar.gz
qemu-c99613910106fd9a79005a3e8f47b1ce7d46dbc4.tar.bz2
tests/qtest/migration: Define a machine for all architectures
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> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231018192741.25885-8-farosas@suse.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/migration-test.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 241b409..dfea75b 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_alias, *machine_opts = "";
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_alias = "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_alias = "s390-ccw-virtio";
arch_opts = g_strdup_printf("-bios %s", bootpath);
start_address = S390_TEST_MEM_START;
end_address = S390_TEST_MEM_END;
@@ -771,11 +774,14 @@ 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);
- arch_opts = g_strdup("-nodefaults -machine vsmt=8");
+ machine_alias = "pseries";
+ machine_opts = "vsmt=8";
+ arch_opts = g_strdup("-nodefaults");
} else if (strcmp(arch, "aarch64") == 0) {
memory_size = "150M";
- arch_opts = g_strdup_printf("-machine virt,gic-version=max -cpu max "
- "-kernel %s", bootpath);
+ machine_alias = "virt";
+ machine_opts = "gic-version=max";
+ arch_opts = g_strdup_printf("-cpu max -kernel %s", bootpath);
start_address = ARM_TEST_MEM_START;
end_address = ARM_TEST_MEM_END;
} else {
@@ -810,11 +816,13 @@ static int test_migrate_start(QTestState **from, QTestState **to,
}
cmd_source = g_strdup_printf("-accel kvm%s -accel tcg "
+ "-machine %s,%s "
"-name source,debug-threads=on "
"-m %s "
"-serial file:%s/src_serial "
"%s %s %s %s %s",
kvm_opts ? kvm_opts : "",
+ machine_alias, machine_opts,
memory_size, tmpfs,
arch_opts ? arch_opts : "",
arch_source ? arch_source : "",
@@ -829,12 +837,14 @@ static int test_migrate_start(QTestState **from, QTestState **to,
}
cmd_target = g_strdup_printf("-accel kvm%s -accel tcg "
+ "-machine %s,%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_alias, machine_opts,
memory_size, tmpfs, uri,
arch_opts ? arch_opts : "",
arch_target ? arch_target : "",