Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3419529pxj; Mon, 24 May 2021 06:25:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5fm28BnQSwmbrw99N4srB8iwoSEqo9BRIfRaH3jkXgzAgaaq5Gv6pOMdA7qH2vc6cEi+N X-Received: by 2002:a17:906:c0c7:: with SMTP id bn7mr22944641ejb.393.1621862731512; Mon, 24 May 2021 06:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621862731; cv=none; d=google.com; s=arc-20160816; b=c2J3ityl3rig+ypqAIhaPFwXuW1AJbb5at7dUVpywXw0t//K/PKeGazfxXW9OS7G22 okdAKisN5xrpEu86FbNi4E3/ioTk3mT88jLrQBilIZTDPtHfYDfAdgkC9kQOtovg4Np4 BBSs3TdGxCykWbw2NhMBXiIUSmnRYVAWP/uAmteqGrBLVW5XJEAJHkUf8CfLj5qJT9/y 0EauXDh3/4mcPPpikMDhiqwNwESIqk7nX+EG7ijdBhQ72TSSYCSd5QA5hGK8e63OYQBV zYJ86I5r910nc1ulmPW6aD0jsOWonCuulIPNODbyBA9rnfG3WTH867nk0S1aACQtPeKj x+UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=53eXAokxRIKiwyPhDqnz0iFPit9Pp7Ww3vTVyba+8os=; b=unrMOkz0/NHmgiXgC6nSoRD6V86IwHhzLYTTtTQJGD7fwBJNDQcFsY/GQp5g795Tde MJlU4ugeEqdSvFvZ9qD0+8P96d7SLgmiIbomGtfvNQDMxwryT4QSFY5Oi0zVV5u/Fmmf pM0nGF3zU5C8jUSiqne3PPL++vLP/yJUQYZ/AGzQjVFK3D1tnoRz/6H6GbpjAySjY2xk ilaGrGc7cG5RetEzU4SwR4kZYJ7Xg5e9oVp4j1NN4+BiICM/0BiLmmc2Q9ITyAxaoDTK y1U+/JM12/hSigvbuFj8m05wYmjEuKUG48bV7rIlqkucHpTt2jI42fmOJHFdgl7KVYGy pcGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IDMc3kLe; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m17si10216231edc.326.2021.05.24.06.25.07; Mon, 24 May 2021 06:25:31 -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=@redhat.com header.s=mimecast20190719 header.b=IDMc3kLe; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232548AbhEXNZe (ORCPT + 99 others); Mon, 24 May 2021 09:25:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21507 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbhEXNZc (ORCPT ); Mon, 24 May 2021 09:25:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621862643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=53eXAokxRIKiwyPhDqnz0iFPit9Pp7Ww3vTVyba+8os=; b=IDMc3kLeoBSjbTv2aKa27oI6F1Y0KSRUhFY+mQgpmy9UZufKhO3rgHIZIN+++onxOL+VdX Rwfp9S29KW9kvLTuG0Q5avWDXHaN8IdJ+68u7bTCpEukSzhUqP/HSN9HQJlsFqB1Dm8g6s RvHf+J0alssqDpMfh52SaMrKM1OmBQQ= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-522-bjhjyH1uO7OC2fBGhnyXSQ-1; Mon, 24 May 2021 09:24:01 -0400 X-MC-Unique: bjhjyH1uO7OC2fBGhnyXSQ-1 Received: by mail-ej1-f70.google.com with SMTP id la2-20020a170906ad82b02903d4bcc8de3bso7552231ejb.4 for ; Mon, 24 May 2021 06:24:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=53eXAokxRIKiwyPhDqnz0iFPit9Pp7Ww3vTVyba+8os=; b=DEochWbDmvycoLf12g6aqYGT9xuE9RBsgjXkyGxQ7yZ+kxLqZVTsthxVJA0qUujNfx 74TKmOfvLnpYPaBpTJcjCyMqccMv0TY4sG82HMEQuJewNKdoUNNujx67uT8wVdgTi/DR XE6pD56/WEwzlIRN8pb+JMqkK6o1djRfuP24TR+OrOgYN6XADcI5SltYimlDW8b11d1v GFnFDLVUTUpv+iRGexs1m/HfJF5vdB6n2+oGSgT+KxFdyoVvPS9o0Zw6znuW9jvbuWfT ABDrC7FYIXPc/YV4tecfIQg7kAqKwVfXuCoYB9zrYQj716OU8PgQp9s/QWtLUaiPbm8+ F9lw== X-Gm-Message-State: AOAM532PDzOWvyODvJGpQnbiQvVd2WkGHgUlDDGWT+DLlXhxBrniqcpR ZjPDyhhZ4bvByyBHrpbSpp6YYQBfj1J2mqYXIQkXvgRwBQNYwAK1/HXoRV8EL4+GWPFVS/g/xW+ nCUkvCGwrdK2ox+hAQcYZ9NZC X-Received: by 2002:aa7:dd55:: with SMTP id o21mr3229150edw.295.1621862640567; Mon, 24 May 2021 06:24:00 -0700 (PDT) X-Received: by 2002:aa7:dd55:: with SMTP id o21mr3229117edw.295.1621862640359; Mon, 24 May 2021 06:24:00 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id s2sm9524965edu.89.2021.05.24.06.23.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 06:23:59 -0700 (PDT) Subject: Re: [PATCH v2 03/10] KVM: selftests: print a message when skipping KVM tests To: Ben Gardon , Axel Rasmussen Cc: Aaron Lewis , Alexander Graf , Andrew Jones , Andrew Morton , Emanuele Giuseppe Esposito , Eric Auger , Jacob Xu , Makarand Sonare , Oliver Upton , Peter Xu , Shuah Khan , Yanan Wang , kvm , LKML , linux-kselftest@vger.kernel.org References: <20210519200339.829146-1-axelrasmussen@google.com> <20210519200339.829146-4-axelrasmussen@google.com> From: Paolo Bonzini Message-ID: <12a7376b-7bda-8fe6-f3f4-628dbccc69a2@redhat.com> Date: Mon, 24 May 2021 15:23:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/05/21 23:49, Ben Gardon wrote: > On Wed, May 19, 2021 at 1:03 PM Axel Rasmussen wrote: >> >> 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 > > Reviewed-by: Ben Gardon > >> --- >> 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); >> + } > > This is a wonderful change. I believe this will only be hit if KVM is > built as a module and that module has not yet been loaded, so this > message could also suggest that the user check if the KVM / KVM > arch/vendor specific module has been loaded. Let's make it print_skip("%s not available, is KVM loaded? (errno: %d)", KVM_DEV_PATH, errno); Paolo