mirror of https://gitee.com/openkylin/libvirt.git
virsh-pool: Unify spacing of listing function
Change the alignment to match the domain listing function. Before: $ virsh pool-list Name State Autostart ----------------------------------------- boot-scratch active no default active no glusterpool active no $ virsh pool-list --details Name State Autostart Persistent Capacity Allocation Available ------------------------------------------------------------------------------- boot-scratch running no yes 117.99 GiB 101.40 GiB 16.60 GiB default running no yes 117.99 GiB 101.40 GiB 16.60 GiB glusterpool running no yes 29.40 GiB 44.23 MiB 29.36 GiB After: $ virsh pool-list Name State Autostart ------------------------------------------- boot-scratch active no default active no glusterpool active no $ virsh pool-list --details Name State Autostart Persistent Capacity Allocation Available --------------------------------------------------------------------------------- boot-scratch running no yes 117.99 GiB 101.40 GiB 16.60 GiB default running no yes 117.99 GiB 101.40 GiB 16.60 GiB glusterpool running no yes 29.40 GiB 44.23 MiB 29.36 GiB
This commit is contained in:
parent
b7829f959b
commit
96f4b5eb8c
|
@ -1191,14 +1191,14 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
|||
/* Output basic info then return if --details option not selected */
|
||||
if (!details) {
|
||||
/* Output old style header */
|
||||
vshPrintExtra(ctl, "%-20s %-10s %-10s\n", _("Name"), _("State"),
|
||||
vshPrintExtra(ctl, " %-20s %-10s %-10s\n", _("Name"), _("State"),
|
||||
_("Autostart"));
|
||||
vshPrintExtra(ctl, "-----------------------------------------\n");
|
||||
vshPrintExtra(ctl, "-------------------------------------------\n");
|
||||
|
||||
/* Output old style pool info */
|
||||
for (i = 0; i < list->npools; i++) {
|
||||
const char *name = virStoragePoolGetName(list->pools[i]);
|
||||
vshPrint(ctl, "%-20s %-10s %-10s\n",
|
||||
vshPrint(ctl, " %-20s %-10s %-10s\n",
|
||||
name,
|
||||
poolInfoTexts[i].state,
|
||||
poolInfoTexts[i].autostart);
|
||||
|
@ -1266,7 +1266,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
|||
* the longest string.
|
||||
*/
|
||||
ret = virAsprintf(&outputStr,
|
||||
"%%-%lus %%-%lus %%-%lus %%-%lus %%%lus %%%lus %%%lus\n",
|
||||
" %%-%lus %%-%lus %%-%lus %%-%lus %%%lus %%%lus %%%lus\n",
|
||||
(unsigned long) nameStrLength,
|
||||
(unsigned long) stateStrLength,
|
||||
(unsigned long) autostartStrLength,
|
||||
|
@ -1285,7 +1285,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
|||
for (i = nameStrLength + stateStrLength + autostartStrLength
|
||||
+ persistStrLength + capStrLength
|
||||
+ allocStrLength + availStrLength
|
||||
+ 12; i > 0; i--)
|
||||
+ 14; i > 0; i--)
|
||||
vshPrintExtra(ctl, "-");
|
||||
vshPrintExtra(ctl, "\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue