On 10/12/2015 02:03 AM, Paolo Bonzini wrote: > Having creation as a member of the CharDriver struct removes the need > to export functions for qemu-char.c's usage. After the conversion, > chardev backends implemented outside qemu-char.c will not need a stub > creation function anymore. > > Ultimately all drivers will be converted. For now, support the case > where cd->create == NULL. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > backends/baum.c | 3 +- > backends/msmouse.c | 3 +- > backends/testdev.c | 3 +- > include/sysemu/char.h | 4 +- > qemu-char.c | 213 > ++++++++++++++++++++++++++++---------------------- > spice-qemu-char.c | 4 +- > ui/console.c | 3 +- > 7 files changed, 133 insertions(+), 100 deletions(-)
The diff is a bit ugly because of reindentation, but seems sane. > > void register_char_driver(const char *name, ChardevBackendKind kind, > - void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp)) > + void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp), > + CharDriverState *(*create)(const char *id, ChardevBackend *backend, > + ChardevReturn *ret, Error **errp)) A typedef (or two) for the function pointer(s) would make this a bit easier to write. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature