qemu/softmmu
Peter Maydell 597a9a2b4b system/vl.c: Fix handling of '-serial none -serial something'
Currently if the user passes multiple -serial options on the command
line, we mostly treat those as applying to the different serial
devices in order, so that for example
 -serial stdio -serial file:filename
will connect the first serial port to stdio and the second to the
named file.

The exception to this is the '-serial none' serial device type.  This
means "don't allocate this serial device", but a bug means that
following -serial options are not correctly handled, so that
 -serial none -serial stdio
has the unexpected effect that stdio is connected to the first serial
port, not the second.

This is a very long-standing bug that dates back at least as far as
commit 998bbd74b9 from 2009.

Make the 'none' serial type move forward in the indexing of serial
devices like all the other serial types, so that any subsequent
-serial options are correctly handled.

Note that if your commandline mistakenly had a '-serial none' that
was being overridden by a following '-serial something' option, you
should delete the unnecessary '-serial none'.  This will give you the
same behaviour as before, on QEMU versions both with and without this
bug fix.

Cc: qemu-stable@nongnu.org
Reported-by: Bohdan Kostiv <bohdan.kostiv@tii.ae>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240122163607.459769-2-peter.maydell@linaro.org
Fixes: 998bbd74b9 ("default devices: core code & serial lines")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit d2019a9d0c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-02-03 16:43:46 +03:00
..
arch_init.c
balloon.c
bootdevice.c
cpu-throttle.c
cpu-timers.c
cpus.c * Fix and test the VISTR instruction on s390x 2022-10-31 06:19:54 -04:00
datadir.c
device_tree.c device-tree: add re-randomization helper function 2022-10-27 11:34:31 +01:00
dirtylimit.c
dma-helpers.c
globals.c
icount.c icount: don't adjust virtual time backwards after warp 2023-06-29 18:17:49 +03:00
ioport.c
main.c
memory_mapping.c
memory.c system/memory: use ldn_he_p/stn_he_p 2023-12-20 19:11:10 +03:00
meson.build
physmem.c memory: Fix wrong end address dump 2022-11-08 15:53:40 -05:00
qdev-monitor.c
qemu-seccomp.c seccomp: Get actual errno value from failed seccomp functions 2022-10-26 13:32:58 +01:00
qtest.c module: add Error arguments to module_load and module_load_qom 2022-11-06 09:48:50 +01:00
rtc.c
runstate-action.c
runstate.c reset: allow registering handlers that aren't called by snapshot loading 2022-10-27 11:34:31 +01:00
timers-state.h
tpm.c
trace-events
trace.h
vl.c system/vl.c: Fix handling of '-serial none -serial something' 2024-02-03 16:43:46 +03:00