]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: fix redundant/misleading build conditional for KVM MSR code
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 24 Nov 2025 13:50:22 +0000 (13:50 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 27 Nov 2025 12:54:09 +0000 (12:54 +0000)
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 <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virhostcpu.c

index c3b4f87de1bd582475d5550150ff6791cb79fc87..09395ddb04b4a258fec5f5829cc30140f6388ea9 100644 (file)
@@ -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,