From ec8eb6d81c8514cea00cf708393e0920781f9a3a Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:27:37 +0100 Subject: [PATCH] Update import-disk-image.sh --- scripts/import-disk-image.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/import-disk-image.sh b/scripts/import-disk-image.sh index a8c8499..42acd63 100644 --- a/scripts/import-disk-image.sh +++ b/scripts/import-disk-image.sh @@ -183,13 +183,19 @@ for IMAGE in $SELECTED_IMAGES; do LAST_SLOT=$(echo "$EXISTING_DISKS" | tail -n1 | sed "s/${INTERFACE}//") NEXT_SLOT=$((LAST_SLOT + 1)) fi + - # Ask if SSD emulation is desired - if (whiptail --title "$(translate 'SSD Emulation')" --yesno "$(translate 'Do you want to use SSD emulation for this disk?')" 10 60); then - SSD_OPTION=",ssd=1" + # Ask if SSD emulation is desired (only for non-VirtIO interfaces) + if [ "$INTERFACE" != "virtio" ]; then + if (whiptail --title "$(translate 'SSD Emulation')" --yesno "$(translate 'Do you want to use SSD emulation for this disk?')" 10 60); then + SSD_OPTION=",ssd=1" + else + SSD_OPTION="" + fi else SSD_OPTION="" fi + msg_info "$(translate 'Configuring disk')" @@ -200,6 +206,7 @@ for IMAGE in $SELECTED_IMAGES; do # Ask if the disk should be bootable if (whiptail --title "$(translate 'Make Bootable')" --yesno "$(translate 'Do you want to make this disk bootable?')" 10 60); then msg_info "$(translate 'Configuring disk as bootable')" + if qm set "$VMID" --boot c --bootdisk ${INTERFACE}${NEXT_SLOT} &>/dev/null; then msg_ok "$(translate 'Disk configured as bootable')" else