aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorAnton Nefedov <anton.nefedov@virtuozzo.com>2017-07-25 13:04:41 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2017-08-01 17:27:33 +0200
commit0ec846bface0f9733ca61ba18e3d4b72bfd9f8ca (patch)
treeba0be0c50679eccff36b1668ec7c8d001ba7e1c6 /vl.c
parent4db0db1fa6b653970148f6ff7a24bede1d52ef9d (diff)
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 <anton.nefedov@virtuozzo.com> Message-Id: <1500977081-120929-1-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/vl.c b/vl.c
index dd803fc244..99fcfa0442 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;
}