qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/21] qemu-char: add create to register_char_dr


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 03/21] qemu-char: add create to register_char_driver
Date: Mon, 12 Oct 2015 09:04:06 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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 <address@hidden>
> ---
>  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 <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]