[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/29] tests: arm-cpu-features: use qtest_has_kvm() API
From: |
Michael S. Tsirkin |
Subject: |
[PULL 13/29] tests: arm-cpu-features: use qtest_has_kvm() API |
Date: |
Tue, 19 Oct 2021 07:20:16 -0400 |
From: Igor Mammedov <imammedo@redhat.com>
and drop custom function that were doing the job
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20210902113551.461632-14-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/qtest/arm-cpu-features.c | 29 +++++------------------------
1 file changed, 5 insertions(+), 24 deletions(-)
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index 90a87f0ea9..f76652143a 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -26,21 +26,6 @@
" 'arguments': { 'type': 'full', "
#define QUERY_TAIL "}}"
-static bool kvm_enabled(QTestState *qts)
-{
- QDict *resp, *qdict;
- bool enabled;
-
- resp = qtest_qmp(qts, "{ 'execute': 'query-kvm' }");
- g_assert(qdict_haskey(resp, "return"));
- qdict = qdict_get_qdict(resp, "return");
- g_assert(qdict_haskey(qdict, "enabled"));
- enabled = qdict_get_bool(qdict, "enabled");
- qobject_unref(resp);
-
- return enabled;
-}
-
static QDict *do_query_no_props(QTestState *qts, const char *cpu_type)
{
return qtest_qmp(qts, QUERY_HEAD "'model': { 'name': %s }"
@@ -506,14 +491,6 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
qts = qtest_init(MACHINE_KVM "-cpu max");
- /*
- * These tests target the 'host' CPU type, so KVM must be enabled.
- */
- if (!kvm_enabled(qts)) {
- qtest_quit(qts);
- return;
- }
-
/* Enabling and disabling kvm-no-adjvtime should always work. */
assert_has_feature_disabled(qts, "host", "kvm-no-adjvtime");
assert_set_feature(qts, "host", "kvm-no-adjvtime", true);
@@ -637,7 +614,11 @@ int main(int argc, char **argv)
* order avoid attempting to run an AArch32 QEMU with KVM on
* AArch64 hosts. That won't work and isn't easy to detect.
*/
- if (g_str_equal(qtest_get_arch(), "aarch64")) {
+ if (g_str_equal(qtest_get_arch(), "aarch64") && qtest_has_accel("kvm")) {
+ /*
+ * This tests target the 'host' CPU type, so register it only if
+ * KVM is available.
+ */
qtest_add_data_func("/arm/kvm/query-cpu-model-expansion",
NULL, test_query_cpu_model_expansion_kvm);
}
--
MST
- [PULL 00/29] pc,pci,virtio: features, fixes, Michael S. Tsirkin, 2021/10/19
- [PULL 01/29] tests: acpi: dump table with failed checksum, Michael S. Tsirkin, 2021/10/19
- [PULL 02/29] tests: qtest: add qtest_has_accel() to check if tested binary supports accelerator, Michael S. Tsirkin, 2021/10/19
- [PULL 03/29] tests: acpi: whitelist expected tables for acpi/q35/xapic testcase, Michael S. Tsirkin, 2021/10/19
- [PULL 04/29] tests: acpi: q35: test for x2APIC entries in SRAT, Michael S. Tsirkin, 2021/10/19
- [PULL 06/29] tests: acpi: whitelist new expected table tests/data/acpi/q35/DMAR.dmar, Michael S. Tsirkin, 2021/10/19
- [PULL 11/29] tests: acpi: update expected blobs, Michael S. Tsirkin, 2021/10/19
- [PULL 07/29] tests: acpi: add testcase for intel_iommu (DMAR table), Michael S. Tsirkin, 2021/10/19
- [PULL 09/29] tests: acpi: whitelist expected blobs for new acpi/q35/ivrs testcase, Michael S. Tsirkin, 2021/10/19
- [PULL 08/29] tests: acpi: add expected blob for DMAR table, Michael S. Tsirkin, 2021/10/19
- [PULL 13/29] tests: arm-cpu-features: use qtest_has_kvm() API,
Michael S. Tsirkin <=
- [PULL 19/29] virtio-iommu: Remove the non transitional name, Michael S. Tsirkin, 2021/10/19
- [PULL 21/29] libvhost-user: fix VHOST_USER_REM_MEM_REG skipping mmap_addr, Michael S. Tsirkin, 2021/10/19
- [PULL 14/29] tests: migration-test: use qtest_has_accel() API, Michael S. Tsirkin, 2021/10/19
- [PULL 24/29] docs: Add documentation for vhost based RNG implementation, Michael S. Tsirkin, 2021/10/19
- [PULL 05/29] tests: acpi: update expected tables blobs, Michael S. Tsirkin, 2021/10/19
- [PULL 12/29] tests: acpi: arm/virt: drop redundant test_acpi_one() in test_acpi_virt_tcg(), Michael S. Tsirkin, 2021/10/19
- [PULL 17/29] vdpa: Add vhost_vdpa_section_end, Michael S. Tsirkin, 2021/10/19
- [PULL 16/29] vdpa: Skip protected ram IOMMU mappings, Michael S. Tsirkin, 2021/10/19
- [PULL 18/29] vdpa: Check for iova range at mappings changes, Michael S. Tsirkin, 2021/10/19
- [PULL 20/29] virtio-iommu: Drop base_name and change generic_name, Michael S. Tsirkin, 2021/10/19