Blame 0002-pseries-disable-migration-test-if-dev-kvm-cannot-be-.patch

673256
From 5c84a2c439afb2a6a5aa69ccd2d7e2ecdb1d18cf Mon Sep 17 00:00:00 2001
673256
Message-Id: <5c84a2c439afb2a6a5aa69ccd2d7e2ecdb1d18cf.1574270987.git.crobinso@redhat.com>
673256
From: Laurent Vivier <lvivier@redhat.com>
673256
Date: Wed, 20 Nov 2019 18:09:55 +0100
673256
Subject: [PATCH] pseries: disable migration-test if /dev/kvm cannot be used
673256
673256
On ppc64, migration-test only works with kvm_hv, and we already
673256
have a check to verify the module is loaded.
673256
673256
kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
673256
but on some systems (like build systems) /dev/kvm can be missing
673256
(by administrators choice).
673256
673256
And as kvm_hv exists test-migration is started but QEMU falls back to
673256
TCG because it cannot be used:
673256
673256
    Could not access KVM kernel module: No such file or directory
673256
    failed to initialize KVM: No such file or directory
673256
    Back to tcg accelerator
673256
673256
And as the test is done with TCG, it fails.
673256
673256
As for s390x, we must check for the existence and the access rights
673256
of /dev/kvm.
673256
673256
Reported-by: Cole Robinson <crobinso@redhat.com>
673256
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
673256
Signed-off-by: Cole Robinson <crobinso@redhat.com>
673256
---
673256
 tests/migration-test.c | 3 ++-
673256
 1 file changed, 2 insertions(+), 1 deletion(-)
673256
673256
diff --git a/tests/migration-test.c b/tests/migration-test.c
673256
index ac780dffda..2b25ba6d77 100644
673256
--- a/tests/migration-test.c
673256
+++ b/tests/migration-test.c
673256
@@ -1349,7 +1349,8 @@ int main(int argc, char **argv)
673256
      * some reason)
673256
      */
673256
     if (g_str_equal(qtest_get_arch(), "ppc64") &&
673256
-        access("/sys/module/kvm_hv", F_OK)) {
673256
+        (access("/sys/module/kvm_hv", F_OK) ||
673256
+         access("/dev/kvm", R_OK | W_OK))) {
673256
         g_test_message("Skipping test: kvm_hv not available");
673256
         return g_test_run();
673256
     }
673256
-- 
673256
2.23.0
673256