From: dmukhin@xen.org
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>,
Stefano Stabellini <sstabellini@kernel.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: Fri, 9 Jan 2026 06:03:36 -0800 [thread overview]
Message-ID: <aWEKuE4ccuswO8dy@kraken> (raw)
In-Reply-To: <aTlD4nZSU5rXIxSo@Mac.lan>
On Wed, Dec 10, 2025 at 10:56:50AM +0100, Roger Pau Monné wrote:
> 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 for the feedback!
I agree with having a dedicated reservation for DOMID_ANY.
I think introducing a new DOMID_ANY symbol improves code readability
a bit.
>
> Thanks, Roger.
prev parent reply other threads:[~2026-01-09 14:03 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é
2026-01-09 14:03 ` dmukhin [this message]
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=aWEKuE4ccuswO8dy@kraken \
--to=dmukhin@xen.org \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=dmukhin@ford.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.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.