1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

virsh: pool-list: remove unnecessary spaces to align behavior

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] 415b14903e

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Philipp Schuster 2025-01-08 17:38:15 +01:00 committed by Peter Krempa
parent f6d76aad80
commit 1cc990a1d0

View File

@ -1270,11 +1270,6 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
}
}
/* 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) {
@ -1287,7 +1282,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
if (name) {
const char *name_str =
virStoragePoolGetName(list->pools[i]);
vshPrint(ctl, "%-20s\n", name_str);
vshPrint(ctl, "%s\n", name_str);
}
}
ret = true;