From: Laurent Vivier Subject: Re: [PATCH kvm-unit-tests v2 1/9] arch-run: introduce initrd_create Date: Tue, 13 Jun 2017 11:50:31 +0200 Message-ID: <1991618f-6cd6-632a-c344-4d727274773e@redhat.com> References: <20170606182249.19313-1-drjones@redhat.com> <20170606182249.19313-2-drjones@redhat.com> <8be39404-bb73-543c-cd26-cc70add59e5a@redhat.com> <20170613080429.ks5itrpvmrgaq3tg@kamzik.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com, thuth@redhat.com To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58870 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752021AbdFMJue (ORCPT ); Tue, 13 Jun 2017 05:50:34 -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 9417356FC for ; Tue, 13 Jun 2017 09:50:33 +0000 (UTC) In-Reply-To: <20170613080429.ks5itrpvmrgaq3tg@kamzik.brq.redhat.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 13/06/2017 10:04, Andrew Jones wrote: > On Thu, Jun 08, 2017 at 12:04:39PM +0200, Laurent Vivier wrote: >> On 06/06/2017 20:22, Andrew Jones wrote: >>> 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 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..fc95e263458f 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" ] && INITRD="-initrd $ENV" >>> +} >> >> Is this intentional to not clear INITRD and thus to allow it to be >> imported from the environment? > > Actually no, that wasn't intentional. I'm not sure I have much of a > preference, but I'm leaning towards wanting to clear it. What do you > think? I think it's better to clear it to have a deterministic behavior of the test (only influenced by ENV). Laurent