[libvirt] [PATCH 08/16] snapshot: Access snapshot def directly when needed

Eric Blake eblake at redhat.com
Thu Mar 21 18:18:57 UTC 2019


On 3/20/19 4:37 PM, John Ferlan wrote:
> 
> 
> On 3/20/19 1:40 AM, Eric Blake wrote:
>> An upcoming patch will rework virDomainSnapshotObjList to be generic
>> for both snapshots and checkpoints; reduce the churn by adding a new
>> accessor virDomainSnapshotObjGetDef() which returns the
>> snapshot-specific definition even when the list is rewritten to
>> operate only on a base class, then using it at sites that that are
>> specific to snapshots.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>>  src/conf/virdomainsnapshotobj.h     |  6 +++++
>>  src/conf/snapshot_conf.c            | 41 +++++++++++++++++------------
>>  src/conf/virdomainsnapshotobjlist.c | 17 +++++++-----
>>  src/qemu/qemu_domain.c              |  6 ++---
>>  4 files changed, 43 insertions(+), 27 deletions(-)
>>
> 

>> @@ -977,8 +984,8 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
>>          /* Drop and rebuild the parent relationship, but keep all
>>           * child relations by reusing snap. */
>>          virDomainSnapshotDropParent(other);
>> -        virDomainSnapshotDefFree(other->def);
>> -        other->def = def;
>> +        virDomainSnapshotDefFree(otherdef);
>> +        otherdef = def;
> 
> Too much substitution ;-/... leave the old code other->def = def; Or
> maybe we'll need the corresponding virDomainSnapshotObjSetDef...

Indeed. (And proves I don't have as much testsuite coverage automated as
I would like)

> 
> Reviewed-by: John Ferlan <jferlan at redhat.com>
> 
> John
> 
> 
>>          *defptr = NULL;
>>          *snap = other;
>>      }
> 
> [...]
> 

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190321/c45c80db/attachment-0001.sig>


More information about the libvir-list mailing list