[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/15] tests: migration-test: use qtest_has_accel() API
From: |
Igor Mammedov |
Subject: |
[PATCH v2 14/15] tests: migration-test: use qtest_has_accel() API |
Date: |
Thu, 2 Sep 2021 07:35:50 -0400 |
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
---
CC: dgilbert@redhat.com
CC: pbonzini@redhat.com
CC: thuth@redhat.com
CC: lvivier@redhat.com
---
tests/qtest/migration-test.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index cc5e83d98a..7b42f6fd90 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -1420,6 +1420,7 @@ static bool kvm_dirty_ring_supported(void)
int main(int argc, char **argv)
{
char template[] = "/tmp/migration-test-XXXXXX";
+ const bool has_kvm = qtest_has_accel("kvm");
int ret;
g_test_init(&argc, &argv, NULL);
@@ -1434,8 +1435,7 @@ int main(int argc, char **argv)
* some reason)
*/
if (g_str_equal(qtest_get_arch(), "ppc64") &&
- (access("/sys/module/kvm_hv", F_OK) ||
- access("/dev/kvm", R_OK | W_OK))) {
+ (!has_kvm || access("/sys/module/kvm_hv", F_OK))) {
g_test_message("Skipping test: kvm_hv not available");
return g_test_run();
}
@@ -1444,16 +1444,9 @@ int main(int argc, char **argv)
* Similar to ppc64, s390x seems to be touchy with TCG, so disable it
* there until the problems are resolved
*/
- if (g_str_equal(qtest_get_arch(), "s390x")) {
-#if defined(HOST_S390X)
- if (access("/dev/kvm", R_OK | W_OK)) {
- g_test_message("Skipping test: kvm not available");
- return g_test_run();
- }
-#else
- g_test_message("Skipping test: Need s390x host to work properly");
+ if (g_str_equal(qtest_get_arch(), "s390x") && !has_kvm) {
+ g_test_message("Skipping test: s390x host with KVM is required");
return g_test_run();
-#endif
}
tmpfs = mkdtemp(template);
--
2.27.0
- [PATCH v2 03/15] tests: acpi: whitelist expected tables for acpi/q35/xapic testcase, (continued)
- [PATCH v2 03/15] tests: acpi: whitelist expected tables for acpi/q35/xapic testcase, Igor Mammedov, 2021/09/02
- [PATCH v2 06/15] tests: acpi: whitelist new expected table tests/data/acpi/q35/DMAR.dmar, Igor Mammedov, 2021/09/02
- [PATCH v2 08/15] tests: acpi: add expected blob for DMAR table, Igor Mammedov, 2021/09/02
- [PATCH v2 09/15] tests: acpi: whitelist expected blobs for new acpi/q35/ivrs testcase, Igor Mammedov, 2021/09/02
- [PATCH v2 05/15] tests: acpi: update expected tables blobs, Igor Mammedov, 2021/09/02
- [PATCH v2 07/15] tests: acpi: add testcase for intel_iommu (DMAR table), Igor Mammedov, 2021/09/02
- [PATCH v2 10/15] tests: acpi: add testcase for amd-iommu (IVRS table), Igor Mammedov, 2021/09/02
- [PATCH v2 11/15] tests: acpi: update expected blobs, Igor Mammedov, 2021/09/02
- [PATCH v2 13/15] tests: arm-cpu-features: use qtest_has_kvm() API, Igor Mammedov, 2021/09/02
- [PATCH v2 12/15] tests: acpi: arm/virt: drop redundant test_acpi_one() in test_acpi_virt_tcg(), Igor Mammedov, 2021/09/02
- [PATCH v2 14/15] tests: migration-test: use qtest_has_accel() API,
Igor Mammedov <=
- [PATCH v2 15/15] tests: bios-tables-test: use qtest_has_accel() API to register TCG only tests, Igor Mammedov, 2021/09/02