[PATCH 00/28] a bunch of domain_conf cleanup

Michal Privoznik mprivozn at redhat.com
Wed Nov 11 07:43:04 UTC 2020


On 11/11/20 8:18 AM, Matt Coleman wrote:
>> On Nov 9, 2020, at 9:43 AM, Michal Privoznik <mprivozn at redhat.com> wrote:
>>
>> Nice cleanup. But as I say in 03/28 I think we might want glib adoption to be done in bigger chunks. Usually we rewrite VIR_ALLOC/VIR_REALLOC_N -> g_new0()/g_renew() in one patch (might be coupled with g_free() except VIR_FREE() resets the pointer to NULL and g_free() doesn't do that so I'm not really a fan of g_free()), then g_strdup() in another path, and so on.
> 
> I had thought that g_free() was a drop-in replacement for VIR_FREE()
> based on other earlier commits that I had seen. You can drop the
> g_free() commits from this series if everything else looks good.
> 

Yes, please. VIR_FREE() is perfect as is :-) g_free() doesn't clear the 
pointer and g_clear_pointer(&ptr, g_free); is just too long.

Michal




More information about the libvir-list mailing list