[libvirt] [PATCHv7 11/18] conf: move virResctrlAllocIsEmpty to a place a litter lower

Wang Huaqiang posted 18 patches 5 years, 9 months ago
[libvirt] [PATCHv7 11/18] conf: move virResctrlAllocIsEmpty to a place a litter lower
Posted by Wang Huaqiang 5 years, 9 months ago
This refactor allows to add some code between virDomainResctrlNew
and virResctrlAllocIsEmpty to extend the scope of resctrl.

Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
---
 src/conf/domain_conf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 39bd396..a068d4d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19022,15 +19022,15 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
             goto cleanup;
     }
 
+    resctrl = virDomainResctrlNew(node, &alloc, &vcpus, flags);
+    if (!resctrl)
+        goto cleanup;
+
     if (virResctrlAllocIsEmpty(alloc)) {
         ret = 0;
         goto cleanup;
     }
 
-    resctrl = virDomainResctrlNew(node, &alloc, &vcpus, flags);
-    if (!resctrl)
-        goto cleanup;
-
     if (VIR_APPEND_ELEMENT(def->resctrls, def->nresctrls, resctrl) < 0)
         goto cleanup;
 
-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv7 11/18] conf: move virResctrlAllocIsEmpty to a place a litter lower
Posted by John Ferlan 5 years, 8 months ago
$SUBJ:

s/litter/little

Perhaps better said:

conf: Alter order of Cachetune virDomainResctrlNew call

On 10/22/18 4:01 AM, Wang Huaqiang wrote:
> This refactor allows to add some code between virDomainResctrlNew
> and virResctrlAllocIsEmpty to extend the scope of resctrl.

this then becomes:

Refactor the logic to handle subsequent generation of a resource monitor
which would effect whether a non default cache exists.

> 
> Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
> ---
>  src/conf/domain_conf.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

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

John

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