From b90539de2333bb69607fcfd88d4af8b8a630d1d9 Mon Sep 17 00:00:00 2001 From: Akash B Date: Fri, 28 Jan 2022 00:35:18 -0500 Subject: [PATCH] Add enumerated vdev names to 'zpool iostat -v' and 'zpool list -v' This commit adds enumerated names to disambiguate between the different vdevs. Previously only 'zpool status' showed enumerated vdev names, now 'zpool list -v' and 'zpool iostat -v' also shows the enumerated vdev names. Reviewed-by: Reviewed-by: Signed-off-by: Akash B Issue #12510 --- cmd/zpool/zpool_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index d7cce73d3dff..e2072708ce04 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -4850,7 +4850,7 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv, continue; vname = zpool_vdev_name(g_zfs, zhp, newchild[c], - cb->cb_vdevs.cb_name_flags); + cb->cb_vdevs.cb_name_flags | VDEV_NAME_TYPE_ID); ret += print_vdev_stats(zhp, vname, oldnv ? oldchild[c] : NULL, newchild[c], cb, depth + 2); free(vname); @@ -4894,7 +4894,7 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv, } vname = zpool_vdev_name(g_zfs, zhp, newchild[c], - cb->cb_vdevs.cb_name_flags); + cb->cb_vdevs.cb_name_flags | VDEV_NAME_TYPE_ID); ret += print_vdev_stats(zhp, vname, oldnv ? oldchild[c] : NULL, newchild[c], cb, depth + 2); free(vname); @@ -6216,7 +6216,7 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv, continue; vname = zpool_vdev_name(g_zfs, zhp, child[c], - cb->cb_name_flags); + cb->cb_name_flags | VDEV_NAME_TYPE_ID); print_list_stats(zhp, vname, child[c], cb, depth + 2, B_FALSE); free(vname); } @@ -6250,7 +6250,7 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv, printed = B_TRUE; } vname = zpool_vdev_name(g_zfs, zhp, child[c], - cb->cb_name_flags); + cb->cb_name_flags | VDEV_NAME_TYPE_ID); print_list_stats(zhp, vname, child[c], cb, depth + 2, B_FALSE); free(vname);