mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
4c64768e8f
commit
3a1cdb06fd
|
@ -18833,7 +18833,7 @@ virDomainResctrlVcpuMatch(virDomainDefPtr def,
|
||||||
* Just updating memory allocation information of that group
|
* Just updating memory allocation information of that group
|
||||||
*/
|
*/
|
||||||
if (virBitmapEqual(def->resctrls[i]->vcpus, vcpus)) {
|
if (virBitmapEqual(def->resctrls[i]->vcpus, vcpus)) {
|
||||||
*alloc = def->resctrls[i]->alloc;
|
*alloc = virObjectRef(def->resctrls[i]->alloc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (virBitmapOverlaps(def->resctrls[i]->vcpus, vcpus)) {
|
if (virBitmapOverlaps(def->resctrls[i]->vcpus, vcpus)) {
|
||||||
|
@ -19219,8 +19219,6 @@ virDomainMemorytuneDefParse(virDomainDefPtr def,
|
||||||
if (!alloc)
|
if (!alloc)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
new_alloc = true;
|
new_alloc = true;
|
||||||
} else {
|
|
||||||
alloc = virObjectRef(alloc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
|
|
Loading…
Reference in New Issue