[libvirt] [PATCH 1/8] snapshot: add additional filters when getting lists
Peter Krempa
pkrempa at redhat.com
Tue Jun 12 15:47:08 UTC 2012
On 06/10/12 05:37, Eric Blake wrote:
> It turns out that one-bit filtering makes it hard to select the inverse
> set, so it is easier to provide filtering groups. For back-compat,
> omitting all bits within a group means the group is not used for
> filtering, and by definition of a group (each snapshot matches exactly
> one bit within the group, and the set of bits in the group covers all
> snapshots), selecting all bits also makes the group useless.
>
> Unfortunately, virDomainSnapshotListChildren defined the bit
> VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS as an expansion rather than a
> filter, so we cannot make it part of a filter group, so that bit
> (and its counterpart VIR_DOMAIN_SNAPSHOT_LIST_ROOTS for
> virDomainSnapshotList) remains a single control bit.
>
> * include/libvirt/libvirt.h.in (virDomainSnapshotListFlags): Add a
> couple more flags.
> * src/libvirt.c (virDomainSnapshotNum)
> (virDomainSnapshotNumChildren): Document them.
> (virDomainSnapshotListNames, virDomainSnapshotListChildrenNames):
> Likewise, and add thread-safety caveats.
> * src/conf/domain_conf.c (virDomainSnapshotObjListPrepFlags): New
> helper function.
> (virDomainSnapshotObjListCopyNames)
> (virDomainSnapshotObjListCount): Support the new flags.
> ---
> include/libvirt/libvirt.h.in | 22 +++++--
> src/conf/domain_conf.c | 53 +++++++++++++---
> src/libvirt.c | 138 ++++++++++++++++++++++++++++++------------
> 3 files changed, 161 insertions(+), 52 deletions(-)
>
ACK.
Peter
More information about the libvir-list
mailing list