On Tue, Mar 06, 2018 at 01:33:16PM +0800, Peter Xu wrote: > 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 <pet...@redhat.com> > --- > chardev/char-mux.c | 33 +++++++++++++++++++++++++++++---- > chardev/char.c | 43 +++++++++++++++++-------------------------- > include/chardev/char-mux.h | 2 -- > include/chardev/char.h | 2 ++ > tests/test-char.c | 1 - > 5 files changed, 48 insertions(+), 33 deletions(-)
Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|