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