[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] qtest/arm-cpu-features: Check KVM availability at runtime
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 4/6] qtest/arm-cpu-features: Check KVM availability at runtime |
Date: |
Fri, 12 Mar 2021 00:12:00 +0100 |
sve_tests_sve_off_kvm() and test_query_cpu_model_expansion_kvm()
are KVM specific tests. Skip them if KVM is not built-in.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
tests/qtest/arm-cpu-features.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index 8252b85bb85..2b70104515d 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -21,7 +21,7 @@
#define SVE_MAX_VQ 16
#define MACHINE "-machine virt,gic-version=max -accel tcg "
-#define MACHINE_KVM "-machine virt,gic-version=max -accel kvm -accel tcg "
+#define MACHINE_KVM "-machine virt,gic-version=max -accel kvm "
#define QUERY_HEAD "{ 'execute': 'query-cpu-model-expansion', " \
" 'arguments': { 'type': 'full', "
#define QUERY_TAIL "}}"
@@ -413,6 +413,10 @@ static void sve_tests_sve_off_kvm(const void *data)
QTestState *qts;
qts = qtest_init(MACHINE_KVM "-cpu max,sve=off");
+ if (!qtest_probe_accel(qts, "kvm")) {
+ g_test_skip("KVM not available, skipping test");
+ goto done;
+ }
/*
* We don't know if this host supports SVE so we don't
@@ -424,6 +428,7 @@ static void sve_tests_sve_off_kvm(const void *data)
assert_sve_vls(qts, "max", 0, NULL);
assert_sve_vls(qts, "max", 0, "{ 'sve128': false }");
+done:
qtest_quit(qts);
}
@@ -492,6 +497,10 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
QTestState *qts;
qts = qtest_init(MACHINE_KVM "-cpu max");
+ if (!qtest_probe_accel(qts, "kvm")) {
+ g_test_skip("KVM not available, skipping test");
+ goto done;
+ }
/*
* These tests target the 'host' CPU type, so KVM must be enabled.
@@ -609,6 +618,7 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
assert_has_not_feature(qts, "host", "kvm-steal-time");
}
+done:
qtest_quit(qts);
}
--
2.26.2
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, (continued)
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Philippe Mathieu-Daudé, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Philippe Mathieu-Daudé, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Markus Armbruster, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Philippe Mathieu-Daudé, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Markus Armbruster, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Thomas Huth, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Philippe Mathieu-Daudé, 2021/03/16
[PATCH 2/6] tests/qtest: Add qtest_probe_accel() method, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 4/6] qtest/arm-cpu-features: Check KVM availability at runtime,
Philippe Mathieu-Daudé <=
[PATCH 3/6] qtest/bios-tables-test: Make test build-independent from accelerator, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 5/6] qtest/arm-cpu-features: Check TCG availability at runtime, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 6/6] tests/qtest: Do not restrict bios-tables-test to Aarch64 hosts anymore, Philippe Mathieu-Daudé, 2021/03/11