[libvirt] [PATCH v3 06/19] util: rewrite auto cleanup macros to use glib's equivalent

Bjoern Walk bwalk at linux.ibm.com
Thu Oct 10 13:14:17 UTC 2019


Daniel P. Berrangé <berrange at redhat.com> [2019-10-10, 11:54AM +0100]:
> diff --git a/docs/hacking.html.in b/docs/hacking.html.in
> index 3f1542b6de..6e62b2d4ff 100644
> --- a/docs/hacking.html.in
> +++ b/docs/hacking.html.in
> @@ -1028,6 +1028,24 @@ BAD:
>        <dd>The GLib APIs g_strdup_printf / g_strdup_vprint should be used
>          instead. Don't use g_vasprintf unless having the string length
>          returned is unavoidable.</dd>
> +
> +      <dt>VIR_AUTOPTR, VIR_AUTOCLEAN, VIR_AUTOFREE</dt>
> +      <dd>The GLib macros g_autoptr, g_auto and g_autofree must be used
> +        instead in all new code. In existing code, the GLib macros must
> +        never be mixed with libvirt macros within a method, nor should
> +        they be mixed with VIR_FREE. If introducing GLib macros to an
> +        existing method, any use of libvirt macros must be converted
> +        in an independent commit.
> +      </dd>
> +
> +      <dt>VIR_DEFINE_AUTOPTR_FUNC, VIR_DEFINE_AUTOCLEAN_FUNC</dt>
> +      <dd>The Gib macros G_DEFINE_AUTOPTR_CLEANUP_FUNC and
                  ^
GLib

-- 
IBM Systems
Linux on Z & Virtualization Development
--------------------------------------------------
IBM Deutschland Research & Development GmbH
Schönaicher Str. 220, 71032 Böblingen
Phone: +49 7031 16 1819
--------------------------------------------------
Vorsitzende des Aufsichtsrats: Matthias Hartmann
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 902 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20191010/fe0992b4/attachment-0001.sig>


More information about the libvir-list mailing list