8e9119a8 | 24-Feb-2020 |
Kevin Wolf <kwolf@redhat.com> |
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_
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>
show more ...
|
f27a9bb3 | 24-Feb-2020 |
Kevin Wolf <kwolf@redhat.com> |
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_
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 <kwolf@redhat.com> Message-Id: <20200224143008.13362-18-kwolf@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
637de4db | 17-Apr-2019 |
Markus Armbruster <armbru@redhat.com> |
qemu-print: New qemu_printf(), qemu_vprintf() etc.
We commonly want to print to the current monitor if we have one, else to stdout/stderr. For stderr, have error_printf(). For stdout, all we have
qemu-print: New qemu_printf(), qemu_vprintf() etc.
We commonly want to print to the current monitor if we have one, else to stdout/stderr. For stderr, have error_printf(). For stdout, all we have is monitor_vfprintf(), which is rather unwieldy. We often print to stderr just because error_printf() is easier.
New qemu_printf() and qemu_vprintf() do exactly what's needed. The next commits will put them to use.
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190417190641.26814-12-armbru@redhat.com>
show more ...
|