Use new style -netdev

This commit is contained in:
Martin Wimpress 2020-03-20 20:35:11 +00:00
parent cbe9125730
commit 8e214447e8
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -192,13 +192,15 @@ function vm_boot() {
fi fi
echo " - Display: ${xres}x${yres}" echo " - Display: ${xres}x${yres}"
local NET="" # Set the hostname of the VM
local NET="user,hostname=${VMNAME}"
# If smbd is available, export $HOME to the guest via samba # If smbd is available, export $HOME to the guest via samba
if [ -e /snap/qemu-virgil/current/usr/sbin/smbd ]; then if [ -e /snap/qemu-virgil/current/usr/sbin/smbd ]; then
NET=",smb=${HOME}" NET="${NET},smb=${HOME}"
fi fi
if [ -n "${NET}" ]; then if [[ ${NET} == *"smb"* ]]; then
echo " - smbd: ${HOME} will be exported to the guest via smb://10.0.2.4/qemu" echo " - smbd: ${HOME} will be exported to the guest via smb://10.0.2.4/qemu"
else else
echo " - smbd: ${HOME} will not be exported to the guest. 'smbd' not found." echo " - smbd: ${HOME} will not be exported to the guest. 'smbd' not found."
@ -223,8 +225,8 @@ function vm_boot() {
-cpu host,kvm=on \ -cpu host,kvm=on \
-m ${ram} \ -m ${ram} \
-smp ${cores} \ -smp ${cores} \
-net nic,model=virtio \ -netdev ${NET},id=nic \
-net user"${NET}" \ -device virtio-net,netdev=nic \
-rtc base=localtime,clock=host \ -rtc base=localtime,clock=host \
-serial mon:stdio \ -serial mon:stdio \
-audiodev pa,id=pa,server=unix:$XDG_RUNTIME_DIR/pulse/native,out.stream-name=${LAUNCHER}-${VMNAME},in.stream-name=${LAUNCHER}-${VMNAME} \ -audiodev pa,id=pa,server=unix:$XDG_RUNTIME_DIR/pulse/native,out.stream-name=${LAUNCHER}-${VMNAME},in.stream-name=${LAUNCHER}-${VMNAME} \