Re: [PATCH v3 3/8] test: Implement readonly snapshot APIs

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

 



On 10/02/2013 06:40 AM, John Ferlan wrote:
> On 09/25/2013 03:15 PM, Cole Robinson wrote:
>> This is just stolen from qemu_driver.c with tweaks to fit the
>> test driver.
>> ---
>>  src/test/test_driver.c | 392 +++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 392 insertions(+)
>>
> 
> ...
> 
>> +static int
>> +testDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
>> +                            unsigned int flags)
>> +{
>> +    virDomainObjPtr vm = NULL;
>> +    int ret = -1;
>> +    virDomainSnapshotObjPtr snap = NULL;
>> +
>> +    virCheckFlags(0, -1);
>> +
>> +    if (!(vm = testDomObjFromSnapshot(snapshot)))
>> +        goto cleanup;
>> +
> 
> Coverity complains here:
> 
> 6440 	
> 
> (1) Event returned_pointer: 	Pointer "snap" returned by "testSnapObjFromSnapshot(vm, snapshot)" is never used.
> 
> 6441 	    if (!(snap = testSnapObjFromSnapshot(vm, snapshot)))
> 
> 
>> +    if (!(snap = testSnapObjFromSnapshot(vm, snapshot)))
>> +        goto cleanup;
>> +
>> +    ret = (vm->current_snapshot &&
>> +           STREQ(snapshot->name, vm->current_snapshot->def->name));
>> +
>> +cleanup:
>> +    if (vm)
>> +        virObjectUnlock(vm);
>> +    return ret;
>> +}
>> +
>> +
>> +static int
>> +testDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
>> +                              unsigned int flags)
>> +{
>> +    virDomainObjPtr vm = NULL;
>> +    int ret = -1;
>> +    virDomainSnapshotObjPtr snap = NULL;
>> +
>> +    virCheckFlags(0, -1);
>> +
>> +    if (!(vm = testDomObjFromSnapshot(snapshot)))
>> +        goto cleanup;
>> +
> 
> Coverity complains here too
> 
> 6466 	
> 
> (1) Event returned_pointer: 	Pointer "snap" returned by "testSnapObjFromSnapshot(vm, snapshot)" is never used.
> 
> 6467 	    if (!(snap = testSnapObjFromSnapshot(vm, snapshot)))
> 
> John
> 
>> +    if (!(snap = testSnapObjFromSnapshot(vm, snapshot)))
>> +        goto cleanup;
>> +
>> +    ret = 1;
>> +
>> +cleanup:
>> +    if (vm)
>> +        virObjectUnlock(vm);
>> +    return ret;
>> +}
>> +
> 

I've sent a patch for this

Thanks,
Cole

--
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]