public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
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	[thread overview]
Message-ID: <20170613115451.6240-2-drjones@redhat.com> (raw)
In-Reply-To: <20170613115451.6240-1-drjones@redhat.com>

Encapsulate the preparation of the optional initrd command line
option.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 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} "$@"
 
-- 
2.9.4

  reply	other threads:[~2017-06-13 11:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 11:54 [PATCH kvm-unit-tests v3 0/9] Extend and apply the errata framework Andrew Jones
2017-06-13 11:54 ` Andrew Jones [this message]
2017-06-13 12:09   ` [PATCH kvm-unit-tests v3 1/9] arch-run: introduce initrd_create Laurent Vivier
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 2/9] arch-run: provide errata from run env Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 3/9] x86/run: source config.mak Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 4/9] arch-run: generate errata when no environ is provided Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 5/9] mkstandalone: provide errata to tests Andrew Jones
2017-06-13 12:15   ` Laurent Vivier
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 6/9] errata: add ERRATA_FORCE Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 7/9] README: add section on guarding unsafe tests Andrew Jones
2017-06-13 12:15   ` Laurent Vivier
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 8/9] AArch32: apply errata framework to unsafe pmccntr64 test Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 9/9] arm/arm64: apply errata framework to unsafe cpu-on test Andrew Jones
2017-06-14 18:58 ` [PATCH kvm-unit-tests v3 0/9] Extend and apply the errata framework Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170613115451.6240-2-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox