qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 07/15] qio/chardev: update net listener gcont


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 07/15] qio/chardev: update net listener gcontext
Date: Fri, 2 Mar 2018 12:17:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 02/03/2018 05:26, Peter Xu wrote:
> Frankly speaking I was a bit confused when I started to read
> chardev/qio codes with so many hooks, e.g., when I saw:
> 
>      qio_net_listener_set_client_func(s->listener, tcp_chr_accept,
>                                       chr, NULL);
> 
> I totally have no idea on what happened.  I need to go deeper into the
> net listener code to know that, hmm, it's setting up something to
> accept connections!
> 
> If I can have something like:
> 
>     tcp_chr_net_listener_setup(s, true);
> 
> It may be easier for me to understand that there's something either
> registered for the listening ports, and I don't need to care about
> which function will be called when accept happened.  Basically it
> "hides" some logic inside, that's IMHO where functions/macros help.

I tend to agree with Daniel, but I probably would be convinced if you
had a pair of functions tcp_chr_{start,stop}_listen instead of a bool
argument.

Paolo



reply via email to

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