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

Re: [PATCH v3] xen/domain: introduce DOMID_ANY


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 10 Dec 2025 10:56:50 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Qs2E+t1VhP5H8rhJIroQzpyOH8ZHhNkyYLyak6fFgsI=; b=aSrwSRP47JRqC+ebONdTz2NJUp4LAZxdRfusd27qPrNSPK4ABIJZMcfB//hNvMljK+rb6+nV6DBLDJp2IBUOVMv+zVzjGtkqwInlqPzg05ASbdfQ25awxDBORYAulgYQAU1e6jToU1LfbTze0by9qQ/LPjnZTrsyKdgl7XH9QMjssx5j3SsuxvvdapTMLMDMjERLDh8WwtgDssApWDHKhfpck+rKaAKwuhnuEEIt6WV1FVnalK35VuZt0eckVgv5A/YNRk1seW8xDCWBIuwxxICmAiJg3MCMO1FnuXhMvqsHdsO4dQn0h0c/j8wp9D/0LLQrrS1KQtDog8AEWbMYHQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nSegdbKKTv45eQx9xqWRECTk81k+/fdMVSsIHVJtJiDINURf7wn0TIL8qT5HP48/NnbfKjeFaeqSV7wYH25qIL6IFdu70dmo23QpCHSBkhprmvQqNET07rS6dtwIkYqMi275jyTP+r/MEaB/WG8IgjY4O80YRxqWN6EvlAKYxRMGaQ2GLzBpFkAphvvfRadmEfjBE3zdfI80Dm2vDOkl42We+leNpPi3HbR94YTGYPMqBr4JsehbqQN7Moj0hIz1zCL9ZnVhFimO9Q2oybpQg4dsA0wFGWT1dJwZUxxG6EXN7IbkWBCOTPM7UMXJYF48nZSE4wIa/15pmWNbNzEysw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, dmukhin@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, dmukhin@xxxxxxxx
  • Delivery-date: Wed, 10 Dec 2025 09:57:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Dec 10, 2025 at 08:36:37AM +0100, Jan Beulich wrote:
> On 10.12.2025 02:04, Stefano Stabellini wrote:
> > On Tue, 23 Sep 2025, dmukhin@xxxxxxx wrote:
> >> From: Denis Mukhin <dmukhin@xxxxxxxx> 
> >>
> >> Add a new symbol DOMID_ANY aliasing DOMID_INVALID to improve the 
> >> readability
> >> of the code.
> >>
> >> Update all relevant domid_alloc() call sites.
> >>
> >> Amends: 2d5065060710 ("xen/domain: unify domain ID allocation")
> >> Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
> > 
> > Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> 
> The other day concern was voiced over aliasing DOMID_ANY with DOMID_INVALID.
> I don't recall though who it was or where.

I'm afraid it was me (at least) that voiced such concern.  But then I
completely forgot to reply to the patch.  I don't think this is a good
idea, aliasing DOMID_ANY with DOMID_INVALID is likely to be dangerous
in the long run.  In the example here it's fine, because the function
itself doesn't use DOMID_INVALID (iow: all usages of DOMID_INVALID are
replaced with DOMID_ANY).

However I could see a function wanting to use both DOMID_INVALID and
DOMID_ANY for different purposes.  Having both aliased to the same
value is not going to work as expected.  If we have to introduce
DOMID_ANY it must use a different value than DOMID_INVALID.  And given
the context here I would be fine leaving domid_alloc() to handle
getting passed DOMID_INVALID as a signal to search for an empty domid
to use, I don't see a compelling reason to introduce DOMID_ANY.

Thanks, Roger.



 


Rackspace

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