mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-05-10 18:58:27 +03:00
JSON: fix user properties output for zpool list
This commit fixes JSON output for zpool list when user properties are requested with -o flag. This case needed to be handled specifically since zpool_prop_to_name does not return property name for user properties, instead it is stored in pl->pl_user_prop. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Umer Saleem <usaleem@ixsystems.com> Closes #16734
This commit is contained in:
parent
1a54b13aaf
commit
7e3af4658b
@ -6882,8 +6882,13 @@ collect_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
|
|||||||
if (cb->cb_json) {
|
if (cb->cb_json) {
|
||||||
if (pl->pl_prop == ZPOOL_PROP_NAME)
|
if (pl->pl_prop == ZPOOL_PROP_NAME)
|
||||||
continue;
|
continue;
|
||||||
|
const char *prop_name;
|
||||||
|
if (pl->pl_prop != ZPROP_USERPROP)
|
||||||
|
prop_name = zpool_prop_to_name(pl->pl_prop);
|
||||||
|
else
|
||||||
|
prop_name = pl->pl_user_prop;
|
||||||
(void) zprop_nvlist_one_property(
|
(void) zprop_nvlist_one_property(
|
||||||
zpool_prop_to_name(pl->pl_prop), propstr,
|
prop_name, propstr,
|
||||||
sourcetype, NULL, NULL, props, cb->cb_json_as_int);
|
sourcetype, NULL, NULL, props, cb->cb_json_as_int);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user