]> Git Repo - qemu.git/commit
qmp: Fail gracefully if chardev is already in use
authorKevin Wolf <[email protected]>
Mon, 24 Feb 2020 14:30:05 +0000 (15:30 +0100)
committerKevin Wolf <[email protected]>
Fri, 6 Mar 2020 16:21:28 +0000 (17:21 +0100)
commitf27a9bb3e9c3bd822243f6fc1d921f1334e37acf
treeb49d9e73ae76af2c65765aee34cbf63cb2a9e7b3
parentf2098725aa3ebdb4095bc1951c1c0680adbdecc7
qmp: Fail gracefully if chardev is already in use

Trying to attach a QMP monitor to a chardev that is already in use
results in a crash because monitor_init_qmp() passes &error_abort to
qemu_chr_fe_init():

$ ./x86_64-softmmu/qemu-system-x86_64 --chardev stdio,id=foo --mon foo,mode=control --mon foo,mode=control
Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:220:
qemu-system-x86_64: --mon foo,mode=control: Device 'foo' is in use
Abgebrochen (Speicherabzug geschrieben)

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

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200224143008[email protected]>
Acked-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
include/monitor/monitor.h
monitor/monitor.c
monitor/qmp.c
stubs/monitor-core.c
tests/test-util-sockets.c
This page took 0.024682 seconds and 4 git commands to generate.