summaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 983259bc9f..8c8f14287e 100644
--- a/vl.c
+++ b/vl.c
@@ -2195,6 +2195,7 @@ static int mon_init_func(QemuOpts *opts, void *opaque)
static void monitor_parse(const char *optarg, const char *mode, bool pretty)
{
static int monitor_device_index = 0;
+ Error *local_err = NULL;
QemuOpts *opts;
const char *p;
char label[32];
@@ -2215,9 +2216,10 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty)
}
}
- opts = qemu_opts_create(qemu_find_opts("mon"), label, 1, NULL);
+ opts = qemu_opts_create(qemu_find_opts("mon"), label, 1, &local_err);
if (!opts) {
- fprintf(stderr, "duplicate chardev: %s\n", label);
+ error_report("%s", error_get_pretty(local_err));
+ error_free(local_err);
exit(1);
}
qemu_opt_set(opts, "mode", mode);
@@ -2450,6 +2452,7 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b)
mc = find_machine(name);
}
if (mc) {
+ g_slist_free(machines);
return mc;
}
if (name && !is_help_option(name)) {