Fix 'zpool list -v' alignment

The verbose output of 'zpool list' was not correctly aligned due
to differences in the vdev name lengths.  Minimally update the
code the correct the alignment using the same strategy employed
by 'zpool status'.

Missing dashes were added for the empty defaults columns, and
the vdev state is now printed for all vdevs.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7308 
Closes #8147
This commit is contained in:
Brian Behlendorf
2018-12-04 10:17:54 -08:00
committed by GitHub
parent a0cc3726ed
commit c5eea0ab9c
2 changed files with 118 additions and 59 deletions
+6
View File
@@ -437,6 +437,12 @@ zprop_width(int prop, boolean_t *fixed, zfs_type_t type)
*/
if (prop == ZFS_PROP_CREATION)
*fixed = B_FALSE;
/*
* 'health' is handled specially because it's a number
* internally, but displayed as a fixed 8 character string.
*/
if (prop == ZPOOL_PROP_HEALTH)
ret = 8;
break;
case PROP_TYPE_INDEX:
idx = prop_tbl[prop].pd_table;