fix: Refactor USB (#239)
This commit is contained in:
parent
f89cb831c4
commit
038c4c6e14
1 changed files with 8 additions and 6 deletions
|
@ -12,7 +12,6 @@ SERIAL_OPTS="-serial $SERIAL"
|
|||
CPU_OPTS="-cpu $CPU_FLAGS -smp $SMP"
|
||||
RAM_OPTS=$(echo "-m ${RAM_SIZE^^}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
|
||||
MON_OPTS="-monitor $MONITOR -name $PROCESS,process=$PROCESS,debug-threads=on"
|
||||
[ -n "$USB" ] && [[ "${USB,,}" != "no"* ]] && USB_OPTS="-device $USB -device usb-kbd -device usb-tablet"
|
||||
MAC_OPTS="-machine type=${MACHINE},secure=${SECURE},dump-guest-core=off${KVM_OPTS}"
|
||||
|
||||
[ -n "$UUID" ] && MAC_OPTS+=" -uuid $UUID"
|
||||
|
@ -23,12 +22,15 @@ DEV_OPTS+=" -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0"
|
|||
|
||||
if [[ "${BOOT_MODE,,}" != "windows"* ]]; then
|
||||
DEV_OPTS+=" -device virtio-balloon-pci,id=balloon0,bus=pcie.0"
|
||||
if [ -d "/shared" ]; then
|
||||
fi
|
||||
|
||||
if [ -d "/shared" ] && [[ "${BOOT_MODE,,}" != "windows"* ]]; then
|
||||
DEV_OPTS+=" -fsdev local,id=fsdev0,path=/shared,security_model=none"
|
||||
DEV_OPTS+=" -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=shared"
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -n "$USB" ] && [[ "${USB,,}" != "no"* ]] && USB_OPTS="-device $USB -device usb-kbd -device usb-tablet"
|
||||
|
||||
ARGS="$DEF_OPTS $CPU_OPTS $RAM_OPTS $MAC_OPTS $DISPLAY_OPTS $MON_OPTS $SERIAL_OPTS ${USB_OPTS:-} $NET_OPTS $DISK_OPTS $BOOT_OPTS $DEV_OPTS $ARGUMENTS"
|
||||
ARGS=$(echo "$ARGS" | sed 's/\t/ /g' | tr -s ' ')
|
||||
|
||||
|
|
Loading…
Reference in a new issue