[libvirt] [PATCH 1/4] virQEMUDriverConfigLoadProcessEntry: use VIR_AUTOFREE

Ján Tomko jtomko at redhat.com
Mon Jan 21 14:12:28 UTC 2019


On Mon, Jan 21, 2019 at 03:05:30PM +0100, Erik Skultety wrote:
>On Mon, Jan 21, 2019 at 02:56:14PM +0100, Ján Tomko wrote:
>> Switch the function to use VIR_AUTOFREE and VIR_AUTOPTR macros
>> to get rid of the cleanup section.
>>
>> Requested-by: John Ferlan <jferlan at redhat.com>
>> Signed-off-by: Ján Tomko <jtomko at redhat.com>
>> ---
>>  src/qemu/qemu_conf.c | 45 +++++++++++++++++++--------------------------
>>  1 file changed, 19 insertions(+), 26 deletions(-)
>>
>> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
>> index 256aad2c0b..fc7101904e 100644
>> --- a/src/qemu/qemu_conf.c
>> +++ b/src/qemu/qemu_conf.c
>> @@ -642,15 +642,14 @@ static int
>>  virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfigPtr cfg,
>>                                      virConfPtr conf)
>>  {
>> -    char *stdioHandler = NULL;
>> -    char **hugetlbfs = NULL;
>> -    char *corestr = NULL;
>> -    int ret = -1;
>> +    VIR_AUTOFREE(char *) stdioHandler = NULL;
>> +    VIR_AUTOPTR(virString) hugetlbfs = NULL;
>
>Minor nit pick, can ^this one be moved 1 up or 1 down?
>

Why yes, it can!

Care to provide a justification for such change?

Jano

>Reviewed-by: Erik Skultety <eskultet at redhat.com>
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- 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/20190121/7a0c1955/attachment-0001.sig>


More information about the libvir-list mailing list