chardev: introduce chr_machine_done hook
Introduce ChardevClass.chr_machine_done() hook so that chardevs can run customized procedures after machine init. There was an existing mux user already that did similar thing but used a raw machine done notifier. Generalize it into a framework, and let the mux chardevs provide such a class-specific hook to achieve the same thing. Then we can move the mux related code to the char-mux.c file. Since at it, replace the mux_realized variable with the global machine_init_done varible. This notifier framework will be further leverged by other type of chardevs soon. Signed-off-by:Peter Xu <peterx@redhat.com> Message-Id: <20180306053320.15401-6-peterx@redhat.com> Acked-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Showing
- chardev/char-mux.c 29 additions, 4 deletionschardev/char-mux.c
- chardev/char.c 17 additions, 26 deletionschardev/char.c
- include/chardev/char-mux.h 0 additions, 2 deletionsinclude/chardev/char-mux.h
- include/chardev/char.h 2 additions, 0 deletionsinclude/chardev/char.h
- tests/test-char.c 0 additions, 1 deletiontests/test-char.c
Loading
Please register or sign in to comment