Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp1585603lkv; Wed, 19 May 2021 13:24:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrC1mkWtgGkFfDzHev44WnkgzFsyJZGeJKDBxYs07oBQ9UOLlke2AhvMmP3LDsfhlptSEi X-Received: by 2002:a6b:f212:: with SMTP id q18mr1490402ioh.131.1621455868184; Wed, 19 May 2021 13:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621455868; cv=none; d=google.com; s=arc-20160816; b=uQ0QePq47oGiyqCqlbNgGjYKknAutdtqNcPZbYnv2bUcGQwsuyew1ioOYNMq3Zeks+ GsPlumocilMR4mLTqfOPj1mZnOJZTjrZyjwyYOS7BngR7CykdHaduH4/oWFHDWPVYac/ 2VIpy4u6n+oysZ8rSzJdQK7OokyGVyROzF8FP/rt3Gjdqfqp66AjUNlyh1M08eayiS9q FjBYNqVHVmTaEiY9FcK020V+t8DSWTLbXpI8iDqGS3u99bzhJ+NhpOzezWP5cWyIWH+1 +wFk8wC2mYfBxMYHqY/K1Ri8Cn2GVftNBtG6mbDh5Ko6z0svGilmN0pyGTWhPf7LXadc zWRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=rv0ERumOf71iShog8U1qPBT9mGKIDAJp7FTVCQRkzEM=; b=FSB3bQS06oltP7+o+JFCJTq23yG6HDY4tfvN0BgLDBbkpV8SPDJD65Qy5OaUN9Iv6N 3Tsth9mWhqYh3f6Om8tlLoGlVA+87hsSMifVVxkd/ynW7G5qfQIjD8NqNcggexL/lCNd 1GaNumTUMc14eAIfLLRosIDvBn7s4K27o8MBhLfeE6FbqBQHJtTWzDNt0KtFOVnLwnU0 +bQoCNRG87E2HIOlfFCH9v0H+IPLj4XYzCzrANjBCEevd+pH9W1LNWRkO0DtUrSf32sz u6EgaKpC+wN1bgZ5+2rLjKIfcUHMrIJFScmSulCqTllbxCzgJjmLF8WHktDmwIFT+sX6 3spA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fjxm0c3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a23si358341jap.18.2021.05.19.13.24.15; Wed, 19 May 2021 13:24:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fjxm0c3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232835AbhESUFX (ORCPT + 99 others); Wed, 19 May 2021 16:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232774AbhESUFQ (ORCPT ); Wed, 19 May 2021 16:05:16 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5347AC061763 for ; Wed, 19 May 2021 13:03:55 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id o6-20020a5b06460000b02905004326697dso19340655ybq.22 for ; Wed, 19 May 2021 13:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=rv0ERumOf71iShog8U1qPBT9mGKIDAJp7FTVCQRkzEM=; b=fjxm0c3dD1xUMPOH3FFURwgbNiEivz+zKgnGl4/ugh7HjstMXcxQ8bZUAehPznuLnj qEEvM0iUCnDrVQu+uQ/+GW7dj/lQBRbabhpF2qFdGEuQLtdhX04acaoxk9vruMAolv04 lsGCLIoatDTljSrzUJBKcwpIhnje354lgZQ5Y9Y3ygPBlORSzKwR2d5MMxNsXJbh930v S4XCWQGhr7VQzFk/cSA0mh/MErqNXrih6lLO+2LsKRXj7QEUyHO/jIN2rjJRjnBhVRdD BFbe5UYtR+RdUnQ7mhaIHyn/nJgRkAbDbWb07xv/RCTZmAAQTG9hLBrFkZ1zHtfLfUuB PDGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=rv0ERumOf71iShog8U1qPBT9mGKIDAJp7FTVCQRkzEM=; b=kqv61RkGf6dUavzWa7tl6PInFYf3BFDmZcCIj8DuI1O1iKlJFZrIiggEdeAcw2Ssqn ELzLHWmnOTE7P2jKMC4GQaq7wPHO4KxD8l4DgIaAg+hW/FKgUjxLigoUbdG9IbjIP/Zr eIPbfrExzcg7S750cggJng3bMJlSYs6/42HJ0y27q67GwHeRfBYbx4npATd+aHAAo8Cj PBUMOZWLN5io3nbLFZbdNhiWEzPfx+POD8XvX97C3MoNd7zNd4droafEPueFWwixRv85 +wGf7hcXTmVpt7kKisTOjMNdnyG8R8YlzPUyc34cdFTZW7v9zWxTXHc1/L5/+jLY+rWF N47Q== X-Gm-Message-State: AOAM530q0hqprCB5x2uM7k/zW4e81cSVBI0Pu4u1ViYpzBzA6qbOtxpr sZ06AJkxTAQj8/yBVIpKM44jfJyBiCEAaYX4l+BM X-Received: from ajr0.svl.corp.google.com ([2620:15c:2cd:203:7eb5:10bb:834a:d5ec]) (user=axelrasmussen job=sendgmr) by 2002:a25:6c85:: with SMTP id h127mr1798049ybc.460.1621454634548; Wed, 19 May 2021 13:03:54 -0700 (PDT) Date: Wed, 19 May 2021 13:03:32 -0700 In-Reply-To: <20210519200339.829146-1-axelrasmussen@google.com> Message-Id: <20210519200339.829146-4-axelrasmussen@google.com> Mime-Version: 1.0 References: <20210519200339.829146-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH v2 03/10] KVM: selftests: print a message when skipping KVM tests From: Axel Rasmussen To: Aaron Lewis , Alexander Graf , Andrew Jones , Andrew Morton , Ben Gardon , Emanuele Giuseppe Esposito , Eric Auger , Jacob Xu , Makarand Sonare , Oliver Upton , Paolo Bonzini , Peter Xu , Shuah Khan , Yanan Wang Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Axel Rasmussen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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