diff --git a/src/config.sh b/src/config.sh index 1e7bd0ec..ab5620f8 100644 --- a/src/config.sh +++ b/src/config.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -Eeuo pipefail +: "${UUID:=""}" : "${SERIAL:="mon:stdio"}" : "${USB:="qemu-xhci,id=xhci"}" : "${MONITOR:="telnet:localhost:7100,server,nowait,nodelay"}" @@ -12,6 +13,7 @@ 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" MAC_OPTS="-machine type=${MACHINE},smm=${SECURE},graphics=off,vmport=off,dump-guest-core=off,hpet=off${KVM_OPTS}" +[ -n "$UUID" ] && MAC_OPTS="$MAC_OPTS -uuid $UUID" if [[ "${MACHINE,,}" == "pc-i440fx-2"* ]]; then DEV_OPTS="" diff --git a/src/proc.sh b/src/proc.sh index ca01d807..5cf38455 100644 --- a/src/proc.sh +++ b/src/proc.sh @@ -35,15 +35,11 @@ if [[ "$KVM" != [Nn]* ]]; then if [ -n "$KVM_ERR" ]; then KVM="N" if [[ "$OSTYPE" =~ ^darwin ]]; then - warn "you are using MacOS which has no KVM support, this will cause a major loss of performance." + warn "you are using macOS which has no KVM support, this will cause a major loss of performance." else - if grep -qi Microsoft /proc/version; then - warn "you are using Windows 10 which has no KVM support, this will cause a major loss of performance." - else - error "KVM acceleration not available $KVM_ERR, this will cause a major loss of performance." - error "See the FAQ on how to diagnose the cause, or continue without KVM by setting KVM=N (not recommended)." - [[ "$DEBUG" != [Yy1]* ]] && exit 88 - fi + error "KVM acceleration not available $KVM_ERR, this will cause a major loss of performance." + error "See the FAQ on how to diagnose the cause, or continue without KVM by setting KVM=N (not recommended)." + [[ "$DEBUG" != [Yy1]* ]] && exit 88 fi fi