From 830896afe3d0ba74f023faba88eac2b5ef91a11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sat, 22 Oct 2016 13:09:37 +0300 Subject: char: move fe_open in CharBackend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fe_open state belongs to front end. Signed-off-by: Marc-André Lureau Message-Id: <20161022100951.19562-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-char.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'qemu-char.c') diff --git a/qemu-char.c b/qemu-char.c index a1517a4..3b98acf 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -910,6 +910,7 @@ bool qemu_chr_fe_init(CharBackend *b, CharDriverState *s, Error **errp) s->be = b; } + b->fe_open = false; b->tag = tag; b->chr = s; @@ -4216,10 +4217,10 @@ void qemu_chr_fe_set_open(CharBackend *be, int fe_open) return; } - if (chr->fe_open == fe_open) { + if (be->fe_open == fe_open) { return; } - chr->fe_open = fe_open; + be->fe_open = fe_open; if (chr->chr_set_fe_open) { chr->chr_set_fe_open(chr, fe_open); } @@ -4304,7 +4305,7 @@ ChardevInfoList *qmp_query_chardev(Error **errp) info->value = g_malloc0(sizeof(*info->value)); info->value->label = g_strdup(chr->label); info->value->filename = g_strdup(chr->filename); - info->value->frontend_open = chr->fe_open; + info->value->frontend_open = chr->be && chr->be->fe_open; info->next = chr_list; chr_list = info; -- cgit v1.1