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

feat: Added option to disable data disks (#1075)

parent 13d6e4be
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -635,6 +635,7 @@ html "$msg"
[ -z "${DISK_OPTS:-}" ] && DISK_OPTS=""
[ -z "${DISK_TYPE:-}" ] && DISK_TYPE="scsi"
[ -z "${DISK_NAME:-}" ] && DISK_NAME="data"
[ -z "${DISK_DISABLE:-}" ] && DISK_DISABLE=""

case "${DISK_TYPE,,}" in
  "ide" | "sata" | "nvme" | "usb" | "scsi" | "blk" | "auto" | "none" ) ;;
@@ -730,6 +731,14 @@ else
  DISK_ALLOC="preallocation=falloc"
fi

if [[ "$DISK_DISABLE" == [Yy1]* ]]; then
  case "${DISK_TYPE,,}" in
    "blk" | "scsi" | "virtio-blk" | "virtio-scsi" )
      DISK_OPTS+=" -object iothread,id=io2" ;;
  esac
  return 0
fi

: "${DISK2_SIZE:=""}"
: "${DISK3_SIZE:=""}"
: "${DISK4_SIZE:=""}"
+2 −0
Original line number Diff line number Diff line
@@ -178,6 +178,8 @@ cpu() {

hasDisk() {

  [[ "${DISK_DISABLED:-}" == [Yy1]* ]] && return 1

  [ -b "/disk" ] && return 0
  [ -b "/disk1" ] && return 0
  [ -b "/dev/disk1" ] && return 0