
On Tue, Nov 24, 2015 at 08:41:53 -0500, John Ferlan wrote:
On 11/20/2015 10:22 AM, Peter Krempa wrote:
Use the proper data structures for the iteration since ncpupids will be made private later. --- src/qemu/qemu_cgroup.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index d8a2b03..06c20c1 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -800,7 +800,12 @@ qemuRestoreCgroupState(virDomainObjPtr vm) if (virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0) goto error;
- for (i = 0; i < priv->nvcpupids; i++) { + for (i = 0; i < virDomainDefGetVCpusMax(vm->def); i++) { + virDomainVCpuInfoPtr vcpu = virDomainDefGetVCpu(vm->def, i); +
What if !vcpu? Shouldn't happen, but not checked - trying to consider future too.
Actually it really can't and should not ever happen. The setters will always allocate the array fully so iterating to virDomainDefGetVCpusMax should always be valid. Peter