[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/8] tests/qtest/boot-serial-test: Only use available accelerator
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 3/8] tests/qtest/boot-serial-test: Only use available accelerators |
Date: |
Thu, 19 Jan 2023 11:05:32 +0100 |
For example, avoid when TCG is disabled:
$ make check-qtest-aarch64
...
18/20 qemu:qtest+qtest-aarch64 / qtest-aarch64/boot-serial-test
qemu-system-aarch64: -accel tcg: invalid accelerator tcg
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
tests/qtest/boot-serial-test.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c
index fccf706f99..f8d0c684c2 100644
--- a/tests/qtest/boot-serial-test.c
+++ b/tests/qtest/boot-serial-test.c
@@ -17,6 +17,9 @@
#include "libqtest.h"
#include "libqos/libqos-spapr.h"
+static bool has_tcg;
+static bool has_kvm;
+
static const uint8_t bios_avr[] = {
0x88, 0xe0, /* ldi r24, 0x08 */
0x80, 0x93, 0xc1, 0x00, /* sts 0x00C1, r24 ; Enable tx */
@@ -264,8 +267,12 @@ 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.
*/
- g_string_append(cmd, "-accel tcg ");
- g_string_append(cmd, "-accel kvm ");
+ if (has_tcg) {
+ g_string_append(cmd, "-accel tcg ");
+ }
+ if (has_kvm) {
+ g_string_append(cmd, "-accel kvm ");
+ }
g_string_append(cmd, test->extra);
qts = qtest_init(cmd->str);
@@ -292,6 +299,9 @@ int main(int argc, char *argv[])
const char *arch = qtest_get_arch();
int i;
+ has_tcg = qtest_has_accel("tcg");
+ has_kvm = qtest_has_accel("kvm");
+
g_test_init(&argc, &argv, NULL);
for (i = 0; tests[i].arch != NULL; i++) {
--
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 7/8] tests/qtest/boot-serial-test: Allow running with HVF, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH 3/8] tests/qtest/boot-serial-test: Only use available accelerators,
Philippe Mathieu-Daudé <=
- [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
- Re: [RFC PATCH 6/8] tests/qtest/libqtest: Allow checking for HVF accelerator, Thomas Huth, 2023/01/19
- Re: [RFC PATCH 6/8] tests/qtest/libqtest: Allow checking for HVF accelerator, Philippe Mathieu-Daudé, 2023/01/19
- Re: [RFC PATCH 6/8] tests/qtest/libqtest: Allow checking for HVF accelerator, Thomas Huth, 2023/01/19
- Re: [RFC PATCH 6/8] tests/qtest/libqtest: Allow checking for HVF accelerator, Thomas Huth, 2023/01/20
- Re: [RFC PATCH 6/8] tests/qtest/libqtest: Allow checking for HVF accelerator, Philippe Mathieu-Daudé, 2023/01/20
- Re: [RFC PATCH 6/8] tests/qtest/libqtest: Allow checking for HVF accelerator, Thomas Huth, 2023/01/20