Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5040636imu; Wed, 19 Dec 2018 04:44:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/XEYooKQwrnAc4673JmAaifcu8oxx+NoHXRvRT0EJ4KRtMM9y18b0ll7Z0wevK0ARfdMsg/ X-Received: by 2002:aa7:85d7:: with SMTP id z23mr21146398pfn.205.1545223464445; Wed, 19 Dec 2018 04:44:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545223464; cv=none; d=google.com; s=arc-20160816; b=etf6RQ7MasQxmasXrkN5CcnkzNQeTBEzUe0KUsZ7esGUPpWylmq9BcbhVBMG9v12L2 mrMMKIdwFlTQddJ8lggVmdPQjjR6i3wDq4dzAK/veerQ4/meyaZfHhz5ihqekzK6u08z aELWvC4XWmpHkaGExdyNl73gHZF9Ge3OUmjYtH5tNoix7hvR9MRK3hgvQRSL/KAcbOEG 2uIFNi2Ton0GaYet+zGx4FVI8PS6o0snuWW8FLYajx3zcrEVV0fsvBWKrid12b67obr+ p6PZUXl9aUpPkd+H3LN/e91xXUZ9MB8fyuXuxY/UvCIclO1bL4EjY1vRkQOvAUT5R5qU E8Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9Zbsq/t9hbppoJJqElGbO3ldnqL89j2J2l6a74PEvnY=; b=drdIOL+4FIl3wqQhxHAe2SVVg7Lo/vcpl4QpJhb77HBstzGABjBbY7ChJH4Gg6MUPG VSCF2Me3YKJ5Re85i4bIjxqtSpGxnY64/kujeCOhdtkSrHQnEDPNffKhcc9b8b6/qfS6 3tQuaIQXO+9WCO+6fDmPoVbVo+/IxxvKfjs8gBz0yBr1SuyHZs0UyETLDE1AuDCVhRZB LXq+stNApcuRLdpMxExNAFpUD7P3JJIgX4BMnFtJV3Fmw3zsN8j9G23LkL6vpVZfi6Rl rmggwfqrkPZEbGF8QNLMZD1YlDKQg0V7+NdbFKWM7DaPhHT6hhhUbmOJc+9IjnccEgKh yQsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si15995497pgj.375.2018.12.19.04.44.08; Wed, 19 Dec 2018 04:44:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729207AbeLSLPV (ORCPT + 99 others); Wed, 19 Dec 2018 06:15:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39112 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727155AbeLSLPU (ORCPT ); Wed, 19 Dec 2018 06:15:20 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7CC3413269C; Wed, 19 Dec 2018 11:15:20 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E2C8608C5; Wed, 19 Dec 2018 11:15:19 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , linux-kernel@vger.kernel.org Subject: [PATCH] selftests: kvm: report failed stage when exit reason is unexpected Date: Wed, 19 Dec 2018 12:15:18 +0100 Message-Id: <20181219111518.25487-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 19 Dec 2018 11:15:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When we get a report like ==== Test Assertion Failure ==== x86_64/state_test.c:157: run->exit_reason == KVM_EXIT_IO pid=955 tid=955 - Success 1 0x0000000000401350: main at state_test.c:154 2 0x00007fc31c9e9412: ?? ??:0 3 0x000000000040159d: _start at ??:? Unexpected exit reason: 8 (SHUTDOWN), it is not obvious which particular stage failed. Add the info. Signed-off-by: Vitaly Kuznetsov --- tools/testing/selftests/kvm/x86_64/evmcs_test.c | 4 ++-- tools/testing/selftests/kvm/x86_64/state_test.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/evmcs_test.c b/tools/testing/selftests/kvm/x86_64/evmcs_test.c index 92c2cfd1b182..ea3c73e8f4f6 100644 --- a/tools/testing/selftests/kvm/x86_64/evmcs_test.c +++ b/tools/testing/selftests/kvm/x86_64/evmcs_test.c @@ -113,8 +113,8 @@ int main(int argc, char *argv[]) for (stage = 1;; stage++) { _vcpu_run(vm, VCPU_ID); TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, - "Unexpected exit reason: %u (%s),\n", - run->exit_reason, + "Stage %d: unexpected exit reason: %u (%s),\n", + stage, run->exit_reason, exit_reason_str(run->exit_reason)); memset(®s1, 0, sizeof(regs1)); diff --git a/tools/testing/selftests/kvm/x86_64/state_test.c b/tools/testing/selftests/kvm/x86_64/state_test.c index 03da41f0f736..4b3f556265f1 100644 --- a/tools/testing/selftests/kvm/x86_64/state_test.c +++ b/tools/testing/selftests/kvm/x86_64/state_test.c @@ -152,8 +152,8 @@ int main(int argc, char *argv[]) for (stage = 1;; stage++) { _vcpu_run(vm, VCPU_ID); TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, - "Unexpected exit reason: %u (%s),\n", - run->exit_reason, + "Stage %d: unexpected exit reason: %u (%s),\n", + stage, run->exit_reason, exit_reason_str(run->exit_reason)); memset(®s1, 0, sizeof(regs1)); -- 2.19.2