qemu-e2k/chardev
Peter Maydell 12051d82f0 chardev/char-fe: Allow NULL chardev in qemu_chr_fe_init()
All the functions in char-fe.c handle the CharBackend
having a NULL Chardev pointer, which means that the
backend exists but is not connected to anything. The
exception is qemu_chr_fe_init(), which will crash if
passed a NULL Chardev pointer argument. This can happen
for various boards if they're started with 'nodefaults':
 arm-softmmu/qemu-system-arm -S -nodefaults -M cubieboard
 riscv32-softmmu/qemu-system-riscv32 -nodefaults -M sifive_e

Make qemu_chr_fe_init() accept a NULL chardev. This allows
UART models to handle NULL chardev properties without
generally needing to special case them or to manually
create a NullChardev.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20180323152948.27048-1-peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-03-26 14:37:15 +02:00
..
Makefile.objs buildsys: Move brlapi libs to per object 2017-09-22 10:20:34 +08:00
baum.c baum: Truncate braille device size to 84x1 2017-12-21 09:22:44 +01:00
char-console.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-fd.c chardev: remove context in chr_update_read_handler 2017-09-22 21:07:27 +02:00
char-fe.c chardev/char-fe: Allow NULL chardev in qemu_chr_fe_init() 2018-03-26 14:37:15 +02:00
char-file.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
char-io.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-mux.c chardev: introduce chr_machine_done hook 2018-03-12 16:12:46 +01:00
char-null.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-parallel.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
char-pipe.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
char-pty.c chardev: fix incorrect unref of source 2018-02-05 13:54:39 +01:00
char-ringbuf.c Include less of the generated modular QAPI headers 2018-03-02 13:45:50 -06:00
char-serial.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
char-socket.c chardev-socket: remove useless if 2018-03-26 14:37:14 +02:00
char-stdio.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
char-udp.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
char-win-stdio.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-win.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char.c * Record-replay lockstep execution, log dumper and fixes (Alex, Pavel) 2018-03-16 11:05:03 +00:00
msmouse.c char: move char devices to chardev/ 2017-06-02 11:33:53 +04:00
spice.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
testdev.c char: move char devices to chardev/ 2017-06-02 11:33:53 +04:00
trace-events docs: fix broken paths to docs/devel/tracing.txt 2017-07-31 13:12:53 +03:00
wctablet.c misc: remove headers implicitly included 2017-12-18 17:07:02 +03:00