Skip to content

Commit 6dab7ef

Browse files
committed
run_qemu.sh: replace qemu -S + KVM with a long bootloader timeout
qemu -S does not seem compatible with KVM, see #11 For details. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent 24b0a19 commit 6dab7ef

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

run_qemu.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,11 @@ update_rootfs_boot_kernel()
938938

939939
defconf="$builddir/mnt/loader/loader.conf"
940940
local loader_timeout=4
941+
if [[ $_arg_kvm == "on" ]] && [[ $_arg_gdb == "on" ]]; then
942+
# KVM is not compatible with qemu -S, see
943+
# https://github.com/pmem/run_qemu/issues/11
944+
loader_timeout=301
945+
fi
941946

942947
# mkosi->"bootctl install ..." creates a stub loader.conf.
943948
# It can also come from a previous run of this script.
@@ -1872,7 +1877,22 @@ prepare_qcmd()
18721877
fi
18731878

18741879
if [ "$_arg_gdb" == "on" ]; then
1875-
qcmd+=("-gdb" "tcp::10000" "-S")
1880+
qcmd+=("-gdb" "tcp::10000")
1881+
# -S seems to rely on a _software_ breakpoint which seems incompatible with KVM,
1882+
# see https://github.com/pmem/run_qemu/issues/11
1883+
if [[ "$_arg_kvm" == 'on' ]]; then
1884+
{
1885+
printf '\n\nWARNING: qemu "-S" option seems incompatible with KVM; not used.\n'
1886+
if [[ "$_arg_direct_kernel" == 'on' ]]; then
1887+
printf '\tOption --no-direct-kernel is recommended.\n\n'
1888+
else
1889+
printf '\tBoot loader will wait a few minutes.\n\n'
1890+
fi
1891+
} >&2
1892+
sleep 2
1893+
else
1894+
qcmd+=("-S")
1895+
fi
18761896
fi
18771897

18781898
# cpu + mem nodes (i.e. the --nodes option)

0 commit comments

Comments
 (0)