[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/29] tests: migration-test: use qtest_has_accel() API
From: |
Michael S. Tsirkin |
Subject: |
[PULL 14/29] tests: migration-test: use qtest_has_accel() API |
Date: |
Tue, 19 Oct 2021 07:20:19 -0400 |
From: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210902113551.461632-15-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@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);
--
MST
- [PULL 03/29] tests: acpi: whitelist expected tables for acpi/q35/xapic testcase, (continued)
- [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, 2021/10/19
- [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 <=
- [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
- [PULL 23/29] vhost-user-rng-pci: Add vhost-user-rng-pci implementation, Michael S. Tsirkin, 2021/10/19
- [PULL 22/29] vhost-user-rng: Add vhost-user-rng implementation, Michael S. Tsirkin, 2021/10/19
- [PULL 25/29] vhost-user: fix duplicated notifier MR init, Michael S. Tsirkin, 2021/10/19