On 09/28/2011 07:21 AM, Daniel Veillard wrote:
On Sat, Sep 24, 2011 at 06:30:05PM -0600, Eric Blake wrote:
> Reuse the tree listing of nodedev-list, coupled with the new helper
> function to efficiently grab snapshot parent names, to produce
> tree output for a snapshot hierarchy. For example:
>
> $ virsh snapshot-list dom --tree
> root1
> |
> +- sibling1
> +- sibling2
> @@ -12987,7 +12987,7 @@ vshGetSnapshotParent(vshControl *ctl,
virDomainSnapshotPtr snapshot)
> parent = virDomainSnapshotGetParent(snapshot, 0);
> if (parent) {
> /* API works, and virDomainSnapshotGetName will succeed */
> - parent_name = vshStrdup(ctl, virDomainSnapshotGetName(snapshot));
> + parent_name = vshStrdup(ctl, virDomainSnapshotGetName(parent));
> goto cleanup;
> }
> if (last_error->code == VIR_ERR_NO_DOMAIN_SNAPSHOT) {
That looks like a bug fix squashed in here instead of previous patch,
what am I missing ?
Nothing. It was indeed a fix that I had made after the fact, then
merely squashed to the wrong patch when rebasing it back in. I've
floated this hunk up to patch 3/5.
ACK, great improvement,
Code reuse is nice, too - I was dreading writing the tree display code,
until I realized with my recent doc efforts that nodedev-list already
did it for me :)
I've now pushed the amended series (well, through patch 5; patches to
esx and vbox still need to be written and reviewed).
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org