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

Re: [XEN PATCH v2 2/5] xen: export get_free_port


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 13 Jan 2022 09:19:05 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KScsDY4LwyagADaLvB1K2RfpptsFjmeM09CnVIYa2dk=; b=lUYE3Kp98ku+k2G4555ErvGm4eY0vYOqXMMjRHZnPCKrE23MMmJoBMWolw3uT40Sv770nOs9PX5hyu0EdFcEq5D0YKNMXGDcNQuSKP0M6kR6tabm5ujJE+7JEqneh/raHKaFO1VL09cipYOqAzRvVutzjQIW+6rJYfesfncQT2Gc4wBxQ6ns+xwvBvD1N9sQ8ZigLcR0BK1eEwhvmsPlsbD44n/LnAr/dpzo+s9lH/dj9szpryb988Ey06HlDbO1nhi2uXVNcsrY2C2iQh98thO/EjSiH/vDA3OjV8aLXWN6IxqGBt+tB1vzHzHEaGmv8a3DrxIVQjfsTzUsR8kCCw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XnyDFMKe406UsuIyhNgHZEjQQr+0DmWMORBSI2zIiMPep6J86Zhus3E6OgGJW5Y59/n7qdMHPXBENcthPKRbvdml45zI5V4VhlmX24NYcXzEJ/2TCtVF+VvoxxpTPq2PDdR3i5tHhW85Mc/70tA6hdA/W2S20G9aEvkxb6vCqbcPEKvTSQsOrppCLgvDc8QseVe8YdvntCz9bvaQzzrlQCU78VRXuzaUnYQUl4BcxG4MzRZwPwYwxUz5B2MRD5BgVL0PPSWDu8OhEl13RFjhhFqYP+CHTMrhtOarVm5gSTHvB0Lc39tM83Yzgx9LNOc8OHPc8Ef/mPAVfWQJJWmYsQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: jgross@xxxxxxxx, Bertrand.Marquis@xxxxxxx, julien@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 13 Jan 2022 08:19:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.