From: Andrew Jones Subject: [PATCH kvm-unit-tests 1/8] arch-run: introduce initrd_create Date: Wed, 24 May 2017 18:08:11 +0200 Message-ID: <20170524160818.4326-2-drjones@redhat.com> References: <20170524160818.4326-1-drjones@redhat.com> Cc: pbonzini@redhat.com, rkrcmar@redhat.com, lvivier@redhat.com, thuth@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57902 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030500AbdEXQI0 (ORCPT ); Wed, 24 May 2017 12:08:26 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2EC2C054C58 for ; Wed, 24 May 2017 16:08:25 +0000 (UTC) In-Reply-To: <20170524160818.4326-1-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Encapsulate the preparation of the optional initrd command line option. Signed-off-by: Andrew Jones --- arm/run | 5 +++-- powerpc/run | 5 +++-- scripts/arch-run.bash | 5 +++++ x86/run | 5 +++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/arm/run b/arm/run index 700205bc70cb..1411b3885928 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..581552a21f2e 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -155,3 +155,8 @@ search_qemu_binary () command -v $qemu export PATH=$save_path } + +initrd_create () +{ + [ -f "$ENV" ] && export 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} "$@" -- 2.9.4