virCgroupPtr cgroup_vcpu = NULL;
int ret = -1;
qemuDomainObjPrivatePtr priv;
- bool doReset = false;
size_t newVcpuPinNum = 0;
virDomainPinDefPtr *newVcpuPin = NULL;
virBitmapPtr pcpumap = NULL;
goto endjob;
}
- /* pinning to all physical cpus means resetting,
- * so check if we can reset setting.
- */
- if (virBitmapIsAllSet(pcpumap))
- doReset = true;
-
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (priv->vcpupids == NULL) {
}
}
- if (doReset) {
- virDomainPinDel(&vm->def->cputune.vcpupin,
- &vm->def->cputune.nvcpupin,
- vcpu);
- } else {
- if (vm->def->cputune.vcpupin)
- virDomainPinDefArrayFree(vm->def->cputune.vcpupin,
- vm->def->cputune.nvcpupin);
+ if (vm->def->cputune.vcpupin)
+ virDomainPinDefArrayFree(vm->def->cputune.vcpupin,
+ vm->def->cputune.nvcpupin);
- vm->def->cputune.vcpupin = newVcpuPin;
- vm->def->cputune.nvcpupin = newVcpuPinNum;
- newVcpuPin = NULL;
- }
+ vm->def->cputune.vcpupin = newVcpuPin;
+ vm->def->cputune.nvcpupin = newVcpuPinNum;
+ newVcpuPin = NULL;
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto endjob;
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
- if (doReset) {
- virDomainPinDel(&persistentDef->cputune.vcpupin,
- &persistentDef->cputune.nvcpupin,
- vcpu);
- } else {
- if (!persistentDef->cputune.vcpupin) {
- if (VIR_ALLOC(persistentDef->cputune.vcpupin) < 0)
- goto endjob;
- persistentDef->cputune.nvcpupin = 0;
- }
- if (virDomainPinAdd(&persistentDef->cputune.vcpupin,
- &persistentDef->cputune.nvcpupin,
- cpumap,
- maplen,
- vcpu) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to update or add vcpupin xml of "
- "a persistent domain"));
+ if (!persistentDef->cputune.vcpupin) {
+ if (VIR_ALLOC(persistentDef->cputune.vcpupin) < 0)
goto endjob;
- }
+ persistentDef->cputune.nvcpupin = 0;
+ }
+ if (virDomainPinAdd(&persistentDef->cputune.vcpupin,
+ &persistentDef->cputune.nvcpupin,
+ cpumap,
+ maplen,
+ vcpu) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("failed to update or add vcpupin xml of "
+ "a persistent domain"));
+ goto endjob;
}
ret = virDomainSaveConfig(cfg->configDir, persistentDef);
I<cpulist> is a list of physical CPU numbers. Its syntax is a comma
separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can
also be allowed. The '-' denotes the range and the '^' denotes exclusive.
-If you want to reset vcpupin setting, that is, to pin the I<vcpu> to all
-physical cpus, simply specify 'r' as a I<cpulist>.
+For pinning the I<vcpu> to all physical cpus specify 'r' as a I<cpulist>.
If I<--live> is specified, affect a running guest.
If I<--config> is specified, affect the next boot of a persistent guest.
If I<--current> is specified, affect the current guest state.