[libvirt PATCH] util: Fix getting CPU frequency on Apple Silicon

Michal Prívozník mprivozn at redhat.com
Thu Feb 10 11:31:53 UTC 2022


On 2/10/22 10:08, Andrea Bolognani wrote:
> The hw.cpufrequency sysctl, which we use to obtain the CPU
> frequency on macOS, is not available when running on Apple
> Silicon, and as a consequence we currently report an error
> whenever such information is requested.
> 
> The virNodeInfo.mhz field, where the CPU frequency gets stored,
> is documented as being zero when the information could not be
> obtained, and we already do that for Linux on aarch64. Extend
> this behavior to macOS on Apple Silicon.
> 
> Signed-off-by: Andrea Bolognani <abologna at redhat.com>
> ---
>  src/util/virhostcpu.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
Reviewed-by: Michal Privoznik <mprivozn at redhat.com>

Michal




More information about the libvir-list mailing list