From d773b57d228812cfca55f58ebfa271a4f6f4a569 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 4 Dec 2015 14:30:01 +0100 Subject: [PATCH] qemu: don't iterate vcpus using priv->nvcpupids in qemuProcessSetSchedParams This should be the last offender. --- src/qemu/qemu_process.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d5b7744eb3..ee94d3f754 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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)