From patchwork Thu Feb 13 14:32:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 11380451 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C67B7138D for ; Thu, 13 Feb 2020 14:33:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5DD724649 for ; Thu, 13 Feb 2020 14:33:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cuolvnAr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727558AbgBMOdV (ORCPT ); Thu, 13 Feb 2020 09:33:21 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:20140 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727414AbgBMOdV (ORCPT ); Thu, 13 Feb 2020 09:33:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581604400; 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=BS1gc949f0GEp9oop4QVBA5jni4HDU5dKQyNOzlsGVM=; b=cuolvnAr5av0Qr+UrvGZJYqcYGw5KQow1SkqSXBJ2NMLTTwIuQSEanpvevyq4MUqzfWhZT b20aiRxvzdoC91JTbrC3xnJiDraqeD1bhhwYzQW+d01o3mvH96kqjdPxzudubKHk9quRHu UfeXHgj1Uau22P3iOWfR1RtxJN6sgXo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-304-2N3f5fKnPl-xQ9XA07MICg-1; Thu, 13 Feb 2020 09:33:16 -0500 X-MC-Unique: 2N3f5fKnPl-xQ9XA07MICg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AEE3801E67; Thu, 13 Feb 2020 14:33:15 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 278CF5C1D6; Thu, 13 Feb 2020 14:33:08 +0000 (UTC) From: Andrew Jones To: kvm@vger.kernel.org Cc: peter.maydell@linaro.org, alex.bennee@linaro.org, pbonzini@redhat.com, lvivier@redhat.com, thuth@redhat.com, david@redhat.com, frankja@linux.ibm.com, eric.auger@redhat.com Subject: [PATCH kvm-unit-tests 1/2] arch-run: Allow $QEMU to include parameters Date: Thu, 13 Feb 2020 15:32:59 +0100 Message-Id: <20200213143300.32141-2-drjones@redhat.com> In-Reply-To: <20200213143300.32141-1-drjones@redhat.com> References: <20200213143300.32141-1-drjones@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Now it's possible to run all tests using run_tests.sh with a QEMU specified by the $QEMU environment variable that also includes additional parameters. E.g. QEMU="/path/to/qemu -icount 8" Cc: Peter Maydell Cc: Alex Bennée Cc: Paolo Bonzini Cc: Laurent Vivier Cc: Thomas Huth Cc: David Hildenbrand Cc: Janosch Frank Signed-off-by: Andrew Jones --- scripts/arch-run.bash | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index d3ca19d49952..ebe4d3cb2a09 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -172,8 +172,20 @@ search_qemu_binary () local save_path=$PATH local qemucmd qemu + if [ -n "$QEMU" ]; then + set -- $QEMU + if ! "$1" --help 2>/dev/null | grep -q 'QEMU'; then + echo "\$QEMU environment variable not set to a QEMU binary." >&2 + return 2 + fi + qemu=$(command -v "$1") + shift + echo "$qemu $@" + return + fi + export PATH=$PATH:/usr/libexec - for qemucmd in ${QEMU:-qemu-system-$ARCH_NAME qemu-kvm}; do + for qemucmd in qemu-system-$ARCH_NAME qemu-kvm; do if $qemucmd --help 2>/dev/null | grep -q 'QEMU'; then qemu="$qemucmd" break