All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH 1/4] scripts/arch-run: function to search qemu binary
@ 2017-04-19 19:14 Balamuruhan S
  2017-04-21  6:46 ` Balamuruhan S
  2017-04-21 11:07 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Balamuruhan S @ 2017-04-19 19:14 UTC (permalink / raw)
  To: kvm; +Cc: drjones, Balamuruhan S

qemu_binary function to seach qemu binary similar to x86/run does
so that it can be reused for all arches

Signed-off-by: Balamuruhan S <bala24@linux.vnet.ibm.com>
---
 scripts/arch-run.bash | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 94c50f3..404a4c0 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -133,3 +133,25 @@ migration_cmd ()
 		echo "run_migration"
 	fi
 }
+
+# qemu binary search function for all arches
+qemu_binary ()
+{
+    PATH=$PATH:/usr/libexec
+    qemubinarysearch="${QEMU:-qemu-system-$ARCH_NAME qemu-kvm}"
+    for qemucmd in ${qemubinarysearch}
+    do
+        unset QEMUFOUND
+        unset qemu
+        if ! [ -z "${QEMUFOUND=$(${qemucmd} --help 2>/dev/null  | grep "QEMU")}" ]
+        then
+            qemu="${qemucmd}"
+            break
+        fi
+    done
+
+    if [ -z "${QEMUFOUND}" ]; then
+        echo "A QEMU binary was not found, You can set a custom location by using the QEMU=<path> environment variable"
+        exit 2
+    fi
+}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-21 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 19:14 [kvm-unit-tests PATCH 1/4] scripts/arch-run: function to search qemu binary Balamuruhan S
2017-04-21  6:46 ` Balamuruhan S
2017-04-21 11:07 ` Paolo Bonzini
2017-04-21 12:50   ` Balamuruhan S

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.