Otherwise, the results are not repeatable.
* tools/virsh.c (cmdSnapshotList): Print tree in predictable order.
if (actual < 0)
goto cleanup;
+ qsort(&names[0], actual, sizeof(char*), namesorter);
+
if (tree) {
char indentBuf[INDENT_BUFLEN];
char **parents = vshMalloc(ctl, sizeof(char *) * actual);
ret = true;
goto cleanup;
} else {
- qsort(&names[0], actual, sizeof(char*), namesorter);
-
for (i = 0; i < actual; i++) {
/* free up memory from previous iterations of the loop */
VIR_FREE(parent);