aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.include4
-rw-r--r--tests/arm-cpu-features.c4
-rw-r--r--tests/bios-tables-test.c16
-rw-r--r--tests/boot-serial-test.c4
-rw-r--r--tests/cdrom-test.c2
-rw-r--r--tests/cpu-plug-test.c6
-rw-r--r--tests/libqtest.c4
-rw-r--r--tests/migration-test.c264
-rw-r--r--tests/pflash-cfi02-test.c4
-rw-r--r--tests/pnv-xscom-test.c4
-rw-r--r--tests/prom-env-test.c2
-rw-r--r--tests/pxe-test.c2
-rw-r--r--tests/vmgenid-test.c2
13 files changed, 170 insertions, 148 deletions
diff --git a/tests/Makefile.include b/tests/Makefile.include
index b381387048..31b86674e5 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -167,7 +167,7 @@ check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF)
check-qtest-i386-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
check-qtest-i386-y += tests/fdc-test$(EXESUF)
check-qtest-i386-y += tests/ide-test$(EXESUF)
-check-qtest-i386-y += tests/ahci-test$(EXESUF)
+check-qtest-i386-$(CONFIG_TOOLS) += tests/ahci-test$(EXESUF)
check-qtest-i386-y += tests/hd-geo-test$(EXESUF)
check-qtest-i386-y += tests/boot-order-test$(EXESUF)
check-qtest-i386-y += tests/bios-tables-test$(EXESUF)
@@ -1191,7 +1191,9 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR)
.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean
check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
+ifeq ($(CONFIG_TOOLS),y)
check-block: $(patsubst %,check-%, $(check-block-y))
+endif
check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
check-clean:
rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
diff --git a/tests/arm-cpu-features.c b/tests/arm-cpu-features.c
index 6e99aa951e..bef3ed24b6 100644
--- a/tests/arm-cpu-features.c
+++ b/tests/arm-cpu-features.c
@@ -20,8 +20,8 @@
*/
#define SVE_MAX_VQ 16
-#define MACHINE "-machine virt,gic-version=max,accel=tcg "
-#define MACHINE_KVM "-machine virt,gic-version=max,accel=kvm:tcg "
+#define MACHINE "-machine virt,gic-version=max -accel tcg "
+#define MACHINE_KVM "-machine virt,gic-version=max -accel kvm -accel tcg "
#define QUERY_HEAD "{ 'execute': 'query-cpu-model-expansion', " \
" 'arguments': { 'type': 'full', "
#define QUERY_TAIL "}}"
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 79f5da092f..bc0ad594a1 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -51,7 +51,7 @@
#define ACPI_REBUILD_EXPECTED_AML "TEST_ACPI_REBUILD_AML"
typedef struct {
- const char *accel;
+ bool tcg_only;
const char *machine;
const char *variant;
const char *uefi_fl1;
@@ -607,19 +607,19 @@ static void test_acpi_one(const char *params, test_data *data)
* TODO: convert '-drive if=pflash' to new syntax (see e33763be7cd3)
* when arm/virt boad starts to support it.
*/
- args = g_strdup_printf("-machine %s,accel=%s -nodefaults -nographic "
+ args = g_strdup_printf("-machine %s %s -accel tcg -nodefaults -nographic "
"-drive if=pflash,format=raw,file=%s,readonly "
"-drive if=pflash,format=raw,file=%s,snapshot=on -cdrom %s %s",
- data->machine, data->accel ? data->accel : "kvm:tcg",
+ data->machine, data->tcg_only ? "" : "-accel kvm",
data->uefi_fl1, data->uefi_fl2, data->cd, params ? params : "");
} else {
/* Disable kernel irqchip to be able to override apic irq0. */
- args = g_strdup_printf("-machine %s,accel=%s,kernel-irqchip=off "
+ args = g_strdup_printf("-machine %s,kernel-irqchip=off %s -accel tcg "
"-net none -display none %s "
"-drive id=hd0,if=none,file=%s,format=raw "
"-device ide-hd,drive=hd0 ",
- data->machine, data->accel ? data->accel : "kvm:tcg",
+ data->machine, data->tcg_only ? "" : "-accel kvm",
params ? params : "", disk);
}
@@ -904,7 +904,7 @@ static void test_acpi_virt_tcg_memhp(void)
{
test_data data = {
.machine = "virt",
- .accel = "tcg",
+ .tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
.cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
@@ -929,7 +929,7 @@ static void test_acpi_virt_tcg_numamem(void)
{
test_data data = {
.machine = "virt",
- .accel = "tcg",
+ .tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
.cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
@@ -951,7 +951,7 @@ static void test_acpi_virt_tcg(void)
{
test_data data = {
.machine = "virt",
- .accel = "tcg",
+ .tcg_only = true,
.uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
.uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
.cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c
index d3a54a0ba5..05c7f44457 100644
--- a/tests/boot-serial-test.c
+++ b/tests/boot-serial-test.c
@@ -215,9 +215,9 @@ static void test_machine(const void *data)
* Make sure that this test uses tcg if available: It is used as a
* fast-enough smoketest for that.
*/
- qts = qtest_initf("%s %s -M %s,accel=tcg:kvm -no-shutdown "
+ qts = qtest_initf("%s %s -M %s -no-shutdown "
"-chardev file,id=serial0,path=%s "
- "-serial chardev:serial0 %s",
+ "-serial chardev:serial0 -accel tcg -accel kvm %s",
codeparam, code ? codetmp : "", test->machine,
serialtmp, test->extra);
if (code) {
diff --git a/tests/cdrom-test.c b/tests/cdrom-test.c
index 34e9974634..67635e387a 100644
--- a/tests/cdrom-test.c
+++ b/tests/cdrom-test.c
@@ -120,7 +120,7 @@ static void test_cdboot(gconstpointer data)
{
QTestState *qts;
- qts = qtest_initf("-M accel=kvm:tcg -no-shutdown %s%s", (const char *)data,
+ qts = qtest_initf("-accel kvm -accel tcg -no-shutdown %s%s", (const char *)data,
isoimage);
boot_sector_test(qts);
qtest_quit(qts);
diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c
index 30e514bbfb..e8ffbbce4b 100644
--- a/tests/cpu-plug-test.c
+++ b/tests/cpu-plug-test.c
@@ -148,11 +148,7 @@ static void add_pc_test_case(const char *mname)
(strcmp(mname, "pc-1.3") == 0) ||
(strcmp(mname, "pc-1.2") == 0) ||
(strcmp(mname, "pc-1.1") == 0) ||
- (strcmp(mname, "pc-1.0") == 0) ||
- (strcmp(mname, "pc-0.15") == 0) ||
- (strcmp(mname, "pc-0.14") == 0) ||
- (strcmp(mname, "pc-0.13") == 0) ||
- (strcmp(mname, "pc-0.12") == 0)) {
+ (strcmp(mname, "pc-1.0") == 0)) {
path = g_strdup_printf("cpu-plug/%s/init/%ux%ux%u&maxcpus=%u",
mname, data->sockets, data->cores,
data->threads, data->maxcpus);
diff --git a/tests/libqtest.c b/tests/libqtest.c
index f36e30a4de..76c9f8eade 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -241,9 +241,9 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
"-qtest-log %s "
"-chardev socket,path=%s,id=char0 "
"-mon chardev=char0,mode=control "
- "-accel qtest "
"-display none "
- "%s", qemu_binary, socket_path,
+ "%s"
+ " -accel qtest", qemu_binary, socket_path,
getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
qmp_socket_path,
extra_args ?: "");
diff --git a/tests/migration-test.c b/tests/migration-test.c
index a5343fdc66..e56e6dcb00 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -380,13 +380,6 @@ static void cleanup(const char *filename)
g_free(path);
}
-static char *get_shmem_opts(const char *mem_size, const char *shmem_path)
-{
- return g_strdup_printf("-object memory-backend-file,id=mem0,size=%s"
- ",mem-path=%s,share=on -numa node,memdev=mem0",
- mem_size, shmem_path);
-}
-
static char *SocketAddress_to_str(SocketAddress *addr)
{
switch (addr->type) {
@@ -551,27 +544,47 @@ static void migrate_postcopy_start(QTestState *from, QTestState *to)
qtest_qmp_eventwait(to, "RESUME");
}
+typedef struct {
+ bool hide_stderr;
+ bool use_shmem;
+ char *opts_source;
+ char *opts_target;
+} MigrateStart;
+
+static MigrateStart *migrate_start_new(void)
+{
+ MigrateStart *args = g_new0(MigrateStart, 1);
+
+ args->opts_source = g_strdup("");
+ args->opts_target = g_strdup("");
+ return args;
+}
+
+static void migrate_start_destroy(MigrateStart *args)
+{
+ g_free(args->opts_source);
+ g_free(args->opts_target);
+ g_free(args);
+}
+
static int test_migrate_start(QTestState **from, QTestState **to,
- const char *uri, bool hide_stderr,
- bool use_shmem, const char *opts_src,
- const char *opts_dst)
+ const char *uri, MigrateStart *args)
{
- gchar *cmd_src, *cmd_dst;
+ gchar *arch_source, *arch_target;
+ gchar *cmd_source, *cmd_target;
+ const gchar *ignore_stderr;
char *bootpath = NULL;
- char *extra_opts = NULL;
- char *shmem_path = NULL;
+ char *shmem_opts;
+ char *shmem_path;
const char *arch = qtest_get_arch();
- const char *accel = "kvm:tcg";
+ const char *machine_opts = NULL;
+ const char *memory_size;
- opts_src = opts_src ? opts_src : "";
- opts_dst = opts_dst ? opts_dst : "";
-
- if (use_shmem) {
+ if (args->use_shmem) {
if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) {
g_test_skip("/dev/shm is not supported");
return -1;
}
- shmem_path = g_strdup_printf("/dev/shm/qemu-%d", getpid());
}
got_stop = false;
@@ -580,75 +593,37 @@ static int test_migrate_start(QTestState **from, QTestState **to,
/* the assembled x86 boot sector should be exactly one sector large */
assert(sizeof(x86_bootsect) == 512);
init_bootfile(bootpath, x86_bootsect, sizeof(x86_bootsect));
- extra_opts = use_shmem ? get_shmem_opts("150M", shmem_path) : NULL;
- cmd_src = g_strdup_printf("-machine accel=%s -m 150M"
- " -name source,debug-threads=on"
- " -serial file:%s/src_serial"
- " -drive file=%s,format=raw %s %s",
- accel, tmpfs, bootpath,
- extra_opts ? extra_opts : "", opts_src);
- cmd_dst = g_strdup_printf("-machine accel=%s -m 150M"
- " -name target,debug-threads=on"
- " -serial file:%s/dest_serial"
- " -drive file=%s,format=raw"
- " -incoming %s %s %s",
- accel, tmpfs, bootpath, uri,
- extra_opts ? extra_opts : "", opts_dst);
+ memory_size = "150M";
+ arch_source = g_strdup_printf("-drive file=%s,format=raw", bootpath);
+ arch_target = g_strdup(arch_source);
start_address = X86_TEST_MEM_START;
end_address = X86_TEST_MEM_END;
} else if (g_str_equal(arch, "s390x")) {
init_bootfile(bootpath, s390x_elf, sizeof(s390x_elf));
- extra_opts = use_shmem ? get_shmem_opts("128M", shmem_path) : NULL;
- cmd_src = g_strdup_printf("-machine accel=%s -m 128M"
- " -name source,debug-threads=on"
- " -serial file:%s/src_serial -bios %s %s %s",
- accel, tmpfs, bootpath,
- extra_opts ? extra_opts : "", opts_src);
- cmd_dst = g_strdup_printf("-machine accel=%s -m 128M"
- " -name target,debug-threads=on"
- " -serial file:%s/dest_serial -bios %s"
- " -incoming %s %s %s",
- accel, tmpfs, bootpath, uri,
- extra_opts ? extra_opts : "", opts_dst);
+ memory_size = "128M";
+ arch_source = g_strdup_printf("-bios %s", bootpath);
+ arch_target = g_strdup(arch_source);
start_address = S390_TEST_MEM_START;
end_address = S390_TEST_MEM_END;
} else if (strcmp(arch, "ppc64") == 0) {
- extra_opts = use_shmem ? get_shmem_opts("256M", shmem_path) : NULL;
- cmd_src = g_strdup_printf("-machine accel=%s,vsmt=8 -m 256M -nodefaults"
- " -name source,debug-threads=on"
- " -serial file:%s/src_serial"
- " -prom-env 'use-nvramrc?=true' -prom-env "
- "'nvramrc=hex .\" _\" begin %x %x "
- "do i c@ 1 + i c! 1000 +loop .\" B\" 0 "
- "until' %s %s", accel, tmpfs, end_address,
- start_address, extra_opts ? extra_opts : "",
- opts_src);
- cmd_dst = g_strdup_printf("-machine accel=%s,vsmt=8 -m 256M"
- " -name target,debug-threads=on"
- " -serial file:%s/dest_serial"
- " -incoming %s %s %s",
- accel, tmpfs, uri,
- extra_opts ? extra_opts : "", opts_dst);
-
+ machine_opts = "vsmt=8";
+ memory_size = "256M";
+ arch_source = g_strdup_printf("-nodefaults "
+ "-prom-env 'use-nvramrc?=true' -prom-env "
+ "'nvramrc=hex .\" _\" begin %x %x "
+ "do i c@ 1 + i c! 1000 +loop .\" B\" 0 "
+ "until'", end_address, start_address);
+ arch_target = g_strdup("");
start_address = PPC_TEST_MEM_START;
end_address = PPC_TEST_MEM_END;
} else if (strcmp(arch, "aarch64") == 0) {
init_bootfile(bootpath, aarch64_kernel, sizeof(aarch64_kernel));
- extra_opts = use_shmem ? get_shmem_opts("150M", shmem_path) : NULL;
- cmd_src = g_strdup_printf("-machine virt,accel=%s,gic-version=max "
- "-name vmsource,debug-threads=on -cpu max "
- "-m 150M -serial file:%s/src_serial "
- "-kernel %s %s %s",
- accel, tmpfs, bootpath,
- extra_opts ? extra_opts : "", opts_src);
- cmd_dst = g_strdup_printf("-machine virt,accel=%s,gic-version=max "
- "-name vmdest,debug-threads=on -cpu max "
- "-m 150M -serial file:%s/dest_serial "
- "-kernel %s "
- "-incoming %s %s %s",
- accel, tmpfs, bootpath, uri,
- extra_opts ? extra_opts : "", opts_dst);
-
+ machine_opts = "virt,gic-version=max";
+ memory_size = "150M";
+ arch_source = g_strdup_printf("-cpu max "
+ "-kernel %s",
+ bootpath);
+ arch_target = g_strdup(arch_source);
start_address = ARM_TEST_MEM_START;
end_address = ARM_TEST_MEM_END;
@@ -658,34 +633,64 @@ static int test_migrate_start(QTestState **from, QTestState **to,
}
g_free(bootpath);
- g_free(extra_opts);
-
- if (hide_stderr) {
- gchar *tmp;
- tmp = g_strdup_printf("%s 2>/dev/null", cmd_src);
- g_free(cmd_src);
- cmd_src = tmp;
- tmp = g_strdup_printf("%s 2>/dev/null", cmd_dst);
- g_free(cmd_dst);
- cmd_dst = tmp;
+ if (args->hide_stderr) {
+ ignore_stderr = "2>/dev/null";
+ } else {
+ ignore_stderr = "";
}
- *from = qtest_init(cmd_src);
- g_free(cmd_src);
-
- *to = qtest_init(cmd_dst);
- g_free(cmd_dst);
+ if (args->use_shmem) {
+ shmem_path = g_strdup_printf("/dev/shm/qemu-%d", getpid());
+ shmem_opts = g_strdup_printf(
+ "-object memory-backend-file,id=mem0,size=%s"
+ ",mem-path=%s,share=on -numa node,memdev=mem0",
+ memory_size, shmem_path);
+ } else {
+ shmem_path = NULL;
+ shmem_opts = g_strdup("");
+ }
+ cmd_source = g_strdup_printf("-accel kvm -accel tcg%s%s "
+ "-name source,debug-threads=on "
+ "-m %s "
+ "-serial file:%s/src_serial "
+ "%s %s %s %s",
+ machine_opts ? " -machine " : "",
+ machine_opts ? machine_opts : "",
+ memory_size, tmpfs,
+ arch_source, shmem_opts, args->opts_source,
+ ignore_stderr);
+ g_free(arch_source);
+ *from = qtest_init(cmd_source);
+ g_free(cmd_source);
+
+ cmd_target = g_strdup_printf("-accel kvm -accel tcg%s%s "
+ "-name target,debug-threads=on "
+ "-m %s "
+ "-serial file:%s/dest_serial "
+ "-incoming %s "
+ "%s %s %s %s",
+ machine_opts ? " -machine " : "",
+ machine_opts ? machine_opts : "",
+ memory_size, tmpfs, uri,
+ arch_target, shmem_opts,
+ args->opts_target, ignore_stderr);
+ g_free(arch_target);
+ *to = qtest_init(cmd_target);
+ g_free(cmd_target);
+
+ g_free(shmem_opts);
/*
* Remove shmem file immediately to avoid memory leak in test failed case.
* It's valid becase QEMU has already opened this file
*/
- if (use_shmem) {
+ if (args->use_shmem) {
unlink(shmem_path);
g_free(shmem_path);
}
+ migrate_start_destroy(args);
return 0;
}
@@ -771,13 +776,13 @@ static void test_deprecated(void)
}
static int migrate_postcopy_prepare(QTestState **from_ptr,
- QTestState **to_ptr,
- bool hide_error)
+ QTestState **to_ptr,
+ MigrateStart *args)
{
char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
QTestState *from, *to;
- if (test_migrate_start(&from, &to, uri, hide_error, false, NULL, NULL)) {
+ if (test_migrate_start(&from, &to, uri, args)) {
return -1;
}
@@ -822,9 +827,10 @@ static void migrate_postcopy_complete(QTestState *from, QTestState *to)
static void test_postcopy(void)
{
+ MigrateStart *args = migrate_start_new();
QTestState *from, *to;
- if (migrate_postcopy_prepare(&from, &to, false)) {
+ if (migrate_postcopy_prepare(&from, &to, args)) {
return;
}
migrate_postcopy_start(from, to);
@@ -833,10 +839,13 @@ static void test_postcopy(void)
static void test_postcopy_recovery(void)
{
+ MigrateStart *args = migrate_start_new();
QTestState *from, *to;
char *uri;
- if (migrate_postcopy_prepare(&from, &to, true)) {
+ args->hide_stderr = true;
+
+ if (migrate_postcopy_prepare(&from, &to, args)) {
return;
}
@@ -919,9 +928,12 @@ static void wait_for_migration_fail(QTestState *from, bool allow_active)
static void test_baddest(void)
{
+ MigrateStart *args = migrate_start_new();
QTestState *from, *to;
- if (test_migrate_start(&from, &to, "tcp:0:0", true, false, NULL, NULL)) {
+ args->hide_stderr = true;
+
+ if (test_migrate_start(&from, &to, "tcp:0:0", args)) {
return;
}
migrate(from, "tcp:0:0", "{}");
@@ -932,9 +944,10 @@ static void test_baddest(void)
static void test_precopy_unix(void)
{
char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
+ MigrateStart *args = migrate_start_new();
QTestState *from, *to;
- if (test_migrate_start(&from, &to, uri, false, false, NULL, NULL)) {
+ if (test_migrate_start(&from, &to, uri, args)) {
return;
}
@@ -1010,9 +1023,10 @@ static void test_ignore_shared(void)
static void test_xbzrle(const char *uri)
{
+ MigrateStart *args = migrate_start_new();
QTestState *from, *to;
- if (test_migrate_start(&from, &to, uri, false, false, NULL, NULL)) {
+ if (test_migrate_start(&from, &to, uri, args)) {
return;
}
@@ -1061,11 +1075,11 @@ static void test_xbzrle_unix(void)
static void test_precopy_tcp(void)
{
+ MigrateStart *args = migrate_start_new();
char *uri;
QTestState *from, *to;
- if (test_migrate_start(&from, &to, "tcp:127.0.0.1:0", false, false,
- NULL, NULL)) {
+ if (test_migrate_start(&from, &to, "tcp:127.0.0.1:0", args)) {
return;
}
@@ -1105,13 +1119,14 @@ static void test_precopy_tcp(void)
static void test_migrate_fd_proto(void)
{
+ MigrateStart *args = migrate_start_new();
QTestState *from, *to;
int ret;
int pair[2];
QDict *rsp;
const char *error_desc;
- if (test_migrate_start(&from, &to, "defer", false, false, NULL, NULL)) {
+ if (test_migrate_start(&from, &to, "defer", args)) {
return;
}
@@ -1187,15 +1202,12 @@ static void test_migrate_fd_proto(void)
test_migrate_end(from, to, true);
}
-static void do_test_validate_uuid(const char *uuid_arg_src,
- const char *uuid_arg_dst,
- bool should_fail, bool hide_stderr)
+static void do_test_validate_uuid(MigrateStart *args, bool should_fail)
{
char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
QTestState *from, *to;
- if (test_migrate_start(&from, &to, uri, hide_stderr, false,
- uuid_arg_src, uuid_arg_dst)) {
+ if (test_migrate_start(&from, &to, uri, args)) {
return;
}
@@ -1225,33 +1237,45 @@ static void do_test_validate_uuid(const char *uuid_arg_src,
static void test_validate_uuid(void)
{
- do_test_validate_uuid("-uuid 11111111-1111-1111-1111-111111111111",
- "-uuid 11111111-1111-1111-1111-111111111111",
- false, false);
+ MigrateStart *args = migrate_start_new();
+
+ args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
+ args->opts_target = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
+ do_test_validate_uuid(args, false);
}
static void test_validate_uuid_error(void)
{
- do_test_validate_uuid("-uuid 11111111-1111-1111-1111-111111111111",
- "-uuid 22222222-2222-2222-2222-222222222222",
- true, true);
+ MigrateStart *args = migrate_start_new();
+
+ args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
+ args->opts_target = g_strdup("-uuid 22222222-2222-2222-2222-222222222222");
+ args->hide_stderr = true;
+ do_test_validate_uuid(args, true);
}
static void test_validate_uuid_src_not_set(void)
{
- do_test_validate_uuid(NULL, "-uuid 11111111-1111-1111-1111-111111111111",
- false, true);
+ MigrateStart *args = migrate_start_new();
+
+ args->opts_target = g_strdup("-uuid 22222222-2222-2222-2222-222222222222");
+ args->hide_stderr = true;
+ do_test_validate_uuid(args, false);
}
static void test_validate_uuid_dst_not_set(void)
{
- do_test_validate_uuid("-uuid 11111111-1111-1111-1111-111111111111", NULL,
- false, true);
+ MigrateStart *args = migrate_start_new();
+
+ args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
+ args->hide_stderr = true;
+ do_test_validate_uuid(args, false);
}
static void test_migrate_auto_converge(void)
{
char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
+ MigrateStart *args = migrate_start_new();
QTestState *from, *to;
int64_t remaining, percentage;
@@ -1270,7 +1294,7 @@ static void test_migrate_auto_converge(void)
*/
const int64_t expected_threshold = max_bandwidth * downtime_limit / 1000;
- if (test_migrate_start(&from, &to, uri, false, false, NULL, NULL)) {
+ if (test_migrate_start(&from, &to, uri, args)) {
return;
}
diff --git a/tests/pflash-cfi02-test.c b/tests/pflash-cfi02-test.c
index d3b23f4f66..17aa669b2e 100644
--- a/tests/pflash-cfi02-test.c
+++ b/tests/pflash-cfi02-test.c
@@ -260,7 +260,7 @@ static void test_geometry(const void *opaque)
{
const FlashConfig *config = opaque;
QTestState *qtest;
- qtest = qtest_initf("-M musicpal,accel=qtest"
+ qtest = qtest_initf("-M musicpal"
" -drive if=pflash,file=%s,format=raw,copy-on-read"
/* Device geometry properties. */
" -global driver=cfi.pflash02,"
@@ -580,7 +580,7 @@ static void test_cfi_in_autoselect(const void *opaque)
{
const FlashConfig *config = opaque;
QTestState *qtest;
- qtest = qtest_initf("-M musicpal,accel=qtest"
+ qtest = qtest_initf("-M musicpal"
" -drive if=pflash,file=%s,format=raw,copy-on-read",
image_path);
FlashConfig explicit_config = expand_config_defaults(config);
diff --git a/tests/pnv-xscom-test.c b/tests/pnv-xscom-test.c
index 9fddc7d5f9..2c46d5cf6d 100644
--- a/tests/pnv-xscom-test.c
+++ b/tests/pnv-xscom-test.c
@@ -84,7 +84,7 @@ static void test_cfam_id(const void *data)
machine = "powernv9";
}
- qts = qtest_initf("-M %s,accel=tcg -cpu %s",
+ qts = qtest_initf("-M %s -accel tcg -cpu %s",
machine, chip->cpu_model);
test_xscom_cfam_id(qts, chip);
qtest_quit(qts);
@@ -125,7 +125,7 @@ static void test_core(const void *data)
machine = "powernv9";
}
- qts = qtest_initf("-M %s,accel=tcg -cpu %s",
+ qts = qtest_initf("-M %s -accel tcg -cpu %s",
machine, chip->cpu_model);
test_xscom_core(qts, chip);
qtest_quit(qts);
diff --git a/tests/prom-env-test.c b/tests/prom-env-test.c
index 61bc1d1e7b..9be52c766f 100644
--- a/tests/prom-env-test.c
+++ b/tests/prom-env-test.c
@@ -57,7 +57,7 @@ static void test_machine(const void *machine)
" -machine cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken";
}
- qts = qtest_initf("-M %s,accel=tcg %s -prom-env 'use-nvramrc?=true' "
+ qts = qtest_initf("-M %s -accel tcg %s -prom-env 'use-nvramrc?=true' "
"-prom-env 'nvramrc=%x %x l!' ", (const char *)machine,
extra_args, MAGIC, ADDRESS);
check_guest_memory(qts);
diff --git a/tests/pxe-test.c b/tests/pxe-test.c
index aaae54f755..f68d0aadbb 100644
--- a/tests/pxe-test.c
+++ b/tests/pxe-test.c
@@ -74,7 +74,7 @@ static void test_pxe_one(const testdef_t *test, bool ipv6)
}
args = g_strdup_printf(
- "-machine %s,accel=kvm:tcg -nodefaults -boot order=n "
+ "-accel kvm -accel tcg -machine %s -nodefaults -boot order=n "
"-netdev user,id=" NETNAME ",tftp=./,bootfile=%s,ipv4=%s,ipv6=%s "
"-device %s,bootindex=1,netdev=" NETNAME " %s",
test->machine, disk, ipv6 ? "off" : "on", ipv6 ? "on" : "off",
diff --git a/tests/vmgenid-test.c b/tests/vmgenid-test.c
index 85d8e6463e..efba76e716 100644
--- a/tests/vmgenid-test.c
+++ b/tests/vmgenid-test.c
@@ -109,7 +109,7 @@ static void read_guid_from_monitor(QTestState *qts, QemuUUID *guid)
static char disk[] = "tests/vmgenid-test-disk-XXXXXX";
#define GUID_CMD(guid) \
- "-machine accel=kvm:tcg " \
+ "-accel kvm -accel tcg " \
"-device vmgenid,id=testvgid,guid=%s " \
"-drive id=hd0,if=none,file=%s,format=raw " \
"-device ide-hd,drive=hd0 ", guid, disk