[kvm-unit-tests PATCH 1/4] scripts/arch-run: function to search qemu binary

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

 



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@xxxxxxxxxxxxxxxxxx>
---
 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




[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