cpu->arch = arch;
- if (nodeGetInfo(NULL, &nodeinfo))
+ if (nodeGetInfo(&nodeinfo))
goto error;
cpu->type = VIR_CPU_TYPE_HOST;
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
return -1;
- return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ return nodeGetMemoryStats(cellNum, params, nparams, flags);
}
static int
if (virNodeGetInfoEnsureACL(conn) < 0)
return -1;
- return nodeGetInfo(NULL, nodeinfo);
+ return nodeGetInfo(nodeinfo);
}
static int
if (virNodeGetCPUMapEnsureACL(conn) < 0)
return -1;
- return nodeGetCPUMap(NULL, cpumap, online, flags);
+ return nodeGetCPUMap(cpumap, online, flags);
}
static int
# nodeinfo.h
linuxNodeGetCPUStats;
linuxNodeInfoCPUPopulate;
+linuxNodeInfoSetSysFSSystemPath;
# Let emacs know we want case-insensitive sorting
# Local Variables:
* unexpected failures. We don't want to break the lxc
* driver in this scenario, so log errors & carry on
*/
- if (nodeCapsInitNUMA(NULL, caps) < 0) {
+ if (nodeCapsInitNUMA(caps) < 0) {
virCapabilitiesFreeNUMAInfo(caps);
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
}
/* setaffinity fails if you set bits for CPUs which
* aren't present, so we have to limit ourselves */
- if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+ if ((hostcpus = nodeGetCPUCount()) < 0)
return -1;
if (maxcpu > hostcpus)
if (virNodeGetInfoEnsureACL(conn) < 0)
return -1;
- return nodeGetInfo(NULL, nodeinfo);
+ return nodeGetInfo(nodeinfo);
}
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
return -1;
- return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ return nodeGetMemoryStats(cellNum, params, nparams, flags);
}
if (virNodeGetCPUMapEnsureACL(conn) < 0)
return -1;
- return nodeGetCPUMap(NULL, cpumap, online, flags);
+ return nodeGetCPUMap(cpumap, online, flags);
}
VIR_LOG_INIT("nodeinfo");
-#define SYSFS_SYSTEM_PATH "/sys/devices/system"
#if defined(__FreeBSD__) || defined(__APPLE__)
static int
#endif /* __FreeBSD__ */
#ifdef __linux__
+# define SYSFS_SYSTEM_PATH "/sys/devices/system"
# define CPUINFO_PATH "/proc/cpuinfo"
# define PROCSTAT_PATH "/proc/stat"
# define MEMINFO_PATH "/proc/meminfo"
# define LINUX_NB_MEMORY_STATS_ALL 4
# define LINUX_NB_MEMORY_STATS_CELL 2
+static const char *sysfs_system_path = SYSFS_SYSTEM_PATH;
+
+void linuxNodeInfoSetSysFSSystemPath(const char *path)
+{
+ if (path)
+ sysfs_system_path = path;
+ else
+ sysfs_system_path = SYSFS_SYSTEM_PATH;
+}
+
/* Return the positive decimal contents of the given
* DIR/cpu%u/FILE, or -1 on error. If DEFAULT_VALUE is non-negative
* and the file could not be found, return that instead of an error;
* A valid configuration is one where no secondary thread is online;
* the primary thread in a subcore is always the first one */
static bool
-nodeHasValidSubcoreConfiguration(const char *sysfs_prefix,
- int threads_per_subcore)
+nodeHasValidSubcoreConfiguration(int threads_per_subcore)
{
virBitmapPtr online_cpus = NULL;
int cpu = -1;
if (threads_per_subcore <= 0)
goto cleanup;
- if (!(online_cpus = nodeGetOnlineCPUBitmap(sysfs_prefix)))
+ if (!(online_cpus = nodeGetOnlineCPUBitmap()))
goto cleanup;
while ((cpu = virBitmapNextSetBit(online_cpus, cpu)) >= 0) {
}
int
-linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
- FILE *cpuinfo,
+linuxNodeInfoCPUPopulate(FILE *cpuinfo,
virArch arch,
virNodeInfoPtr nodeinfo)
{
- const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
virBitmapPtr present_cpus_map = NULL;
virBitmapPtr online_cpus_map = NULL;
char line[1024];
/* Get information about what CPUs are present in the host and what
* CPUs are online, so that we don't have to so for each node */
- present_cpus_map = nodeGetPresentCPUBitmap(sysfs_prefix);
+ present_cpus_map = nodeGetPresentCPUBitmap();
if (!present_cpus_map)
goto cleanup;
- online_cpus_map = nodeGetOnlineCPUBitmap(sysfs_prefix);
+ online_cpus_map = nodeGetOnlineCPUBitmap();
if (!online_cpus_map)
goto cleanup;
/* OK, we've parsed clock speed out of /proc/cpuinfo. Get the
* core, node, socket, thread and topology information from /sys
*/
- if (virAsprintf(&sysfs_nodedir, "%s/node", prefix) < 0)
+ if (virAsprintf(&sysfs_nodedir, "%s/node", sysfs_system_path) < 0)
goto cleanup;
if (!(nodedir = opendir(sysfs_nodedir))) {
/* If the subcore configuration is not valid, just pretend subcores
* are not in use and count threads one by one */
- if (!nodeHasValidSubcoreConfiguration(sysfs_prefix, threads_per_subcore))
+ if (!nodeHasValidSubcoreConfiguration(threads_per_subcore))
threads_per_subcore = 0;
while ((direrr = virDirRead(nodedir, &nodedirent, sysfs_nodedir)) > 0) {
nodeinfo->nodes++;
if (virAsprintf(&sysfs_cpudir, "%s/node/%s",
- prefix, nodedirent->d_name) < 0)
+ sysfs_system_path, nodedirent->d_name) < 0)
goto cleanup;
if ((cpus = virNodeParseNode(sysfs_cpudir, arch,
fallback:
VIR_FREE(sysfs_cpudir);
- if (virAsprintf(&sysfs_cpudir, "%s/cpu", prefix) < 0)
+ if (virAsprintf(&sysfs_cpudir, "%s/cpu", sysfs_system_path) < 0)
goto cleanup;
if ((cpus = virNodeParseNode(sysfs_cpudir, arch,
}
static char *
-linuxGetCPUGlobalPath(const char *sysfs_prefix,
- const char *file)
+linuxGetCPUGlobalPath(const char *file)
{
- const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
char *path = NULL;
- if (virAsprintf(&path, "%s/cpu/%s", prefix, file) < 0)
+ if (virAsprintf(&path, "%s/cpu/%s", sysfs_system_path, file) < 0)
return NULL;
return path;
}
static char *
-linuxGetCPUPresentPath(const char *sysfs_prefix)
+linuxGetCPUPresentPath(void)
{
- return linuxGetCPUGlobalPath(sysfs_prefix, "present");
+ return linuxGetCPUGlobalPath("present");
}
static char *
-linuxGetCPUOnlinePath(const char *sysfs_prefix)
+linuxGetCPUOnlinePath(void)
{
- return linuxGetCPUGlobalPath(sysfs_prefix, "online");
+ return linuxGetCPUGlobalPath("online");
}
/* Determine the number of CPUs (maximum CPU id + 1) from a file containing
#endif
int
-nodeGetInfo(const char *sysfs_prefix ATTRIBUTE_UNUSED,
- virNodeInfoPtr nodeinfo)
+nodeGetInfo(virNodeInfoPtr nodeinfo)
{
virArch hostarch = virArchFromHost();
return -1;
}
- ret = linuxNodeInfoCPUPopulate(sysfs_prefix, cpuinfo,
- hostarch, nodeinfo);
+ ret = linuxNodeInfoCPUPopulate(cpuinfo, hostarch, nodeinfo);
if (ret < 0)
goto cleanup;
}
int
-nodeGetMemoryStats(const char *sysfs_prefix ATTRIBUTE_UNUSED,
- int cellNum ATTRIBUTE_UNUSED,
+nodeGetMemoryStats(int cellNum ATTRIBUTE_UNUSED,
virNodeMemoryStatsPtr params ATTRIBUTE_UNUSED,
int *nparams ATTRIBUTE_UNUSED,
unsigned int flags)
#ifdef __linux__
{
int ret;
- const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
char *meminfo_path = NULL;
FILE *meminfo;
int max_node;
return -1;
}
- if (virAsprintf(&meminfo_path, "%s/node/node%d/meminfo",
- prefix, cellNum) < 0)
+ if (virAsprintf(&meminfo_path,
+ SYSFS_SYSTEM_PATH "/node/node%d/meminfo",
+ cellNum) < 0)
return -1;
}
meminfo = fopen(meminfo_path, "r");
}
int
-nodeGetCPUCount(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+nodeGetCPUCount(void)
{
#if defined(__linux__)
/* To support older kernels that lack cpu/present, such as 2.6.18
* will be consecutive.
*/
char *present_path = NULL;
- const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
char *cpupath = NULL;
int ncpu = -1;
- if (!(present_path = linuxGetCPUPresentPath(sysfs_prefix)))
+ if (!(present_path = linuxGetCPUPresentPath()))
return -1;
if (virFileExists(present_path)) {
goto cleanup;
}
- if (virAsprintf(&cpupath, "%s/cpu/cpu0", prefix) < 0)
+ if (virAsprintf(&cpupath, "%s/cpu/cpu0", sysfs_system_path) < 0)
goto cleanup;
if (virFileExists(cpupath)) {
ncpu = 0;
ncpu++;
VIR_FREE(cpupath);
if (virAsprintf(&cpupath, "%s/cpu/cpu%d",
- prefix, ncpu) < 0) {
+ sysfs_system_path, ncpu) < 0) {
ncpu = -1;
goto cleanup;
}
}
virBitmapPtr
-nodeGetPresentCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+nodeGetPresentCPUBitmap(void)
{
#ifdef __linux__
virBitmapPtr present_cpus = NULL;
char *present_path = NULL;
int npresent_cpus;
- if ((npresent_cpus = nodeGetCPUCount(sysfs_prefix)) < 0)
+ if ((npresent_cpus = nodeGetCPUCount()) < 0)
goto cleanup;
- if (!(present_path = linuxGetCPUPresentPath(sysfs_prefix)))
+ if (!(present_path = linuxGetCPUPresentPath()))
goto cleanup;
/* If the cpu/present file is available, parse it and exit */
}
virBitmapPtr
-nodeGetOnlineCPUBitmap(const char *sysfs_prefix ATTRIBUTE_UNUSED)
+nodeGetOnlineCPUBitmap(void)
{
#ifdef __linux__
- const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
char *online_path = NULL;
char *cpudir = NULL;
virBitmapPtr cpumap;
int present;
- present = nodeGetCPUCount(sysfs_prefix);
+ present = nodeGetCPUCount();
if (present < 0)
return NULL;
- if (!(online_path = linuxGetCPUOnlinePath(sysfs_prefix)))
+ if (!(online_path = linuxGetCPUOnlinePath()))
return NULL;
if (virFileExists(online_path)) {
cpumap = linuxParseCPUmap(present, online_path);
if (!cpumap)
goto cleanup;
- if (virAsprintf(&cpudir, "%s/cpu", prefix) < 0)
+ if (virAsprintf(&cpudir, "%s/cpu", sysfs_system_path) < 0)
goto cleanup;
for (i = 0; i < present; i++) {
}
int
-nodeGetCPUMap(const char *sysfs_prefix,
- unsigned char **cpumap,
+nodeGetCPUMap(unsigned char **cpumap,
unsigned int *online,
unsigned int flags)
{
virCheckFlags(0, -1);
if (!cpumap && !online)
- return nodeGetCPUCount(sysfs_prefix);
+ return nodeGetCPUCount();
- if (!(cpus = nodeGetOnlineCPUBitmap(sysfs_prefix)))
+ if (!(cpus = nodeGetOnlineCPUBitmap()))
goto cleanup;
if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
}
static int
-nodeCapsInitNUMAFake(const char *sysfs_prefix,
- const char *cpupath ATTRIBUTE_UNUSED,
+nodeCapsInitNUMAFake(const char *cpupath ATTRIBUTE_UNUSED,
virCapsPtr caps ATTRIBUTE_UNUSED)
{
virNodeInfo nodeinfo;
int id, cid;
int onlinecpus ATTRIBUTE_UNUSED;
- if (nodeGetInfo(sysfs_prefix, &nodeinfo) < 0)
+ if (nodeGetInfo(&nodeinfo) < 0)
return -1;
ncpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
}
int
-nodeCapsInitNUMA(const char *sysfs_prefix,
- virCapsPtr caps)
+nodeCapsInitNUMA(virCapsPtr caps)
{
- const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
- char *cpupath;
int n;
unsigned long long memory;
virCapsHostNUMACellCPUPtr cpus = NULL;
bool topology_failed = false;
int max_node;
- if (virAsprintf(&cpupath, "%s/cpu", prefix) < 0)
- return -1;
-
if (!virNumaIsAvailable()) {
- ret = nodeCapsInitNUMAFake(sysfs_prefix, cpupath, caps);
+ ret = nodeCapsInitNUMAFake(SYSFS_SYSTEM_PATH "/cpu", caps);
goto cleanup;
}
for (i = 0; i < virBitmapSize(cpumap); i++) {
if (virBitmapIsBitSet(cpumap, i)) {
- if (virNodeCapsFillCPUInfo(cpupath, i, cpus + cpu++) < 0) {
+ if (virNodeCapsFillCPUInfo(SYSFS_SYSTEM_PATH "/cpu",
+ i, cpus + cpu++) < 0) {
topology_failed = true;
virResetLastError();
}
VIR_FREE(cpus);
VIR_FREE(siblings);
VIR_FREE(pageinfo);
- VIR_FREE(cpupath);
return ret;
}
# include "capabilities.h"
-int nodeGetInfo(const char *sysfs_prefix, virNodeInfoPtr nodeinfo);
-int nodeCapsInitNUMA(const char *sysfs_prefix, virCapsPtr caps);
+int nodeGetInfo(virNodeInfoPtr nodeinfo);
+int nodeCapsInitNUMA(virCapsPtr caps);
int nodeGetCPUStats(int cpuNum,
virNodeCPUStatsPtr params,
int *nparams,
unsigned int flags);
-int nodeGetMemoryStats(const char *sysfs_prefix,
- int cellNum,
+int nodeGetMemoryStats(int cellNum,
virNodeMemoryStatsPtr params,
int *nparams,
unsigned int flags);
int nodeGetMemory(unsigned long long *mem,
unsigned long long *freeMem);
-virBitmapPtr nodeGetPresentCPUBitmap(const char *sysfs_prefix);
-virBitmapPtr nodeGetOnlineCPUBitmap(const char *sysfs_prefix);
-int nodeGetCPUCount(const char *sysfs_prefix);
+virBitmapPtr nodeGetPresentCPUBitmap(void);
+virBitmapPtr nodeGetOnlineCPUBitmap(void);
+int nodeGetCPUCount(void);
int nodeGetThreadsPerSubcore(virArch arch);
int nodeGetMemoryParameters(virTypedParameterPtr params,
int nparams,
unsigned int flags);
-int nodeGetCPUMap(const char *sysfs_prefix,
- unsigned char **cpumap,
+int nodeGetCPUMap(unsigned char **cpumap,
unsigned int *online,
unsigned int flags);
# include "nodeinfo.h"
# ifdef __linux__
-int linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
- FILE *cpuinfo,
+void linuxNodeInfoSetSysFSSystemPath(const char *path);
+
+int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
virArch arch,
virNodeInfoPtr nodeinfo);
false, false)) == NULL)
goto no_memory;
- if (nodeCapsInitNUMA(NULL, caps) < 0)
+ if (nodeCapsInitNUMA(caps) < 0)
goto no_memory;
if ((guest = virCapabilitiesAddGuest(caps,
{
virNodeInfo nodeinfo;
- if (nodeGetInfo(NULL, &nodeinfo) < 0)
+ if (nodeGetInfo(&nodeinfo) < 0)
return 0;
return nodeinfo.cpus;
openvzNodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
virNodeInfoPtr nodeinfo)
{
- return nodeGetInfo(NULL, nodeinfo);
+ return nodeGetInfo(nodeinfo);
}
int *nparams,
unsigned int flags)
{
- return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ return nodeGetMemoryStats(cellNum, params, nparams, flags);
}
unsigned int *online,
unsigned int flags)
{
- return nodeGetCPUMap(NULL, cpumap, online, flags);
+ return nodeGetCPUMap(cpumap, online, flags);
}
* unexpected failures. We don't want to break the QEMU
* driver in this scenario, so log errors & carry on
*/
- if (nodeCapsInitNUMA(NULL, caps) < 0) {
+ if (nodeCapsInitNUMA(caps) < 0) {
virCapabilitiesFreeNUMAInfo(caps);
VIR_WARN
("Failed to query host NUMA topology, disabling NUMA capabilities");
cpu->arch = arch;
- if (nodeGetInfo(NULL, &nodeinfo))
+ if (nodeGetInfo(&nodeinfo))
goto error;
cpu->type = VIR_CPU_TYPE_HOST;
* unexpected failures. We don't want to break the QEMU
* driver in this scenario, so log errors & carry on
*/
- if (nodeCapsInitNUMA(NULL, caps) < 0) {
+ if (nodeCapsInitNUMA(caps) < 0) {
virCapabilitiesFreeNUMAInfo(caps);
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
}
priv = vm->privateData;
ret = virDomainDefGetVcpuPinInfoHelper(def, maplen, ncpumaps, cpumaps,
- nodeGetCPUCount(NULL),
+ nodeGetCPUCount(),
priv->autoCpuset);
cleanup:
virDomainObjEndAPI(&vm);
if (!(def = virDomainObjGetOneDef(vm, flags)))
goto cleanup;
- if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+ if ((hostcpus = nodeGetCPUCount()) < 0)
goto cleanup;
priv = vm->privateData;
if (targetDef->niothreadids == 0)
return 0;
- if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+ if ((hostcpus = nodeGetCPUCount()) < 0)
goto cleanup;
if (VIR_ALLOC_N(info_ret, targetDef->niothreadids) < 0)
if (virNodeGetInfoEnsureACL(conn) < 0)
return -1;
- return nodeGetInfo(NULL, nodeinfo);
+ return nodeGetInfo(nodeinfo);
}
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
return -1;
- return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ return nodeGetMemoryStats(cellNum, params, nparams, flags);
}
if (virNodeGetCPUMapEnsureACL(conn) < 0)
return -1;
- return nodeGetCPUMap(NULL, cpumap, online, flags);
+ return nodeGetCPUMap(cpumap, online, flags);
}
/* setaffinity fails if you set bits for CPUs which
* aren't present, so we have to limit ourselves */
- if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+ if ((hostcpus = nodeGetCPUCount()) < 0)
goto cleanup;
if (hostcpus > QEMUD_CPUMASK_LEN)
* unexpected failures. We don't want to break the QEMU
* driver in this scenario, so log errors & carry on
*/
- if (nodeCapsInitNUMA(NULL, caps) < 0) {
+ if (nodeCapsInitNUMA(caps) < 0) {
virCapabilitiesFreeNUMAInfo(caps);
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
}
if (virNodeGetInfoEnsureACL(conn) < 0)
return -1;
- return nodeGetInfo(NULL, nodeinfo);
+ return nodeGetInfo(nodeinfo);
}
if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
return -1;
- return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ return nodeGetMemoryStats(cellNum, params, nparams, flags);
}
if (virNodeGetCPUMapEnsureACL(conn) < 0)
return -1;
- return nodeGetCPUMap(NULL, cpumap, online, flags);
+ return nodeGetCPUMap(cpumap, online, flags);
}
}
/* To parse account file, we need to know how many cpus are present. */
- if (!(cpumap = nodeGetPresentCPUBitmap(NULL)))
+ if (!(cpumap = nodeGetPresentCPUBitmap()))
return -1;
total_cpus = virBitmapSize(cpumap);
false, false)) == NULL)
goto no_memory;
- if (nodeCapsInitNUMA(NULL, caps) < 0)
+ if (nodeCapsInitNUMA(caps) < 0)
goto no_memory;
if ((guest = virCapabilitiesAddGuest(caps,
vboxNodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
virNodeInfoPtr nodeinfo)
{
- return nodeGetInfo(NULL, nodeinfo);
+ return nodeGetInfo(nodeinfo);
}
static int
false, false)) == NULL)
goto error;
- if (nodeCapsInitNUMA(NULL, caps) < 0)
+ if (nodeCapsInitNUMA(caps) < 0)
goto error;
/* i686 guests are always supported */
false, false)) == NULL)
return NULL;
- if (nodeCapsInitNUMA(NULL, caps) < 0)
+ if (nodeCapsInitNUMA(caps) < 0)
goto error;
for (i = 0; i < 2; i++)
emulators[k], virt_types[k]) < 0)
goto error;
- if (nodeGetInfo(NULL, &nodeinfo))
+ if (nodeGetInfo(&nodeinfo))
goto error;
if (VIR_ALLOC(cpu) < 0)
vzNodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
virNodeInfoPtr nodeinfo)
{
- return nodeGetInfo(NULL, nodeinfo);
+ return nodeGetInfo(nodeinfo);
}
static int vzConnectIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED)
unsigned int *online,
unsigned int flags)
{
- return nodeGetCPUMap(NULL, cpumap, online, flags);
+ return nodeGetCPUMap(cpumap, online, flags);
}
static int
int *nparams,
unsigned int flags)
{
- return nodeGetMemoryStats(NULL, cellNum, params, nparams, flags);
+ return nodeGetMemoryStats(cellNum, params, nparams, flags);
}
static int
PRL_RESULT pret;
int ret = -1;
- if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
+ if ((hostcpus = nodeGetCPUCount()) < 0)
goto cleanup;
/* get number of CPUs */
#else
static int
-linuxTestCompareFiles(char *sysfs_prefix,
- const char *cpuinfofile,
+linuxTestCompareFiles(const char *cpuinfofile,
virArch arch,
const char *outputfile)
{
}
memset(&nodeinfo, 0, sizeof(nodeinfo));
- if (linuxNodeInfoCPUPopulate(sysfs_prefix, cpuinfo, arch, &nodeinfo) < 0) {
+ if (linuxNodeInfoCPUPopulate(cpuinfo, arch, &nodeinfo) < 0) {
if (virTestGetDebug()) {
if (virGetLastError())
VIR_TEST_DEBUG("\n%s\n", virGetLastErrorMessage());
goto cleanup;
}
- result = linuxTestCompareFiles(sysfs_prefix, cpuinfo, data->arch, output);
+ linuxNodeInfoSetSysFSSystemPath(sysfs_prefix);
+ result = linuxTestCompareFiles(cpuinfo, data->arch, output);
+ linuxNodeInfoSetSysFSSystemPath(NULL);
cleanup:
VIR_FREE(cpuinfo);
goto cleanup;
}
- if (nodeGetCPUCount(NULL) != EXPECTED_NCPUS) {
- fprintf(stderr, "Unexpected: nodeGetCPUCount() yields: %d\n", nodeGetCPUCount(NULL));
+ if (nodeGetCPUCount() != EXPECTED_NCPUS) {
+ fprintf(stderr, "Unexpected: nodeGetCPUCount() yields: %d\n", nodeGetCPUCount());
goto cleanup;
}