qemu-e2k/monitor
Kevin Wolf 8e9119a807 hmp: Fail gracefully if chardev is already in use
Trying to attach a HMP monitor to a chardev that is already in use
results in a crash because monitor_init_hmp() passes &error_abort to
qemu_chr_fe_init():

$ ./x86_64-softmmu/qemu-system-x86_64 --chardev stdio,id=foo --mon foo --mon foo
QEMU 4.2.50 monitor - type 'help' for more information
(qemu) Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:220:
qemu-system-x86_64: --mon foo: Device 'foo' is in use
Abgebrochen (Speicherabzug geschrieben)

Fix this by allowing monitor_init_hmp() to return an error and passing
any error in qemu_chr_fe_init() to its caller instead of aborting.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200224143008.13362-19-kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2020-03-06 17:21:28 +01:00
..
hmp-cmds.c blockdev-nbd: Boxed argument type for nbd-server-add 2020-03-06 17:21:28 +01:00
hmp.c hmp: Fail gracefully if chardev is already in use 2020-03-06 17:21:28 +01:00
Makefile.objs monitor: Collect "control" command handlers in qmp-cmds.control.c 2020-02-17 13:53:47 +01:00
misc.c qapi: Flatten object-add 2020-03-06 17:21:27 +01:00
monitor-internal.h monitor: Move qmp_query_qmp_schema to qmp-cmds-control.c 2020-02-17 13:53:47 +01:00
monitor.c hmp: Fail gracefully if chardev is already in use 2020-03-06 17:21:28 +01:00
qmp-cmds-control.c monitor: Move qmp_query_qmp_schema to qmp-cmds-control.c 2020-02-17 13:53:47 +01:00
qmp-cmds.c block: Move sysemu QMP commands to QAPI block module 2020-03-06 17:15:38 +01:00
qmp.c qmp: Fail gracefully if chardev is already in use 2020-03-06 17:21:28 +01:00
trace-events monitor: Split out monitor/monitor.c 2019-06-18 08:14:17 +02:00