提交 a02a161b 编写于 作者: P Peter Krempa

qemu: libxl: vcpupin: Don't reset pinning when pinning to all pcpus

In the pre-NUMA ages pinning a vCPU to all pCPUs was eaqual to deleting
the pinning info. Now it does not entirely work that way. Pinning a vCPU
to all pCPUs might be a desired operation. Additionally removal of the
pinning will result into using the default pinning information at the
next boot which might be different from all vcpus.

This patch removes the false assumption that we should remove the
pinning after pinning to all vCPUs and tweaks the documentation for
virsh.

A later patch will implement a new flag for the virDomainPinVcpuFlags
API that will allow to remove the pinning in a sane way.
上级 efaa7197
......@@ -2246,14 +2246,6 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
}
}
/* full bitmap means reset the settings (if any). */
if (virBitmapIsAllSet(pcpumap)) {
virDomainPinDel(&targetDef->cputune.vcpupin,
&targetDef->cputune.nvcpupin,
vcpu);
goto done;
}
if (!targetDef->cputune.vcpupin) {
if (VIR_ALLOC(targetDef->cputune.vcpupin) < 0)
goto endjob;
......@@ -2269,7 +2261,6 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
goto endjob;
}
done:
ret = 0;
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
......
......@@ -5033,7 +5033,6 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
virCgroupPtr cgroup_vcpu = NULL;
int ret = -1;
qemuDomainObjPrivatePtr priv;
bool doReset = false;
size_t newVcpuPinNum = 0;
virDomainPinDefPtr *newVcpuPin = NULL;
virBitmapPtr pcpumap = NULL;
......@@ -5092,12 +5091,6 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
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) {
......@@ -5146,11 +5139,6 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
}
}
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);
......@@ -5158,7 +5146,6 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
vm->def->cputune.vcpupin = newVcpuPin;
vm->def->cputune.nvcpupin = newVcpuPinNum;
newVcpuPin = NULL;
}
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto endjob;
......@@ -5178,11 +5165,6 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
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;
......@@ -5198,7 +5180,6 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
"a persistent domain"));
goto endjob;
}
}
ret = virDomainSaveConfig(cfg->configDir, persistentDef);
goto endjob;
......
......@@ -2365,8 +2365,7 @@ I<vcpu> or omit I<vcpu> to list all at once.
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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册