By removing the unnecessary spaces, the behavior is aligned with
`virsh list --all --name` and `virsh net-list --all --name`.
Without this change, one can't do something like the following easily:
`virsh pool-list --all --name | xargs -I {} virsh pool-start \"{}\"`
as no pool `"foo "` (with all the spaces) actually exist.
Although the removed comment states that the additional spaces were kept
to maintain backwards compatibility, the commit [0] and the old behavior
are from 2010 when libvirt was at version 0.8.1. For the sake of sanity,
the behavior should be aligned with other parts of the CLI.
[0] https://gitlab.com/libvirt/libvirt/-/commit/
415b14903e816aeb98d6f9c16fba045686cb0765
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
}
}
- /* If the --details option wasn't selected, we output the pool
- * info using the fixed string format from previous versions to
- * maintain backward compatibility.
- */
-
/* Output basic info then return if --details option not selected */
if (!details) {
if (uuid || name) {
if (name) {
const char *name_str =
virStoragePoolGetName(list->pools[i]);
- vshPrint(ctl, "%-20s\n", name_str);
+ vshPrint(ctl, "%s\n", name_str);
}
}
ret = true;