[PATCH kvm-unit-tests 1/2] arch-run: Allow $QEMU to include parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <peter.maydell@xxxxxxxxxx>
Cc: Alex Bennée <alex.bennee@xxxxxxxxxx>
Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Cc: Laurent Vivier <lvivier@xxxxxxxxxx>
Cc: Thomas Huth <thuth@xxxxxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Cc: Janosch Frank <frankja@xxxxxxxxxxxxx>
Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
---
 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
-- 
2.21.1





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux