[libvirt] [PATCH v6 6/8] snapshot: Use accessors for virDomainSnapshot members
Eric Blake
eblake at redhat.com
Fri Mar 15 13:41:05 UTC 2019
On 3/15/19 8:31 AM, Ján Tomko wrote:
> On Fri, Mar 15, 2019 at 12:02:31AM -0500, Eric Blake wrote:
>> Upcoming patches want to add virDomainCheckpoint that behaves very
>> similarly to virDomainCheckpoint; the easiest way to share common code
>> is to give both classes a common base class. If this were C++, we'd
>> just use public member inheritance; but since it is C, we instead have
>> to touch EVERY use of member fields that will be relocated. To avoid
>> having to make future edits, wrap the majority of accesses behind
>> static inline functions, so that we only have to touch one place when
>> changing class inheritance; and temporarily rename the members to let
>> the compiler ensure we caught all uses.
>
> While it helps review, I'd rather not include the rename in the git
> history. Thankfully the next patch renames them to something else, not
> back to the same name.
Okay, I'll hack that part out before pushing.
>
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>> src/datatypes.h | 22 +++++++---
>> src/datatypes.c | 10 ++---
>> src/esx/esx_driver.c | 66 ++++++++++++++---------------
>> src/libvirt-domain-snapshot.c | 24 +++++------
>> src/qemu/qemu_driver.c | 40 ++++++++---------
>> src/remote/remote_daemon_dispatch.c | 4 +-
>> src/remote/remote_driver.c | 4 +-
>> src/rpc/gendispatch.pl | 2 +-
>> src/test/test_driver.c | 20 ++++-----
>> src/vbox/vbox_common.c | 56 ++++++++++++------------
>> src/vz/vz_driver.c | 52 +++++++++++------------
>> 11 files changed, 156 insertions(+), 144 deletions(-)
>>
>
> Reviewed-by: Ján Tomko <jtomko at redhat.com>
>
> Jano
--
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/8c8f5ae5/attachment-0001.sig>
More information about the libvir-list
mailing list