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

Re: [PATCH] tools/xenpm: fix FreeBSD build


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 22 Apr 2026 13:27:05 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 22 Apr 2026 11:27:14 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 22, 2026 at 11:16:48AM +0200, Roger Pau Monné wrote:
> 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.

Yeah, let's just use ENODEV on every platform in this case.

We already have ENODATA translated to ENOENT in libxl (for privcmd), so
let's not add a different translation here.

So patch looks fine to me as is:
Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

As for the error message, patch welcome ;-).

Thanks,


--
 | Vates

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

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