]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: fix snapshot list --parent
authorJán Tomko <jtomko@redhat.com>
Thu, 14 Feb 2019 13:45:12 +0000 (14:45 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 14 Feb 2019 15:37:24 +0000 (16:37 +0100)
The root snapshot does not have a parent.
Use NULLSTR_EMPTY to pass an empty string instead of putting
too few columns in the table.

https://bugzilla.redhat.com/show_bug.cgi?id=1662849

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
tools/virsh-snapshot.c

index 90000ef1aace0109d339564a0f4bbe376c4dd3fe..6cadb2b0d6700692f00736f409b1f5773abcc09c 100644 (file)
@@ -1608,7 +1608,8 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
                  &time_info);
 
         if (parent) {
-            if (vshTableRowAppend(table, snap_name, timestr, state, parent_snap,
+            if (vshTableRowAppend(table, snap_name, timestr, state,
+                                  NULLSTR_EMPTY(parent_snap),
                                   NULL) < 0)
                 goto cleanup;
         } else {