From: Daniel P. Berrangé Date: Mon, 24 Nov 2025 13:50:22 +0000 (+0000) Subject: src: fix redundant/misleading build conditional for KVM MSR code X-Git-Tag: v11.10.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df0d1c915d0fc47c4666dc57110531ee4a521e99;p=thirdparty%2Flibvirt.git src: fix redundant/misleading build conditional for KVM MSR code The condition WITH_LINUX_KVM_H && (defined(__linux__) || defined(__FreeBSD__)) is redundant. If the meson check for linux/kvm.h succeeded, we must be on a Linux host and cannot be on a FreeBSD host. Remove these redundant OS conditions from the MSR code to stop misleading readers. Reviewed-by: Peter Krempa Signed-off-by: Daniel P. Berrangé --- diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index c3b4f87de1..09395ddb04 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -1328,8 +1328,7 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UNUSED) #if WITH_LINUX_KVM_H && defined(KVM_GET_MSRS) && \ - (defined(__i386__) || defined(__x86_64__)) && \ - (defined(__linux__) || defined(__FreeBSD__)) + (defined(__i386__) || defined(__x86_64__)) static int virHostCPUGetMSRFromKVM(unsigned long index, uint64_t *result) @@ -1585,8 +1584,7 @@ virHostCPUGetTscInfo(void) } #endif /* WITH_LINUX_KVM_H && defined(KVM_GET_MSRS) && \ - (defined(__i386__) || defined(__x86_64__)) && \ - (defined(__linux__) || defined(__FreeBSD__)) */ + (defined(__i386__) || defined(__x86_64__)) */ int virHostCPUReadSignature(virArch arch,