[libvirt] [PATCH 1/5] snapshots: Add flag to guarantee topological sort

Daniel P. Berrangé berrange at redhat.com
Tue Mar 12 17:32:05 UTC 2019


On Fri, Mar 08, 2019 at 12:05:08AM -0600, Eric Blake wrote:
> When doing REDEFINE on multiple snapshot metadata XML descriptions, we
> require that a child cannot be redefined before its parent.  Since
> libvirt already tracks a DAG, it is more convenient if we can ensure
> that virDomainListAllSnapshots() and friends have a way to return data
> in an order that we can directly reuse, rather than having to
> post-process the data ourselves to reconstruct the DAG.
> 
> Add VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL as our new guarantee (well, a
> guarantee at the time of the API call conclusion; there's always a
> possible TOCTTOU race where someone redefining snapshots in between
> the API results and the client actually using the list might render
> the list out-of-date). Four listing APIs are directly benefitted by
> the new flag; additionally, since we document that the older racy
> ListNames interfaces should be sized by using the same flags on their
> Num counterparts, the Num interfaces must document when they accept
> (and ignore) the flag.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  include/libvirt/libvirt-domain-snapshot.h |  4 +++
>  src/libvirt-domain-snapshot.c             | 42 ++++++++++++++++++++++-
>  2 files changed, 45 insertions(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list