From 0ec846bface0f9733ca61ba18e3d4b72bfd9f8ca Mon Sep 17 00:00:00 2001 From: Anton Nefedov Date: Tue, 25 Jul 2017 13:04:41 +0300 Subject: char: don't exit on hmp 'chardev-add help' qemu_chr_new_from_opts() is used from both vl.c and hmp, and it is quite confusing to see qemu suddenly exit after receiving a help option in hmp. Do exit(0) from vl.c instead. Signed-off-by: Anton Nefedov Message-Id: <1500977081-120929-1-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini --- vl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index dd803fc..99fcfa0 100644 --- a/vl.c +++ b/vl.c @@ -2344,10 +2344,12 @@ static int chardev_init_func(void *opaque, QemuOpts *opts, Error **errp) { Error *local_err = NULL; - qemu_chr_new_from_opts(opts, &local_err); - if (local_err) { - error_report_err(local_err); - return -1; + if (!qemu_chr_new_from_opts(opts, &local_err)) { + if (local_err) { + error_report_err(local_err); + return -1; + } + exit(0); } return 0; } -- cgit v1.1