aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/lib/libzutil/zutil_import.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2021-02-18 14:17:31 +0000
committerMartin Matuska <mm@FreeBSD.org>2021-02-18 14:19:35 +0000
commitee36e25a86cbe2a9474c1d61f2c4b450da8ef952 (patch)
tree1f9e503fe3f154ff3ebc542840b892419ad85314 /sys/contrib/openzfs/lib/libzutil/zutil_import.c
parentfa2528ac643519072c498b483d0dcc1fa5d99bc1 (diff)
parent62ceb3c592a54fc54d9cb3beee91906979c3df14 (diff)
downloadsrc-ee36e25a86cbe2a9474c1d61f2c4b450da8ef952.tar.gz
src-ee36e25a86cbe2a9474c1d61f2c4b450da8ef952.zip
zfs: merge OpenZFS master-bf156c966
Notable upstream changes: bf156c966 Remove unused abd_alloc_scatter_offset_chunkcnt 658fb8020 Add "compatibility" property for zpool feature sets This update introduces a new pool property called "compatibility" that can be used to enable a limited set of pool features on pool creation and "stick" to it, so the "zpool upgrade" does not accidentally enable features that are not desired. The value of this property may then be changed later. See zpool-features(5) for more information about the "compatibility" pool property. Obtained from: OpenZFS MFC after: 2 weeks
Diffstat (limited to 'sys/contrib/openzfs/lib/libzutil/zutil_import.c')
-rw-r--r--sys/contrib/openzfs/lib/libzutil/zutil_import.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/contrib/openzfs/lib/libzutil/zutil_import.c b/sys/contrib/openzfs/lib/libzutil/zutil_import.c
index 823f093f409f..b9e08eac6af0 100644
--- a/sys/contrib/openzfs/lib/libzutil/zutil_import.c
+++ b/sys/contrib/openzfs/lib/libzutil/zutil_import.c
@@ -24,6 +24,7 @@
* Copyright (c) 2012, 2018 by Delphix. All rights reserved.
* Copyright 2015 RackTop Systems.
* Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
*/
/*
@@ -552,12 +553,14 @@ get_configs(libpc_handle_t *hdl, pool_list_t *pl, boolean_t active_ok,
* pool guid
* name
* comment (if available)
+ * compatibility features (if available)
* pool state
* hostid (if available)
* hostname (if available)
*/
uint64_t state, version;
char *comment = NULL;
+ char *compatibility = NULL;
version = fnvlist_lookup_uint64(tmp,
ZPOOL_CONFIG_VERSION);
@@ -577,6 +580,13 @@ get_configs(libpc_handle_t *hdl, pool_list_t *pl, boolean_t active_ok,
fnvlist_add_string(config,
ZPOOL_CONFIG_COMMENT, comment);
+ if (nvlist_lookup_string(tmp,
+ ZPOOL_CONFIG_COMPATIBILITY,
+ &compatibility) == 0)
+ fnvlist_add_string(config,
+ ZPOOL_CONFIG_COMPATIBILITY,
+ compatibility);
+
state = fnvlist_lookup_uint64(tmp,
ZPOOL_CONFIG_POOL_STATE);
fnvlist_add_uint64(config,