From 3d9e232240f9d029d7255b5b11d3a2f61c53d0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 6 Feb 2019 18:43:23 +0100 Subject: char: update the mux handlers in class callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of handling mux chardev in a special way in qemu_chr_fe_set_handlers(), we may use the chr_update_read_handler class callback instead. Signed-off-by: Marc-André Lureau Message-Id: <20190206174328.9736-2-marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini --- chardev/char-mux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'chardev/char-mux.c') diff --git a/chardev/char-mux.c b/chardev/char-mux.c index 1199d32..23aa821 100644 --- a/chardev/char-mux.c +++ b/chardev/char-mux.c @@ -278,7 +278,7 @@ static void char_mux_finalize(Object *obj) qemu_chr_fe_deinit(&d->chr, false); } -void mux_chr_set_handlers(Chardev *chr, GMainContext *context) +static void mux_chr_update_read_handlers(Chardev *chr) { MuxChardev *d = MUX_CHARDEV(chr); @@ -289,7 +289,7 @@ void mux_chr_set_handlers(Chardev *chr, GMainContext *context) mux_chr_event, NULL, chr, - context, true, false); + chr->gcontext, true, false); } void mux_set_focus(Chardev *chr, int focus) @@ -383,6 +383,7 @@ static void char_mux_class_init(ObjectClass *oc, void *data) cc->chr_add_watch = mux_chr_add_watch; cc->chr_be_event = mux_chr_be_event; cc->chr_machine_done = open_muxes; + cc->chr_update_read_handler = mux_chr_update_read_handlers; } static const TypeInfo char_mux_type_info = { -- cgit v1.1