summaryrefslogtreecommitdiffstats
path: root/chardev
diff options
context:
space:
mode:
authorMarc-André Lureau2021-07-22 17:47:08 +0200
committerMarc-André Lureau2021-09-14 14:53:55 +0200
commit5eed493d01c3253a24ffa71c61e07dacad41cf05 (patch)
tree5b56e436dd9986f3ab8a82365cb3a49d5287f3a5 /chardev
parentchardev: Propagate error from logfile opening (diff)
downloadqemu-5eed493d01c3253a24ffa71c61e07dacad41cf05.tar.gz
qemu-5eed493d01c3253a24ffa71c61e07dacad41cf05.tar.xz
qemu-5eed493d01c3253a24ffa71c61e07dacad41cf05.zip
chardev: remove needless class method
"chr_option_parsed" is only implemented by the "mux" chardev, we can specialize the code there to avoid the needless generic class method. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'chardev')
-rw-r--r--chardev/char-mux.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/chardev/char-mux.c b/chardev/char-mux.c
index 5baf419010..ada0c6866f 100644
--- a/chardev/char-mux.c
+++ b/chardev/char-mux.c
@@ -386,10 +386,9 @@ void suspend_mux_open(void)
static int chardev_options_parsed_cb(Object *child, void *opaque)
{
Chardev *chr = (Chardev *)child;
- ChardevClass *class = CHARDEV_GET_CLASS(chr);
- if (!chr->be_open && class->chr_options_parsed) {
- class->chr_options_parsed(chr);
+ if (!chr->be_open && CHARDEV_IS_MUX(chr)) {
+ open_muxes(chr);
}
return 0;
@@ -412,7 +411,6 @@ static void char_mux_class_init(ObjectClass *oc, void *data)
cc->chr_accept_input = mux_chr_accept_input;
cc->chr_add_watch = mux_chr_add_watch;
cc->chr_be_event = mux_chr_be_event;
- cc->chr_options_parsed = open_muxes;
cc->chr_update_read_handler = mux_chr_update_read_handlers;
}