int maplen)
{
parallelsConnPtr privconn = domain->conn->privateData;
- parallelsDomObjPtr privdomdata = NULL;
virDomainObjPtr privdom = NULL;
size_t i;
int v, maxcpu, hostcpus;
goto cleanup;
}
- privdomdata = privdom->privateData;
if ((hostcpus = nodeGetCPUCount()) < 0)
goto cleanup;
int tmpmapLen = 0;
memset(cpumaps, 0, maplen * maxinfo);
- virBitmapToData(privdomdata->cpumask, &tmpmap, &tmpmapLen);
+ virBitmapToData(privdom->def->cpumask, &tmpmap, &tmpmapLen);
if (tmpmapLen > maplen)
tmpmapLen = maplen;
return;
PrlHandle_Free(pdom->sdkdom);
- virBitmapFree(pdom->cpumask);
VIR_FREE(pdom->uuid);
VIR_FREE(pdom->home);
VIR_FREE(p);
static int
prlsdkConvertCpuInfo(PRL_HANDLE sdkdom,
- virDomainDefPtr def,
- parallelsDomObjPtr pdom)
+ virDomainDefPtr def)
{
char *buf;
PRL_UINT32 buflen = 0;
pret = PrlVmCfg_GetCpuMask(sdkdom, buf, &buflen);
if (strlen(buf) == 0) {
- if (!(pdom->cpumask = virBitmapNew(hostcpus)))
+ if (!(def->cpumask = virBitmapNew(hostcpus)))
goto cleanup;
- virBitmapSetAll(pdom->cpumask);
+ virBitmapSetAll(def->cpumask);
} else {
- if (virBitmapParse(buf, 0, &pdom->cpumask, hostcpus) < 0)
+ if (virBitmapParse(buf, 0, &def->cpumask, hostcpus) < 0)
goto cleanup;
}
convert to Kbytes */
def->mem.cur_balloon = def->mem.max_balloon;
- if (prlsdkConvertCpuInfo(sdkdom, def, pdom) < 0)
+ if (prlsdkConvertCpuInfo(sdkdom, def) < 0)
goto error;
if (prlsdkConvertCpuMode(sdkdom, def) < 0)
return -1;
}
- if (def->cpumask != NULL) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("changing cpu mask is not supported "
- "by parallels driver"));
- return -1;
- }
-
if (def->cputune.shares ||
def->cputune.sharesSpecified ||
def->cputune.period ||
size_t i;
char uuidstr[VIR_UUID_STRING_BUFLEN + 2];
bool needBoot = true;
+ char *mask = NULL;
if (prlsdkCheckUnsupportedParams(sdkdom, def) < 0)
return -1;
pret = PrlVmCfg_SetCpuCount(sdkdom, def->vcpus);
prlsdkCheckRetGoto(pret, error);
+ if (!(mask = virBitmapFormat(def->cpumask)))
+ goto error;
+
+ pret = PrlVmCfg_SetCpuMask(sdkdom, mask);
+ prlsdkCheckRetGoto(pret, error);
+ VIR_FREE(mask);
+
if (prlsdkClearDevices(sdkdom) < 0)
goto error;
return 0;
error:
- return -1;
+ VIR_FREE(mask);
+
+ return -1;
}
int