From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>,
Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [PATCH] tools/xenpm: fix FreeBSD build
Date: Wed, 22 Apr 2026 11:16:48 +0200 [thread overview]
Message-ID: <aeiSAFy_P1QoIBaP@macbook.local> (raw)
In-Reply-To: <bb1d52a4-c344-4653-b10f-0781c2900cb0@suse.com>
On Wed, Apr 22, 2026 at 09:15:56AM +0200, Jan Beulich wrote:
> On 21.04.2026 17:51, Roger Pau Monné wrote:
> > On Tue, Apr 21, 2026 at 05:35:57PM +0200, Jan Beulich wrote:
> >> On 21.04.2026 17:32, Roger Pau Monne wrote:
> >>> --- a/tools/misc/xenpm.c
> >>> +++ b/tools/misc/xenpm.c
> >>> @@ -1377,7 +1377,7 @@ static int fetch_dts_temp(xc_interface *xch, uint32_t cpu, bool package, int *te
> >>> {
> >>> case 0:
> >>> /* This CPU isn't online or can't query this MSR */
> >>> - errno = ENODATA;
> >>> + errno = ENODEV;
> >>> return -1;
> >>
> >> "No such device", however, isn't quite what we want to convey here. If no
> >> better error code can be found that's available on FreeBSD and Linux, I'm
> >> inclined to suggest that we stick to ENODATA where available.
> >
> > Seems like a lot of complexity, for very limited usefulness.
>
> What's complex about
>
> #ifndef ENODATA
> # define ENODATA ENODEV
> #endif
>
> (perhaps with a brief comment)?
IMO it's best if we can avoid instances of ENODATA in the toolstack
code base, specially if it's individual ones like this that can be
fixed. Otherwise new instances might appear elsewhere, and we don't
want to be adding this bodge everywhere if avoidable.
If we had a sizable usage of ENODATA in the code base I would indeed
recommend such define approach.
> > The only
> > usage of errno is to be printed in the error message, and for the
> > purposes of this function ENODEV is already unique in the function, as
> > ENODATA was.
>
> Right, but "No data available" is more precise than "No such device".
>
> > FWIW, I think ENODEV is not that far fetched: the CPU being offline
> > or the MSR not being present seems like what you would convey by using
> > ENODEV.
>
> Yes, there is a connection. Hence I'm not outright opposed, yet I think
> we can do better.
>
> Formally Anthony is the maintainer of the file, so in a case like this
> one maybe he ought to have the final say?
I'm fine with letting Anthony resolve.
Thanks, Roger.
next prev parent reply other threads:[~2026-04-22 9:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 15:32 [PATCH] tools/xenpm: fix FreeBSD build Roger Pau Monne
2026-04-21 15:34 ` Andrew Cooper
2026-04-21 15:35 ` Jan Beulich
2026-04-21 15:51 ` Roger Pau Monné
2026-04-22 7:15 ` Jan Beulich
2026-04-22 9:16 ` Roger Pau Monné [this message]
2026-04-22 11:27 ` Anthony PERARD
2026-04-21 15:58 ` Teddy Astie
2026-04-21 16:00 ` Roger Pau Monné
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=aeiSAFy_P1QoIBaP@macbook.local \
--to=roger.pau@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--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.