[libvirt] [PATCH v2 02/11] interface: Remove some unnecessary goto's for Interface tests
John Ferlan
jferlan at redhat.com
Fri May 26 13:52:33 UTC 2017
On 05/26/2017 08:27 AM, Peter Krempa wrote:
> On Fri, May 26, 2017 at 07:59:01 -0400, John Ferlan wrote:
>> Rather than using goto cleanup on object find failure and having cleanup
>> need to check if the obj was present before unlocking, just return immediately.
>>
>> Signed-off-by: John Ferlan <jferlan at redhat.com>
>> ---
>> src/test/test_driver.c | 37 +++++++++++++------------------------
>> 1 file changed, 13 insertions(+), 24 deletions(-)
>>
>> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
>> index c2697e8..da45542 100644
>> --- a/src/test/test_driver.c
>> +++ b/src/test/test_driver.c
>
> [...]
>
>> @@ -3899,7 +3893,7 @@ testInterfaceDefineXML(virConnectPtr conn,
>> virCheckFlags(0, NULL);
>>
>> testDriverLock(privconn);
>> - if ((def = virInterfaceDefParseString(xmlStr)) == NULL)
>> + if (!(def = virInterfaceDefParseString(xmlStr)))
>> goto cleanup;
>
> This hunk does something that is not advertised in the commit message.
OK - that's just my type-A brain and fingers... I'll convert it back - NBD.
Tks -
John
>
> ACK to the rest of the patch.
>
More information about the libvir-list
mailing list