[libvirt] [PATCH v2 02/11] interface: Remove some unnecessary goto's for Interface tests

Peter Krempa pkrempa at redhat.com
Fri May 26 12:27:48 UTC 2017


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.

ACK to the rest of the patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170526/7dc38562/attachment-0001.sig>


More information about the libvir-list mailing list