[libvirt] [PATCH v9 05/13] backup: Allow for lists of checkpoint objects

Peter Krempa pkrempa at redhat.com
Mon Jul 8 12:40:51 UTC 2019


On Sat, Jul 06, 2019 at 22:56:05 -0500, Eric Blake wrote:
> Create a new file for managing a list of checkpoint objects, borrowing
> heavily from existing virDomainSnapshotObjList paradigms.
> 
> Note that while checkpoints definitely have a use case for multiple

snapshots?

> children to a single parent (create a base snapshot, create a child
> snapshot, revert to the base, then create another child snapshot),
> it's harder to predict how checkpoints will play out with reverting to
> prior points in time. Thus, in initial use, we may find that in a list
> of checkpoints, you never have more than one child.  However, as the
> snapshot machinery is already generic, it is easier to reuse the
> generic machinery that tracks relations between domain moments than it
> is to open-code a new list-management scheme just for checkpoints.
> 
> Similarly, although the initial checkpoint implementation in qemu will
> only support a single current checkpoint, it is conceivable that a
> future hypervisor implementation could expose multiple current
> checkpoints in differential backup scenarios - the API is prepared for
> this by exposing whether a checkpoint is current via the XML
> description and via a ListAll filter.  But for now, living with the
> generic code supporting only a single current checkpoint is easier
> than reworking that aspect of the code.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---

[...]

> diff --git a/src/conf/virdomaincheckpointobjlist.c b/src/conf/virdomaincheckpointobjlist.c
> new file mode 100644
> index 0000000000..2bf91f3d5f
> --- /dev/null
> +++ b/src/conf/virdomaincheckpointobjlist.c
> @@ -0,0 +1,232 @@

[...]

> +static int
> +virDomainCheckpointObjListGetNames(virDomainCheckpointObjListPtr checkpoints,
> +                                   virDomainMomentObjPtr from,
> +                                   char **const names,
> +                                   int maxnames,
> +                                   unsigned int flags)
> +{
> +    /* We intentionally chose our public flags to match the common flags */
> +    verify(VIR_DOMAIN_CHECKPOINT_LIST_ROOTS ==
> +           (int) VIR_DOMAIN_MOMENT_LIST_ROOTS);
> +    verify(VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL ==
> +           (int) VIR_DOMAIN_MOMENT_LIST_TOPOLOGICAL);
> +    verify(VIR_DOMAIN_CHECKPOINT_LIST_LEAVES ==
> +           (int) VIR_DOMAIN_MOMENT_LIST_LEAVES);
> +    verify(VIR_DOMAIN_CHECKPOINT_LIST_NO_LEAVES ==
> +           (int) VIR_DOMAIN_MOMENT_LIST_NO_LEAVES);
> +    verify(VIR_DOMAIN_CHECKPOINT_LIST_CURRENT ==
> +           (int) VIR_DOMAIN_MOMENT_LIST_CURRENT);
> +    verify(VIR_DOMAIN_CHECKPOINT_LIST_NO_CURRENT ==
> +           (int) VIR_DOMAIN_MOMENT_LIST_NO_CURRENT);

In v8 I asked for these to be put where VIR_DOMAIN_CHECKPOINT_LIST_* are
defined rather than randomly into the code.

ACK with the above addressed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190708/aada5306/attachment-0001.sig>


More information about the libvir-list mailing list