From patchwork Tue Jun 13 11:54:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 9783719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8340060212 for ; Tue, 13 Jun 2017 11:55:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 761142860D for ; Tue, 13 Jun 2017 11:55:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ACF928673; Tue, 13 Jun 2017 11:55:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CDFB2860D for ; Tue, 13 Jun 2017 11:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752480AbdFMLy5 (ORCPT ); Tue, 13 Jun 2017 07:54:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39872 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337AbdFMLy4 (ORCPT ); Tue, 13 Jun 2017 07:54:56 -0400 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 4C78163319 for ; Tue, 13 Jun 2017 11:54:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C78163319 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=drjones@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4C78163319 Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B16B77BE7; Tue, 13 Jun 2017 11:54:54 +0000 (UTC) From: Andrew Jones To: kvm@vger.kernel.org Cc: rkrcmar@redhat.com, pbonzini@redhat.com, lvivier@redhat.com, thuth@redhat.com Subject: [PATCH kvm-unit-tests v3 1/9] arch-run: introduce initrd_create Date: Tue, 13 Jun 2017 13:54:43 +0200 Message-Id: <20170613115451.6240-2-drjones@redhat.com> In-Reply-To: <20170613115451.6240-1-drjones@redhat.com> References: <20170613115451.6240-1-drjones@redhat.com> 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.39]); Tue, 13 Jun 2017 11:54:56 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Encapsulate the preparation of the optional initrd command line option. Signed-off-by: Andrew Jones Reviewed-by: Laurent Vivier --- arm/run | 5 +++-- powerpc/run | 5 +++-- scripts/arch-run.bash | 6 ++++++ x86/run | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/arm/run b/arm/run index f73593bc01af..1b1602c74970 100755 --- a/arm/run +++ b/arm/run @@ -71,10 +71,11 @@ if $qemu $M -device '?' 2>&1 | grep pci-testdev > /dev/null; then pci_testdev="-device pci-testdev" fi +initrd_create + M+=",accel=$ACCEL" command="$qemu -nodefaults $M -cpu $processor $chr_testdev $pci_testdev" -[ -f "$ENV" ] && command+=" -initrd $ENV" -command+=" -display none -serial stdio -kernel" +command+=" -display none -serial stdio $INITRD -kernel" command="$(timeout_cmd) $command" echo $command "$@" diff --git a/powerpc/run b/powerpc/run index d73f721680b5..7ccf1a36ff49 100755 --- a/powerpc/run +++ b/powerpc/run @@ -35,11 +35,12 @@ if ! $qemu -machine '?' 2>&1 | grep 'pseries' > /dev/null; then exit 2 fi +initrd_create + M='-machine pseries' M+=",accel=$ACCEL" command="$qemu -nodefaults $M -bios $FIRMWARE" -[ -f "$ENV" ] && command+=" -initrd $ENV" -command+=" -display none -serial stdio -kernel" +command+=" -display none -serial stdio $INITRD -kernel" command="$(migration_cmd) $(timeout_cmd) $command" echo $command "$@" diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 5c10828e30f9..9efa76d6ae33 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -155,3 +155,9 @@ search_qemu_binary () command -v $qemu export PATH=$save_path } + +initrd_create () +{ + unset INITRD + [ -f "$ENV" ] && INITRD="-initrd $ENV" +} diff --git a/x86/run b/x86/run index c0502c7c3fcb..5b402a680cc7 100755 --- a/x86/run +++ b/x86/run @@ -26,9 +26,10 @@ else pc_testdev="-device testdev,chardev=testlog -chardev file,id=testlog,path=msr.out" fi +initrd_create + command="${qemu} -nodefaults -enable-kvm $pc_testdev -vnc none -serial stdio $pci_testdev $hyperv_testdev" -[ -f "$ENV" ] && command+=" -initrd $ENV" -command+=" -kernel" +command+=" $INITRD -kernel" command="$(timeout_cmd) $command" echo ${command} "$@"