Re: [PATCH v2 10/11] test: Implement bulk snapshot operations

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

 



On 2/27/19 11:03 AM, John Ferlan wrote:
> 
> 
> On 2/23/19 4:24 PM, Eric Blake wrote:
>> Implement the new flags for bulk snapshot dump and redefine. The
>> bulk of the work is already done by the common code.
>>
>> Since each connection to test:///default restarts at the same
>> canned state, this can easily be tested with:
>>

>> @@ -6337,6 +6340,18 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
>>          goto cleanup;
>>      }
>>
>> +    if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE_LIST) {
>> +        if (virDomainSnapshotDefParseList(xmlDesc, vm->def->uuid, vm->snapshots,
>> +                                          &vm->current_snapshot, privconn->caps,
>> +                                          privconn->xmlopt, parse_flags) < 0)
>> +            goto cleanup;
>> +
>> +        /* Return is arbitrary, so use the first root */
>> +        snap = virDomainSnapshotFindByName(vm->snapshots, NULL);
> 
> Hmm... I don't think @snap is used since cleanup: code filters on
> REDEFINE_LIST, so it would seem this would be leaked then.
> 

snap is a stolen pointer into something residing in vm->snapshots (that
is, the result of virDomainSnapshotFindByName() never leaks, and does
not need explicit cleanup).

> Reviewed-by: John Ferlan <jferlan@xxxxxxxxxx>
> 
> John
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

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