[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 04/11] tests/qtest/boot-serial-test: Only use available accele
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 04/11] tests/qtest/boot-serial-test: Only use available accelerators |
Date: |
Fri, 20 Jan 2023 09:23:34 +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>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@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 92890b409d..f375b16dae 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 */
@@ -257,8 +260,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);
@@ -285,6 +292,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 v3 00/11] tests/qtest: Allow running boot-serial / migration with TCG disabled, Philippe Mathieu-Daudé, 2023/01/20
- [PATCH v3 01/11] tests/qtest/boot-serial-test: Constify tests[] array, Philippe Mathieu-Daudé, 2023/01/20
- [PATCH v3 02/11] tests/qtest/boot-serial-test: Simplify test_machine() a bit, Philippe Mathieu-Daudé, 2023/01/20
- [PATCH v3 03/11] tests/qtest/boot-serial-test: Build command line using GString API, Philippe Mathieu-Daudé, 2023/01/20
- [PATCH v3 04/11] tests/qtest/boot-serial-test: Only use available accelerators,
Philippe Mathieu-Daudé <=
- [PATCH v3 05/11] tests/qtest/migration-test: Inverse #ifdef'ry ladders, Philippe Mathieu-Daudé, 2023/01/20
- [PATCH v3 06/11] tests/qtest/migration-test: Reduce 'cmd_source' string scope, Philippe Mathieu-Daudé, 2023/01/20
- [PATCH v3 07/11] tests/qtest/migration-test: Build command line using GString API (1/4), Philippe Mathieu-Daudé, 2023/01/20
- [PATCH v3 08/11] tests/qtest/migration-test: Build command line using GString API (2/4), Philippe Mathieu-Daudé, 2023/01/20