[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/8] tests/qtest/migration-test: Only use available accelerators
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 5/8] tests/qtest/migration-test: Only use available accelerators |
Date: |
Thu, 19 Jan 2023 11:05:34 +0100 |
For example, avoid when TCG is disabled:
$ make check-qtest-aarch64
...
20/20 qemu:qtest+qtest-aarch64 / qtest-aarch64/migration-test
qemu-system-aarch64: -accel tcg: invalid accelerator tcg
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
tests/qtest/migration-test.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 36e6074653..1e7f1ea162 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -45,6 +45,8 @@
unsigned start_address;
unsigned end_address;
+static bool has_tcg;
+static bool has_kvm;
static bool uffd_feature_thread_id;
/*
@@ -604,9 +606,14 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
got_stop = false;
cmd_common = g_string_new("");
- g_string_append(cmd_common, "-accel tcg ");
- g_string_append_printf(cmd_common, "-accel kvm%s ",
- args->use_dirty_ring ? ",dirty-ring-size=4096" :
"");
+ if (has_tcg) {
+ g_string_append(cmd_common, "-accel tcg ");
+ }
+ if (has_kvm) {
+ g_string_append_printf(cmd_common, "-accel kvm%s ",
+ args->use_dirty_ring
+ ? ",dirty-ring-size=4096" : "");
+ }
bootpath = g_strdup_printf("%s/bootsect", tmpfs);
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
@@ -2458,12 +2465,14 @@ static bool kvm_dirty_ring_supported(void)
int main(int argc, char **argv)
{
- const bool has_kvm = qtest_has_accel("kvm");
const bool has_uffd = ufd_version_check();
const char *arch = qtest_get_arch();
g_autoptr(GError) err = NULL;
int ret;
+ has_tcg = qtest_has_accel("tcg");
+ has_kvm = qtest_has_accel("kvm");
+
g_test_init(&argc, &argv, NULL);
/*
--
2.38.1
- [PATCH 0/8] tests/qtest: Allow running boot-serial / migration with TCG disabled, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH 1/8] tests/qtest/boot-serial-test: Constify tests[] array, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH 2/8] tests/qtest/boot-serial-test: Build command line using GString API, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH 3/8] tests/qtest/boot-serial-test: Only use available accelerators, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH 5/8] tests/qtest/migration-test: Only use available accelerators,
Philippe Mathieu-Daudé <=
- [PATCH 8/8] tests/qtest/migration-test: Allow running with HVF, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH 7/8] tests/qtest/boot-serial-test: Allow running with HVF, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH 4/8] tests/qtest/migration-test: Build command line using GString API, Philippe Mathieu-Daudé, 2023/01/19
- [RFC PATCH 6/8] tests/qtest/libqtest: Allow checking for HVF accelerator, Philippe Mathieu-Daudé, 2023/01/19