From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH QEMU-KVM 4/7] test: add conditional execution for vmexit tests Date: Mon, 21 Sep 2009 11:55:35 +0300 Message-ID: <1253523338-22784-5-git-send-email-avi@redhat.com> References: <1253523338-22784-1-git-send-email-avi@redhat.com> Cc: Marcelo Tosatti To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:28202 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755443AbZIUIzh (ORCPT ); Mon, 21 Sep 2009 04:55:37 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8L8tfpx023244 for ; Mon, 21 Sep 2009 04:55:42 -0400 In-Reply-To: <1253523338-22784-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: ipi tests can only run on smp for example. Signed-off-by: Avi Kivity --- kvm/user/test/x86/vmexit.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c index cce26d9..76f676d 100644 --- a/kvm/user/test/x86/vmexit.c +++ b/kvm/user/test/x86/vmexit.c @@ -54,6 +54,7 @@ static void mov_to_cr8(void) static struct test { void (*func)(void); const char *name; + int (*valid)(void); } tests[] = { { cpuid, "cpuid", }, { vmcall, "vmcall", }, @@ -67,6 +68,11 @@ static void do_test(struct test *test) unsigned long long t1, t2; void (*func)(void) = test->func; + if (test->valid && !test->valid()) { + printf("%s (skipped)\n", test->name); + return; + } + t1 = rdtsc(); for (i = 0; i < N; ++i) func(); -- 1.6.4.1