[libvirt] [PATCH v3 06/10] qemu_driver: use VIR_AUTOFREE() with strings 1/3

Ján Tomko jtomko at redhat.com
Wed Oct 16 14:28:19 UTC 2019


On Wed, Oct 16, 2019 at 11:14:05AM -0300, Daniel Henrique Barboza wrote:
>
>
>On 10/16/19 10:49 AM, Ján Tomko wrote:
>>On Tue, Oct 15, 2019 at 05:08:48PM -0300, Daniel Henrique Barboza wrote:
>>>Using VIR_AUTOFREE() in all strings of qemu_driver.c make the code
>>>a bit tidier and smaller, sparing VIR_FREE() calls and sometimes a
>>>whole 'cleanup' label.
>>
>>These patches would look much better split by:
>>* individual functions (in case you do rework multiple things at once)
>
>Do you mean sending an individual patch for any function that might
>have, say, 2+ changes in it? For example, if the same function
>was changed to use g_autoptr and g_autofree and perhaps
>that causes a label to be dropped, this can be an individual patch?

Yes, but if you convert a lot of functions, that would result in a lot
of patches.

Sending one patch per function is more viable for the cases where you
need to refactor it in order to add some functionality later (see
Jirka's series for example). For mass conversion for the sake of
conversion, one patch per change is better.

Jano

>
>
>>* individual changes, i.e.
>> * g_autofree for scalars
>> * g_autoptr for pointers and unref
>> * possible removal of cleanup labels
-------------- 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/20191016/1670c80d/attachment-0001.sig>


More information about the libvir-list mailing list