aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
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;
}