[libvirt] [PATCH 5/5] python: use libvirt_util to avoid raw free
Eric Blake
eblake at redhat.com
Fri Feb 3 17:47:06 UTC 2012
On 02/03/2012 02:12 AM, Jiri Denemark wrote:
> 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
Series pushed.
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120203/7ac895d5/attachment-0001.sig>
More information about the libvir-list
mailing list