1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-20 09:58:15 +03:00

conf: Fix bug in finding alloc through matching vcpus

The @alloc object returned by virDomainResctrlVcpuMatch is not
properly referenced and un-referenced in virDomainCachetuneDefParse.

This patch fixes this problem.

Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Wang Huaqiang 2018-10-12 18:24:54 +08:00 committed by John Ferlan
parent 4c64768e8f
commit 3a1cdb06fd

View File

@ -18833,7 +18833,7 @@ virDomainResctrlVcpuMatch(virDomainDefPtr def,
* Just updating memory allocation information of that group
*/
if (virBitmapEqual(def->resctrls[i]->vcpus, vcpus)) {
*alloc = def->resctrls[i]->alloc;
*alloc = virObjectRef(def->resctrls[i]->alloc);
break;
}
if (virBitmapOverlaps(def->resctrls[i]->vcpus, vcpus)) {
@ -19219,8 +19219,6 @@ virDomainMemorytuneDefParse(virDomainDefPtr def,
if (!alloc)
goto cleanup;
new_alloc = true;
} else {
alloc = virObjectRef(alloc);
}
for (i = 0; i < n; i++) {