mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: don't pin all the cpus
This is another fix for the emulator-pin series. When going through the cputune pinning settings, the current code is trying to pin all the CPUs, even when not all of them are specified. This causes error in the subsequent function which, of course, cannot find the cpu to pin. Since it's enough to pass the correct VCPU ID to the function, the fix is trivial.
This commit is contained in:
parent
60efb60018
commit
9f86fb9326
@ -542,7 +542,7 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm)
|
|||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
virDomainDefPtr def = vm->def;
|
virDomainDefPtr def = vm->def;
|
||||||
int rc;
|
int rc;
|
||||||
unsigned int i;
|
unsigned int i, j;
|
||||||
unsigned long long period = vm->def->cputune.period;
|
unsigned long long period = vm->def->cputune.period;
|
||||||
long long quota = vm->def->cputune.quota;
|
long long quota = vm->def->cputune.quota;
|
||||||
|
|
||||||
@ -603,13 +603,22 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set vcpupin in cgroup if vcpupin xml is provided */
|
/* Set vcpupin in cgroup if vcpupin xml is provided */
|
||||||
if (def->cputune.nvcpupin &&
|
if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET)) {
|
||||||
qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET) &&
|
/* find the right CPU to pin, otherwise
|
||||||
qemuSetupCgroupVcpuPin(cgroup_vcpu,
|
* qemuSetupCgroupVcpuPin will fail. */
|
||||||
def->cputune.vcpupin,
|
for (j = 0; j < def->cputune.nvcpupin; j++) {
|
||||||
def->cputune.nvcpupin,
|
if (def->cputune.vcpupin[j]->vcpuid != i)
|
||||||
i) < 0)
|
continue;
|
||||||
goto cleanup;
|
|
||||||
|
if (qemuSetupCgroupVcpuPin(cgroup_vcpu,
|
||||||
|
def->cputune.vcpupin,
|
||||||
|
def->cputune.nvcpupin,
|
||||||
|
i) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virCgroupFree(&cgroup_vcpu);
|
virCgroupFree(&cgroup_vcpu);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user