[libvirt] [PATCH v6 7/8] snapshot: Create virDomainMoment base class

Eric Blake eblake at redhat.com
Fri Mar 15 13:51:39 UTC 2019


On 3/15/19 8:34 AM, Ján Tomko wrote:
> On Fri, Mar 15, 2019 at 12:02:32AM -0500, Eric Blake wrote:
>> Upcoming patches want to add virDomainCheckpoint that behaves very
>> similarly to virDomainCheckpoint; th eeasiest way to share common code
>> is to give both classes a common base class.  Thanks to the accessor
>> functions in the previous patch, we have very few changes required
>> outside of datatypes.[ch].  This also gets rid of the temporary rename
>> hack that the previous patch used for compiler verification.
>>

>> struct _virDomainSnapshot {
>> -    virObject parent;
>> -    char *_name;
>> -    virDomainPtr _domain;
>> +    virDomainMoment parent;
> 
> This breaks the test suite, saying:
> error : object size 32 of virDomainSnapshot is smaller than parent class 32

The error message is wrong, but yes, I'll need to patch virObject first
to allow a child class that adds nothing over its base class.  (Serves
me right for mailing patches at midnight)

-- 
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/20190315/dadcf06c/attachment-0001.sig>


More information about the libvir-list mailing list