On Tue, Jan 12, 2021 at 06:10:57PM +0800, Wu Fengguang wrote:
+set_qemu() +{
- qemus=(
qemu-system-$arch
qemu-kvm
- )
- for qemu in "${qemus[@]}"
- do
[ -n "$(command -v ${qemu})" ] && break
This looks a bit easier:
command -v "$qemu" >/dev/null && break
ok, got it
- done
The above/below logics are completely differnt logics.
ok, i will sperate below to other function
It looks the below one looks more reasonable.
How about first test qemu-system-$arch, then try qemu-kvm?
ok, i will try
Thanks, Yinsi
- # debian has both qemu-system-x86_64 and qemu-system-riscv64 command
- [[ $kernel =~ 'riscv64' ]] && qemu=qemu-system-riscv64
+}