[libvirt] [PATCH] conf: Fix bug in finding alloc through matching vcpus

Wang Huaqiang posted 1 patch 5 years, 6 months ago
Failed in applying to current master (apply log)
src/conf/domain_conf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[libvirt] [PATCH] conf: Fix bug in finding alloc through matching vcpus
Posted by Wang Huaqiang 5 years, 6 months ago
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>
---
 src/conf/domain_conf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cad84b9..eb73eaf 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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)) {
@@ -19224,8 +19224,6 @@ virDomainMemorytuneDefParse(virDomainDefPtr def,
         if (!alloc)
             goto cleanup;
         new_alloc = true;
-    } else {
-        alloc = virObjectRef(alloc);
     }
 
     for (i = 0; i < n; i++) {
-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] conf: Fix bug in finding alloc through matching vcpus
Posted by John Ferlan 5 years, 6 months ago

On 10/12/18 6:24 AM, Wang Huaqiang wrote:
> 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>
> ---
>  src/conf/domain_conf.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

(and pushed)

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list