mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: process: Pin on per-vcpu basis instead of per-vcpupin element
Pin existing vcpus rather than existing vcpu pinning infos. This increases the complexity of the lookup, but avoids pinning cpus that are not enabled actually.
This commit is contained in:
parent
60df621f75
commit
482f4e596f
@ -2230,7 +2230,8 @@ qemuProcessSetVcpuAffinities(virDomainObjPtr vm)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
virDomainDefPtr def = vm->def;
|
||||
int vcpu, n;
|
||||
virDomainVcpuPinDefPtr pininfo;
|
||||
int n;
|
||||
int ret = -1;
|
||||
|
||||
if (!def->cputune.nvcpupin)
|
||||
@ -2242,11 +2243,15 @@ qemuProcessSetVcpuAffinities(virDomainObjPtr vm)
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->cputune.nvcpupin; n++) {
|
||||
vcpu = def->cputune.vcpupin[n]->vcpuid;
|
||||
for (n = 0; n < def->vcpus; n++) {
|
||||
/* set affinity only for existing vcpus */
|
||||
if (!(pininfo = virDomainVcpuPinFindByVcpu(def->cputune.vcpupin,
|
||||
def->cputune.nvcpupin,
|
||||
n)))
|
||||
continue;
|
||||
|
||||
if (virProcessSetAffinity(priv->vcpupids[vcpu],
|
||||
def->cputune.vcpupin[n]->cpumask) < 0) {
|
||||
if (virProcessSetAffinity(priv->vcpupids[n],
|
||||
pininfo->cpumask) < 0) {
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user