On 13.01.2022 01:58, Stefano Stabellini wrote: > --- a/xen/common/event_channel.c > +++ b/xen/common/event_channel.c > @@ -232,7 +232,7 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t > port) > return 0; > } > > -static int get_free_port(struct domain *d) > +int get_free_port(struct domain *d)
The name of the function isn't really suitable for being non-static. Can't we fold its functionality back into evtchn_allocate_port() (or the other way around, depending on the perspective you want to take) in case the caller passes in port 0? (Btw., it is imo wrong for the loop over ports to start at 0, when it is part of the ABI that port 0 is always invalid. evtchn_init() also better wouldn't depend on it being the only party to successfully invoke the function getting back port 0.) Jan
