if (virNodeGetCPUMapEnsureACL(conn) < 0)
return -1;
- return nodeGetCPUMap(cpumap, online, flags);
+ return nodeGetCPUMap(NULL, cpumap, online, flags);
}
static int
if (virNodeGetCPUMapEnsureACL(conn) < 0)
return -1;
- return nodeGetCPUMap(cpumap, online, flags);
+ return nodeGetCPUMap(NULL, cpumap, online, flags);
}
}
int
-nodeGetCPUMap(unsigned char **cpumap,
+nodeGetCPUMap(const char *sysfs_prefix,
+ unsigned char **cpumap,
unsigned int *online,
unsigned int flags)
{
+ const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
virBitmapPtr cpus = NULL;
int maxpresent;
int ret = -1;
virCheckFlags(0, -1);
if (!cpumap && !online)
- return nodeGetCPUCount(NULL);
+ return nodeGetCPUCount(prefix);
- if (!(cpus = nodeGetCPUBitmap(NULL, &maxpresent)))
+ if (!(cpus = nodeGetCPUBitmap(prefix, &maxpresent)))
goto cleanup;
if (cpumap && virBitmapToData(cpus, cpumap, &dummy) < 0)
int nparams,
unsigned int flags);
-int nodeGetCPUMap(unsigned char **cpumap,
+int nodeGetCPUMap(const char *sysfs_prefix,
+ unsigned char **cpumap,
unsigned int *online,
unsigned int flags);
unsigned int *online,
unsigned int flags)
{
- return nodeGetCPUMap(cpumap, online, flags);
+ return nodeGetCPUMap(NULL, cpumap, online, flags);
}
if (virNodeGetCPUMapEnsureACL(conn) < 0)
return -1;
- return nodeGetCPUMap(cpumap, online, flags);
+ return nodeGetCPUMap(NULL, cpumap, online, flags);
}
if (virNodeGetCPUMapEnsureACL(conn) < 0)
return -1;
- return nodeGetCPUMap(cpumap, online, flags);
+ return nodeGetCPUMap(NULL, cpumap, online, flags);
}
unsigned int *online,
unsigned int flags)
{
- return nodeGetCPUMap(cpumap, online, flags);
+ return nodeGetCPUMap(NULL, cpumap, online, flags);
}
static int