qemu: don't iterate vcpus using priv->nvcpupids in qemuProcessSetSchedParams

This should be the last offender.
This commit is contained in:
Peter Krempa 2015-12-04 14:30:01 +01:00
parent 763941749e
commit d773b57d22
1 changed files with 6 additions and 2 deletions

View File

@ -2380,10 +2380,14 @@ qemuProcessSetSchedParams(int id,
static int
qemuProcessSetSchedulers(virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
size_t i = 0;
for (i = 0; i < priv->nvcpupids; i++) {
for (i = 0; i < virDomainDefGetVcpusMax(vm->def); i++) {
virDomainVcpuInfoPtr vcpu = virDomainDefGetVcpu(vm->def, i);
if (!vcpu->online)
continue;
if (qemuProcessSetSchedParams(i, qemuDomainGetVcpuPid(vm, i),
vm->def->cputune.nvcpusched,
vm->def->cputune.vcpusched) < 0)