static int virLXCControllerSetupCpuAffinity(virLXCControllerPtr ctrl)
{
int hostcpus, maxcpu = CPU_SETSIZE;
- virNodeInfo nodeinfo;
virBitmapPtr cpumap, cpumapToSet;
VIR_DEBUG("Setting CPU affinity");
- if (nodeGetInfo(NULL, &nodeinfo) < 0)
- return -1;
-
/* setaffinity fails if you set bits for CPUs which
* aren't present, so we have to limit ourselves */
- hostcpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
+ if ((hostcpus = nodeGetCPUCount()) < 0)
+ return -1;
+
if (maxcpu > hostcpus)
maxcpu = hostcpus;
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
- virNodeInfo nodeinfo;
virDomainDefPtr targetDef = NULL;
int ret = -1;
int maxcpu, hostcpus, vcpu, pcpu;
/* Coverity didn't realize that targetDef must be set if we got here. */
sa_assert(targetDef);
- if (nodeGetInfo(dom->conn, &nodeinfo) < 0)
+ if ((hostcpus = nodeGetCPUCount()) < 0)
goto cleanup;
- hostcpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
+
maxcpu = maplen * 8;
if (maxcpu > hostcpus)
maxcpu = hostcpus;
{
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
- virNodeInfo nodeinfo;
virDomainDefPtr targetDef = NULL;
int ret = -1;
int maxcpu, hostcpus, pcpu;
/* Coverity didn't realize that targetDef must be set if we got here. */
sa_assert(targetDef);
- if (nodeGetInfo(dom->conn, &nodeinfo) < 0)
+ if ((hostcpus = nodeGetCPUCount()) < 0)
goto cleanup;
- hostcpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
+
maxcpu = maplen * 8;
if (maxcpu > hostcpus)
maxcpu = hostcpus;
int maplen) {
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
- virNodeInfo nodeinfo;
int i, v, maxcpu, hostcpus;
int ret = -1;
qemuDomainObjPrivatePtr priv;
priv = vm->privateData;
- if (nodeGetInfo(dom->conn, &nodeinfo) < 0)
+ if ((hostcpus = nodeGetCPUCount()) < 0)
goto cleanup;
- hostcpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
maxcpu = maplen * 8;
if (maxcpu > hostcpus)
maxcpu = hostcpus;
virBitmapPtr nodemask)
{
int i, hostcpus, maxcpu = QEMUD_CPUMASK_LEN;
- virNodeInfo nodeinfo;
virBitmapPtr cpumap = NULL;
- if (nodeGetInfo(NULL, &nodeinfo) < 0)
- return NULL;
-
/* setaffinity fails if you set bits for CPUs which
* aren't present, so we have to limit ourselves */
- hostcpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
+ if ((hostcpus = nodeGetCPUCount()) < 0)
+ return NULL;
+
if (maxcpu > hostcpus)
maxcpu = hostcpus;