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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 21 Apr 2026 17:51:35 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TpZknm63C3UCr1JhTs56RiX4HA+vYrjymingqcNFx6Y=; b=nIZizQ/G0CuFoWk80EUBLKazBdGDQzJGdqp02gPHdmGrEJNqBaL5Avdp12lC4muQQAHDeRs17t31gwf0zQD6LEnHBZ1dvF393xXZGl/cpmVhQ1MIlWPOLRH6O7Ie5Z9H6AkI6X5wScgbElDh9dEgA1ISvZigpnWWbiy7joAKa+cAqcbit+LaV8QlXnzmrT08Oo1TR1hBfvng2A5dr93VV+02Ruzw4NvCMUTyqO43oJtfyMHCYQ25xPG0unFOnNqR6NiX3mVhl7Po1kOwc2T4bqmukjUvd9byDfMDRqrYPzgVUiTIqAfNurNecgSacFjxQskRwlAazSc712aWZ99lEw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KPtlFWinBpdKFTI8bQVNXc8BMskr14bVh6oKKyvmE0YTxo3rvQtmwPGooAVyvEGbOgoWoHhSf2MPeuthq8TY3vq1k3o6WFC0lVe1RC7DV3mjAc6r9LXj8FSGsgDXmdL8cE2FNN9L57cR/0mguo8ClZWf+N+9Rf0eXzeLtwwUmjYEM8Juqe99SWU+0KUIR5I+VdtRlqCavETPRaK+ClpoOyFvn2GZdAWJHhztnnbBWwTR0ZzBQ7RrDkqCYRHkQRofY4bwNskZleq4iANTg+vvqETl0V2l4y6b7Pgbl4R7oTXKzs1v+GCDmbJ0JGcPxAucZeJhqQIDSRt9ae+a1GQBxw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 21 Apr 2026 15:51:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.



 


Rackspace

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