aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2021-09-02 07:35:50 -0400
committerMichael S. Tsirkin <mst@redhat.com>2021-10-20 04:37:55 -0400
commitb72c76033de766d4ff891c582514caf12edbbfb4 (patch)
tree215252489d9eff70462765167ded42894ba465a3 /tests/qtest
parent07e6ed2c79b311aad4d2c87740753752ad1503ba (diff)
downloadqemu-b72c76033de766d4ff891c582514caf12edbbfb4.zip
qemu-b72c76033de766d4ff891c582514caf12edbbfb4.tar.gz
qemu-b72c76033de766d4ff891c582514caf12edbbfb4.tar.bz2
tests: migration-test: use qtest_has_accel() API
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>
Diffstat (limited to 'tests/qtest')
-rw-r--r--tests/qtest/migration-test.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index cc5e83d..7b42f6f 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);