#endif /* __linux__ */
-#if HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS)
+#if HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
+ (defined(__i386__) || defined(__x86_64__)) && \
+ (defined(__linux__) || defined(__FreeBSD__))
static int
virHostCPUGetMSRFromKVM(unsigned long index,
uint64_t *result)
return 0;
}
-#else
-
-static int
-virHostCPUGetMSRFromKVM(unsigned long index ATTRIBUTE_UNUSED,
- uint64_t *result ATTRIBUTE_UNUSED)
-{
- virReportSystemError(ENOSYS, "%s",
- _("Reading MSRs via KVM is not supported on this platform"));
- return -1;
-}
-#endif /* HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) */
-
-
/*
* Returns 0 on success,
* 1 when the MSR is not supported by the host CPU,
return virHostCPUGetMSRFromKVM(index, msr);
}
+
+#else
+
+int
+virHostCPUGetMSR(unsigned long index ATTRIBUTE_UNUSED,
+ uint64_t *msr ATTRIBUTE_UNUSED)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Reading MSRs is not supported on this platform"));
+ return -1;
+}
+
+#endif /* HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \
+ (defined(__i386__) || defined(__x86_64__)) && \
+ (defined(__linux__) || defined(__FreeBSD__)) */