[libvirt] [PATCH v3 7/8] test: snapshot: Add REDEFINE support

John Ferlan jferlan at redhat.com
Fri Oct 4 10:47:55 UTC 2013


On 09/25/2013 03:15 PM, Cole Robinson wrote:
> ---
>  src/test/test_driver.c | 67 ++++++++++++++++++++++++++++++++------------------
>  1 file changed, 43 insertions(+), 24 deletions(-)
> 
Coverity complains here (there's another 

6680 	
6681 	    if (redefine) {

(1) Event missing_parentheses: 	"!virDomainSnapshotRedefinePrep(domain, vm, &def, &snap, &update_current, flags) < 0" is always false regardless of the values of its operands. Did you intend to either negate the entire comparison expression, in which case parentheses would be required around the entire comparison expression to force that interpretation, or negate the sense of the comparison (that is, use '>=' rather than '<')? This occurs as the logical operand of if.

6682 	        if (!virDomainSnapshotRedefinePrep(domain, vm, &def, &snap,
6683 	                                           &update_current, flags) < 0)


I believe that "!virDomain..." is the issue :-)

This also generated another Coverity issue regarding DEAD_ERROR_LINE
for the 'goto cleanup' that wouldn't be reached.

John


> +    if (redefine) {
> +        if (!virDomainSnapshotRedefinePrep(domain, vm, &def, &snap,
> +                                           &update_current, flags) < 0)
> +            goto cleanup;




More information about the libvir-list mailing list