[libvirt] [PATCH 2/5] snapshots: Support topological visits

Ján Tomko jtomko at redhat.com
Tue Mar 12 16:03:45 UTC 2019


On Fri, Mar 08, 2019 at 12:05:09AM -0600, Eric Blake wrote:
>Wire up support for VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL in the
>domain-agnostic support code.
>
>Clients of snapshot_conf were previously getting a depth-first search
>on anything that used virDomainSnapshotForEachDescendant(); but a
>switch to a breadth-first search will give a topological search.
>
>With that change, we now always have a topological sort for
>virDomainSnapshotListAllChildren(); then with one more tweak, we
>can get a topological rather than a faster random hash visit
>for virDomainListAllSnapshots().
>
>Note that virDomainSnapshotForEach() still uses a random hash
>visit; we could change that signature to take a tri-state for
>random, depth-first, or breadth-first visit if we ever had clients
>that cared about the distinctions, but for now, none of the
>drivers seem to care.
>
>Signed-off-by: Eric Blake <eblake at redhat.com>
>---
> src/conf/snapshot_conf.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190312/8cadfed3/attachment-0001.sig>


More information about the libvir-list mailing list