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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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.

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux