
On 3/27/19 10:43 AM, Eric Blake wrote:
On 3/27/19 9:29 AM, Ján Tomko wrote:
On Wed, Mar 27, 2019 at 05:10:46AM -0500, Eric Blake wrote:
Introduce a bunch of new virsh commands for managing checkpoints in isolation. More commands are needed for performing incremental backups, but these commands were easy to implement by modeling heavily after virsh-snapshot.c (no need for checkpoint-revert, and checkpoint-list was a lot easier since we don't have to cater to older libvirt API).
Signed-off-by: Eric Blake <eblake@redhat.com>
+ if (virshLookupCheckpoint(ctl, cmd, "checkpointname", true, dom, + &checkpoint, &name) < 0) + goto cleanup; + + vshPrint(ctl, "%-15s %s\n", _("Name:"), name); + vshPrint(ctl, "%-15s %s\n", _("Domain:"), virDomainGetName(dom));
We have vshTableNew and vshTableRowAppend that can compute the indentation at run-time regardless of the locale.
Nice! Those were added after I forked from snapshot code 6 months ago. I wonder if I can get some code sharing between the two in virsh the way I did with code sharing in src/conf/.
I also seem to recall seeing recent code changes to output '-' instead of a blank column, such as for a 'Parent' column vs. roots with no parents. Snapshot code doesn't appear to be doing that yet; if it does start doing that, checkpoints should do likewise. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org