lkml.org 
[lkml]   [2021]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH v2 03/10] KVM: selftests: print a message when skipping KVM tests
    From
    Previously, if this check failed, we'd just exit quietly with no output.
    This can be confusing, so print out a short message indicating why the
    test is being skipped.

    Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
    ---
    tools/testing/selftests/kvm/lib/kvm_util.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
    index f05ca919cccb..0d6ddee429b9 100644
    --- a/tools/testing/selftests/kvm/lib/kvm_util.c
    +++ b/tools/testing/selftests/kvm/lib/kvm_util.c
    @@ -53,8 +53,10 @@ int kvm_check_cap(long cap)
    int kvm_fd;

    kvm_fd = open(KVM_DEV_PATH, O_RDONLY);
    - if (kvm_fd < 0)
    + if (kvm_fd < 0) {
    + print_skip("KVM not available, errno: %d", errno);
    exit(KSFT_SKIP);
    + }

    ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, cap);
    TEST_ASSERT(ret != -1, "KVM_CHECK_EXTENSION IOCTL failed,\n"
    --
    2.31.1.751.gd2f1c929bd-goog
    \
     
     \ /
      Last update: 2021-05-19 22:04    [W:4.544 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site