add x86_64 and riscv64 qemu command and options.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- providers/qemu/kvm.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/providers/qemu/kvm.sh b/providers/qemu/kvm.sh index 0c98065..6a1807f 100755 --- a/providers/qemu/kvm.sh +++ b/providers/qemu/kvm.sh @@ -25,6 +25,7 @@ qemu_command() { qemu=( qemu-system-aarch64 + qemu-system-x86_64 qemu-kvm )
@@ -74,6 +75,11 @@ check_option_value() } [ -n "$initrds" ] || exit + + [ -n "$(echo $kernel | grep "riscv64")" ] && qemu=qemu-system-riscv64 + + ls $bios >/dev/null 2>&1 || bios=/usr/share/ovmf/OVMF.fd + ls $helper >/dev/null 2>&1 || helper=/usr/lib/qemu/qemu-bridge-helper }
get_initrd() @@ -122,6 +128,17 @@ individual_option() -bios $bios -nic $nic ) + + x86_64=( + -bios $bios + -nic $nic + ) + + riscv64=( + -machine virt + -device virtio-net-device,netdev=net0,mac=${mac} + -netdev bridge,br=br0,id=net0,helper=${helper} + ) }
run_qemu() @@ -132,6 +149,13 @@ run_qemu() ;; qemu-kvm) [ "$(arch)" == "aarch64" ] && kvm=("${kvm[@]}" "${aarch64[@]}") + [ "$(arch)" == "x86_64" ] && kvm=("${kvm[@]}" "${x86_64[@]}") + ;; + qemu-system-x86_64) + kvm=("${kvm[@]}" "${x86_64[@]}") + ;; + qemu-system-riscv64) + kvm=("${kvm[@]}" "${riscv64[@]}") ;; esac
On Mon, Jan 04, 2021 at 01:06:16PM +0800, Liu Yinsi wrote:
add x86_64 and riscv64 qemu command and options.
Signed-off-by: Liu Yinsi liuyinsi@163.com
providers/qemu/kvm.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/providers/qemu/kvm.sh b/providers/qemu/kvm.sh index 0c98065..6a1807f 100755 --- a/providers/qemu/kvm.sh +++ b/providers/qemu/kvm.sh @@ -25,6 +25,7 @@ qemu_command() { qemu=( qemu-system-aarch64
qemu-kvm )qemu-system-x86_64
@@ -74,6 +75,11 @@ check_option_value() }
[ -n "$initrds" ] || exit
- [ -n "$(echo $kernel | grep "riscv64")" ] && qemu=qemu-system-riscv64
- ls $bios >/dev/null 2>&1 || bios=/usr/share/ovmf/OVMF.fd
- ls $helper >/dev/null 2>&1 || helper=/usr/lib/qemu/qemu-bridge-helper
}
get_initrd() @@ -122,6 +128,17 @@ individual_option() -bios $bios -nic $nic )
- x86_64=(
-bios $bios
-nic $nic
- )
- riscv64=(
-machine virt
-device virtio-net-device,netdev=net0,mac=${mac}
-netdev bridge,br=br0,id=net0,helper=${helper}
- )
}
run_qemu() @@ -132,6 +149,13 @@ run_qemu() ;; qemu-kvm) [ "$(arch)" == "aarch64" ] && kvm=("${kvm[@]}" "${aarch64[@]}")
[ "$(arch)" == "x86_64" ] && kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-x86_64)
kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-riscv64)
kvm=("${kvm[@]}" "${riscv64[@]}")
If individual_option() generate $APPEND var instead of `aarch64` `x86_64` `riscv64`, and so on. May be run_qemu() do not need the case block?
-------- Thanks Yu Chuan
;;
esac
-- 2.23.0
qemu-kvm) [ "$(arch)" == "aarch64" ] && kvm=("${kvm[@]}" "${aarch64[@]}")
[ "$(arch)" == "x86_64" ] && kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-x86_64)
kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-riscv64)
kvm=("${kvm[@]}" "${riscv64[@]}")
If individual_option() generate $APPEND var instead of `aarch64` `x86_64` `riscv64`, and so on. May be run_qemu() do not need the case block?
good
Thanks, Yinsi
Thanks Yu Chuan
;;
esac
-- 2.23.0