Unverified Commit a42cb347 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Support UUID flag (#624)

parent a37db1b0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
#!/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=""
+4 −8
Original line number Diff line number Diff line
@@ -35,17 +35,13 @@ 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."
    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."
      warn "you are using macOS 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
  fi
  fi

fi