aboutsummaryrefslogtreecommitdiff
path: root/monitor/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/monitor.c')
-rw-r--r--monitor/monitor.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/monitor/monitor.c b/monitor/monitor.c
index f8a6ef795b..00d287655e 100644
--- a/monitor/monitor.c
+++ b/monitor/monitor.c
@@ -614,6 +614,7 @@ void monitor_init_globals_core(void)
int monitor_init(MonitorOptions *opts, Error **errp)
{
Chardev *chr;
+ Error *local_err = NULL;
chr = qemu_chr_find(opts->chardev);
if (chr == NULL) {
@@ -623,7 +624,7 @@ int monitor_init(MonitorOptions *opts, Error **errp)
switch (opts->mode) {
case MONITOR_MODE_CONTROL:
- monitor_init_qmp(chr, opts->pretty);
+ monitor_init_qmp(chr, opts->pretty, &local_err);
break;
case MONITOR_MODE_READLINE:
if (opts->pretty) {
@@ -636,6 +637,10 @@ int monitor_init(MonitorOptions *opts, Error **errp)
g_assert_not_reached();
}
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return -1;
+ }
return 0;
}