the name of the parent of each snapshot. If *--roots* is specified,
the list will be filtered to just snapshots that have no parents.
If *--tree* is specified, the output will be in a tree format, listing
-just snapshot names. These three options are mutually exclusive. If
-*--name* is specified only the snapshot name is printed. This option is
-mutually exclusive with *--tree*.
+just snapshot names. These three options are mutually exclusive.
+
+If *--name* is specified only the snapshot name is printed optionally
+followed by a tab-separated name of the parent snapshot if *--parent* is used
+as well. This option is mutually exclusive with *--tree*.
If *--from* is provided, filter the list to snapshots which are
children of the given ``snapshot``; or if *--current* is provided,
specified, the list will be filtered to just checkpoints that have no
parents. If *--tree* is specified, the output will be in a tree
format, listing just checkpoint names. These three options are
-mutually exclusive. If *--name* is specified only the checkpoint name
-is printed. This option is mutually exclusive with *--tree*.
+mutually exclusive.
+
+If *--name* is specified only the checkpoint name is printed optionally
+followed by a tab-separated name of the parent checkpoint if *--parent* is used
+as well. This option is mutually exclusive with *--tree*.
If *--from* is provided, filter the list to checkpoints which are
children of the given ``checkpoint``. When used in isolation or with
chk_name = virDomainCheckpointGetName(checkpoint);
assert(chk_name);
- if (name) {
- /* just print the checkpoint name */
- vshPrint(ctl, "%s\n", chk_name);
- continue;
- }
-
if (!(doc = virDomainCheckpointGetXMLDesc(checkpoint, 0)))
continue;
parent_chk = virXPathString("string(/domaincheckpoint/parent/name)",
ctxt);
+ if (name) {
+ vshPrint(ctl, "%s", chk_name);
+
+ if (parent_chk)
+ vshPrint(ctl, "\t%s", parent_chk);
+
+ vshPrint(ctl, "\n");
+
+ /* just print the checkpoint name */
+ continue;
+ }
+
if (virXPathLongLong("string(/domaincheckpoint/creationTime)", ctxt,
&creation_longlong) < 0)
continue;
snap_name = virDomainSnapshotGetName(snapshot);
assert(snap_name);
- if (name) {
- /* just print the snapshot name */
- vshPrint(ctl, "%s\n", snap_name);
- continue;
- }
-
if (!(doc = virDomainSnapshotGetXMLDesc(snapshot, 0)))
continue;
parent_snap = virXPathString("string(/domainsnapshot/parent/name)",
ctxt);
+ if (name) {
+ vshPrint(ctl, "%s", snap_name);
+
+ if (parent_snap)
+ vshPrint(ctl, "\t%s", parent_snap);
+
+ vshPrint(ctl, "\n");
+
+ /* just print the snapshot name */
+ continue;
+ }
+
if (!(state = virXPathString("string(/domainsnapshot/state)", ctxt)))
continue;