Fix mounting CDs in qemurc.

This commit is contained in:
Tom Alexander 2025-10-18 18:52:53 -04:00
parent 3918775c1d
commit 8888838457
Signed by: talexander
GPG Key ID: 36C99E8B3C39D85F

View File

@ -293,7 +293,6 @@ function start_body {
local zfs_path="${ZFS_ROOT}/${name}"
local mount_path="${MOUNT_ROOT}/${name}"
local run_path="/run/qemurc/${name}"
local mount_cd="$CD"
local swtpm_sock="${run_path}/swtpm.sock"
local swtpm_path="${MOUNT_ROOT}/${name}/swtpm"
@ -303,6 +302,8 @@ function start_body {
source "${mount_path}/settings"
fi
local mount_cd="$CD"
local additional_args=()
if [ -n "$BIND9P" ]; then
@ -310,7 +311,9 @@ function start_body {
fi
if [ -n "$mount_cd" ]; then
additional_args+=(-cdrom "$mount_cd")
additional_args+=(-drive "file=${mount_cd},media=cdrom,id=drive-cd1,readonly=on,if=none"
-device "ahci,id=achi0"
-device "ide-cd,bus=achi0.0,drive=drive-cd1,id=cd1,bootindex=1")
fi
if [ "$VNC_ENABLE" = "YES" ]; then
additional_args+=(-vnc "${VNC_LISTEN},power-control=on")
@ -357,7 +360,6 @@ function start_body {
-drive "if=none,file=/dev/zvol/${zfs_path}/disk0,format=raw,id=hd0"
-device 'nvme,serial=deadbeef,drive=hd0'
-nic 'user,hostfwd=tcp::60022-:22'
-boot order=d
"${additional_args[@]}"
)
set +e