Re: [PATCHv2 4/7] snapshot: virsh fallback for snapshot-list --from children

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

 



On 10/09/2011 09:23 PM, Daniel Veillard wrote:
On Fri, Sep 30, 2011 at 05:09:26PM -0600, Eric Blake wrote:
Iterating over one level of children requires parsing all snapshots
and their parents; a bit of code shuffling makes it pretty easy
to do this as well.


-    if (tree) {
-        char indentBuf[INDENT_BUFLEN];
-        char **parents = vshCalloc(ctl, sizeof(char *), actual);
+    if (!tree)
+        qsort(&names[0], actual, sizeof(char*), namesorter);

I had to rebase a bit here because of the bug fix in 40baa1c, but nothing too radical.


   Okay, getting parents global to the function as well as associated
cleanup looks a bit simpler actually.

Yeah, I was pleasantly surprised at how the function got easier to read even as it supported more fallbacks than before.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]