On Tue, Nov 04, 2025 at 01:37:34PM +0100, Kevin Wolf wrote:
> Am 03.11.2025 um 21:10 hat Eric Blake geschrieben:
> > The code had three similar repetitions of an iteration over one or all
> > of nsiocs to set up a GSource, and likewise for teardown.  Since an
> > upcoming patch wants to tweak whether GSource or AioContext is used,
> > its better to consolidate that into one helper function for fewer
> > places to edit later.
> > 
> > Signed-off-by: Eric Blake <[email protected]>
> > ---
> >  io/net-listener.c | 109 +++++++++++++++++++---------------------------
> >  1 file changed, 45 insertions(+), 64 deletions(-)
> 
> > @@ -145,15 +174,11 @@ void 
> > qio_net_listener_set_client_func_full(QIONetListener *listener,
> >                                             GDestroyNotify notify,
> >                                             GMainContext *context)
> >  {
> > -    size_t i;
> > -
> >      if (listener->io_func == func && listener->io_data == data) {
> >          return;
> >      }
> > 
> > -    if (listener->io_func) {
> > -        trace_qio_net_listener_watch_disabled(listener, "set_client_func");
> > -    }
> > +    qio_net_listener_unwatch(listener, "set_client_func");
> >      if (listener->io_notify) {
> >          listener->io_notify(listener->io_data);
> >      }
> 
> This changes the order between the io_notify() call and the unwatch. Is
> this intentional? If so, maybe mention it in the commit message and why
> it's safe.

At least conceptually I think this ordering is better, and I don't think
there should be any functional consequences from the change.

With 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 :|


Reply via email to