[PATCH 1/6] virsysinfo: Define and use auto cleanup func for virSysinfoDef properly

Ján Tomko jtomko at redhat.com
Fri Mar 12 15:39:12 UTC 2021


On a Thursday in 2021, Michal Privoznik wrote:
>What we are using really is heap allocated structure rather than
>stack allocated. And for that it's better to use g_autoptr() +
>G_DEFINE_AUTOPTR_CLEANUP_FUNC() combo, as Glib documentation for
>g_auto() reads:
>
>  This is meant to be used with stack-allocated structures and
>  non-pointer types. For the (more commonly used) pointer
>  version, see g_autoptr().
>
>This will be even more visible, when virSysinfoDefPtr type is
>gone. Stay tuned.
>
>Fixes: cee3a900a0d6a8fc79554db22dc262632fe487a6
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/util/virsysinfo.c | 8 ++++----
> src/util/virsysinfo.h | 2 +-
> tests/sysinfotest.c   | 2 +-
> 3 files changed, 6 insertions(+), 6 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210312/907125cd/attachment-0001.sig>


More information about the libvir-list mailing list