提交 b51e26f7 编写于 作者: M Martin Kletzander

util: Expose virHostCPUStatsAssign on non-Linux

There is nothing Linux-specific in that function.  Also since commit
8c3b5bf4 mingw build is broken due to
the fact that this function is not compiled in the library.
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 d18c7d71
......@@ -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
......@@ -952,6 +937,22 @@ virHostCPUParseMapLinux(int max_cpuid, const char *path)
#endif
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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册