aboutsummaryrefslogtreecommitdiff
path: root/monitor/hmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/hmp.c')
-rw-r--r--monitor/hmp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/monitor/hmp.c b/monitor/hmp.c
index 944fa9651e..d598dd02bb 100644
--- a/monitor/hmp.c
+++ b/monitor/hmp.c
@@ -1399,12 +1399,16 @@ static void monitor_readline_flush(void *opaque)
monitor_flush(&mon->common);
}
-void monitor_init_hmp(Chardev *chr, bool use_readline)
+void monitor_init_hmp(Chardev *chr, bool use_readline, Error **errp)
{
MonitorHMP *mon = g_new0(MonitorHMP, 1);
+ if (!qemu_chr_fe_init(&mon->common.chr, chr, errp)) {
+ g_free(mon);
+ return;
+ }
+
monitor_data_init(&mon->common, false, false, false);
- qemu_chr_fe_init(&mon->common.chr, chr, &error_abort);
mon->use_readline = use_readline;
if (mon->use_readline) {