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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 22 Apr 2026 11:16:48 +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=0g+DKLwwSWmGv/p05bqXC3pdcOBiysUhfepuiPPNkAA=; b=qzNKR9W5MPKg8UvdhtuWW2V2eYZ6VoOR6BhtaF4fgZwhUrrJah5XcS4ezIlG//RYgfU8vfpUN6QAs/XGT+nwKTB93pi4VxJ05ZtZeWnWmRy5GJiyfzIpAR6M3buu0yuWlxS7SJYPXHqFxp08zjaXxxKwGGrIY0GmPYmsPISajqserK2+ZoxOnD+Ek16hN+6bxjbaqqbwWwo7rj2MGB09Ycur1+yAQ8zz6wOnSxYUPhupjt7AJfXSwb1w3DL9yY6WqeULoXvmSh2bMVm55ObXGVeEe14045jXkiaDFPHViHUDbsiZo9Ils/v/eZqw/xg4T/KI3tB3AT5jtVPzpyzZSg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z7tCRNbIc4yTh4Nd8f4C2fDU7EHyfci1aU9XNI5TmqgVuTtfN/ZziwEqrS+YJhSjV2wiBj0C/jSNi/iX+TzSVLd2pf4ct0TnLZ4EWKw/ur6dtu8Deo/bsIuezCxFv3TSyOIfCg9jO4cpNb3dLjcWbbMEyE9lkpqw/u3mNrkbdAXxBwrjak+WeKcuSYXCpPqsDzYBclRaxhWUFZMsHE2eln/KGXs4ImPelUQYWMHfA1eQ38FKulIWjnDRWlq6S9GTqbVZr07YpbIT5sQ87STyQm9jtjkzdRj3RpBNLK1RkmhPBVfo70Xvj5GDBz5sxTC3kg6SiSOTW9OHJYTUZdj6fw==
  • 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: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 22 Apr 2026 09:17:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.



 


Rackspace

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