|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] tools/xenpm: fix FreeBSD build
On Tue, Apr 21, 2026 at 05:35:57PM +0200, Jan Beulich wrote:
> On 21.04.2026 17:32, Roger Pau Monne wrote:
> > ENODATA is not defined on FreeBSD:
> >
> > xenpm.c:1380:17: error: use of undeclared identifier 'ENODATA'
> > 1380 | errno = ENODATA;
> > | ^
> > 1 error generated.
> >
> > Fixes: edb657887a60 ("xenpm: Add get-core-temp subcommand")
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> > tools/misc/xenpm.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
> > index 87107bd6c617..ecb39c911d84 100644
> > --- 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. 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.
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.
Thanks, Roger.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |