Re: [PATCH 01/36] util: virresctrl: convert classes to GObject

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 03, 2020 at 17:15:29 +0200, Rafael Fonseca wrote:
> Signed-off-by: Rafael Fonseca <r4f4rfs@xxxxxxxxx>
> ---
>  src/conf/capabilities.c |   3 +-
>  src/conf/domain_conf.c  |  21 +++---
>  src/util/virresctrl.c   | 137 ++++++++++++++++++++++------------------
>  src/util/virresctrl.h   |  15 +++--
>  tests/virresctrltest.c  |   3 +-
>  5 files changed, 97 insertions(+), 82 deletions(-)
> 
> diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
> index 99b69aebb5..2c91461a54 100644
> --- a/src/conf/capabilities.c
> +++ b/src/conf/capabilities.c
> @@ -266,7 +266,8 @@ virCapsDispose(void *object)
>      VIR_FREE(caps->host.netprefix);
>      VIR_FREE(caps->host.pagesSize);
>      virCPUDefFree(caps->host.cpu);
> -    virObjectUnref(caps->host.resctrl);
> +    if (caps->host.resctrl)
> +        g_object_unref(caps->host.resctrl);

Please use g_clear_object without the condition instead of this pattern
everywhere. It was recently discussed on the list that this is the
better option.





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux