[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/8] snapshot: expose new flags in virsh



On 06/10/12 05:37, Eric Blake wrote:
Previously, to get the name of all snapshots with children, it was
necessary to get the name of all snapshots and then remove the
name of leaf snapshots.  This is racy, and somewhat inefficient
compared to planned API additions.  We can emulate --no-metadata on
0.9.5-0.9.12, but for now, there is no emulation of --no-leaves.

* tools/virsh.c (cmdSnapshotList): Add new options --no-leaves and
--no-metadata.
(vshSnapshotList): Emulate where possible.
* tools/virsh.pod (snapshot-list): Document them.
---
  tools/virsh.c   |   53 +++++++++++++++++++++++++++++++++++++++++++++++------
  tools/virsh.pod |   14 ++++++++++----
  2 files changed, 57 insertions(+), 10 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 1228508..936b9fe 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -16986,8 +17010,12 @@ static const vshCmdOptDef opts_snapshot_list[] = {
      {"parent", VSH_OT_BOOL, 0, N_("add a column showing parent snapshot")},
      {"roots", VSH_OT_BOOL, 0, N_("list only snapshots without parents")},
      {"leaves", VSH_OT_BOOL, 0, N_("list only snapshots without children")},
+    {"no-leaves", VSH_OT_BOOL, 0,
+     N_("list only snapshots that are not leaves (with children)")},
      {"metadata", VSH_OT_BOOL, 0,
       N_("list only snapshots that have metadata that would prevent undefine")},
+    {"no-metadata", VSH_OT_BOOL, 0,
+     N_("list only snapshots that have no metadata managed by libvirt")},
      {"tree", VSH_OT_BOOL, 0, N_("list snapshots in a tree")},
      {"from", VSH_OT_DATA, 0, N_("limit list to children of given snapshot")},
      {"current", VSH_OT_BOOL, 0,

Hm, I'll probably adopt your naming scheme ("no" before the option name) of these options to cmdList too.

ACK.

Peter


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]