All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	dmukhin@xen.org, xen-devel@lists.xenproject.org,
	andrew.cooper3@citrix.com, anthony.perard@vates.tech,
	julien@xen.org, michal.orzel@amd.com, dmukhin@ford.com
Subject: Re: [PATCH v3] xen/domain: introduce DOMID_ANY
Date: Wed, 10 Dec 2025 10:56:50 +0100	[thread overview]
Message-ID: <aTlD4nZSU5rXIxSo@Mac.lan> (raw)
In-Reply-To: <f5a7536b-32e5-44d9-b087-556559650fd8@suse.com>

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@xen.org wrote:
> >> From: Denis Mukhin <dmukhin@ford.com> 
> >>
> >> 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@ford.com>
> > 
> > Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> 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.


  reply	other threads:[~2025-12-10  9:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  3:06 [PATCH v3] xen/domain: introduce DOMID_ANY dmukhin
2025-12-10  1:04 ` Stefano Stabellini
2025-12-10  7:36   ` Jan Beulich
2025-12-10  9:56     ` Roger Pau Monné [this message]
2026-01-09 14:03       ` dmukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aTlD4nZSU5rXIxSo@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=dmukhin@ford.com \
    --cc=dmukhin@xen.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.