[libvirt] [PATCH] util: Expose virHostCPUStatsAssign on non-Linux

Martin Kletzander mkletzan at redhat.com
Fri Sep 16 06:43:52 UTC 2016


There is nothing Linux-specific in that function.  Also since commit
8c3b5bf48123783b812b97360db7ac51f1889e17 mingw build is broken due to
the fact that this function is not compiled in the library.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
Pushed as trivial build-breaker fix.

 src/util/virhostcpu.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 856d83c3e49b..f68176f387ec 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -781,21 +781,6 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
     return ret;
 }

-int
-virHostCPUStatsAssign(virNodeCPUStatsPtr param,
-                      const char *name,
-                      unsigned long long value)
-{
-    if (virStrcpyStatic(param->field, name) == NULL) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("kernel cpu time field is too long"
-                               " for the destination"));
-        return -1;
-    }
-    param->value = value;
-    return 0;
-}
-
 # define TICK_TO_NSEC (1000ull * 1000ull * 1000ull / sysconf(_SC_CLK_TCK))

 int
@@ -953,6 +938,22 @@ virHostCPUParseMapLinux(int max_cpuid, const char *path)


 int
+virHostCPUStatsAssign(virNodeCPUStatsPtr param,
+                      const char *name,
+                      unsigned long long value)
+{
+    if (virStrcpyStatic(param->field, name) == NULL) {
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       "%s", _("kernel cpu time field is too long"
+                               " for the destination"));
+        return -1;
+    }
+    param->value = value;
+    return 0;
+}
+
+
+int
 virHostCPUGetInfo(virArch hostarch ATTRIBUTE_UNUSED,
                   unsigned int *cpus ATTRIBUTE_UNUSED,
                   unsigned int *mhz ATTRIBUTE_UNUSED,
--
2.10.0




More information about the libvir-list mailing list