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

Re: [libvirt] [PATCH 5/5] python: use libvirt_util to avoid raw free



On Thu, Feb 02, 2012 at 17:33:24 -0700, Eric Blake wrote:
> This patch starts the process of elevating the python binding code
> to be on the same level as the rest of libvirt when it comes to
> requiring good coding styles.  Statically linking against the
> libvirt_util library makes it much easier to write good code,
> rather than having to open-code and reinvent things locally.
> 
> Done by global search and replace of s/free(/VIR_FREE(/, followed
> by hand-inspection of remaining malloc and redundant memset.
> 
> * cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation):
> Remove python from exemption.
> * python/Makefile.am (INCLUDES): Add gnulib and src/util.  Drop
> $(top_builddir)/$(subdir), as automake already guarantees that.
> (mylibs, myqemulibs): Pull in libvirt_util and gnulib.
> (libvirtmod_la_CFLAGS): Catch compiler warnings if configured to
> use -Werror.
> * python/typewrappers.c (libvirt_charPtrSizeWrap)
> (libvirt_charPtrWrap): Convert free to VIR_FREE.
> * python/generator.py (print_function_wrapper): Likewise.
> * python/libvirt-override.c: Likewise.
> ---
>  cfg.mk                    |    2 +-
>  python/Makefile.am        |   18 ++-
>  python/generator.py       |    2 +-
>  python/libvirt-override.c |  364 +++++++++++++++++++++------------------------
>  python/typewrappers.c     |    8 +-
>  5 files changed, 194 insertions(+), 200 deletions(-)

ACK

Jirka


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