diff options
author | avg <avg@FreeBSD.org> | 2018-05-03 06:34:07 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2018-05-03 06:34:07 +0000 |
commit | 30d53f5b8b5cd34722f9e2e96a13fd0f5e0875d4 (patch) | |
tree | 061d6e1be2cfd09baa755520bec433320662c5e0 /cddl/contrib/opensolaris/lib/libzfs/common | |
parent | 5d54530ddf13333a3c75ad16b7adb587009e9ac9 (diff) | |
download | FreeBSD-src-30d53f5b8b5cd34722f9e2e96a13fd0f5e0875d4.zip FreeBSD-src-30d53f5b8b5cd34722f9e2e96a13fd0f5e0875d4.tar.gz |
MFC r332426: allow ZFS pool to have temporary name for duration of current import
The change adds -t <name> option to zpool create and -t option to zpool
import in its form with an old name and a new name. This allows to
import (or create) a pool under a name that's different from its real,
permanent name without affecting that name. This is useful when working
with VM images or images of other physical systems if they happen to
have a ZFS pool with the same name as the host system.
Sponsored by: Panzura (porting)
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c index 61c5325..1eec116 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c @@ -644,6 +644,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname, goto error; } break; + case ZPOOL_PROP_READONLY: if (!flags.import) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -654,6 +655,16 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname, } break; + case ZPOOL_PROP_TNAME: + if (!flags.create) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "property '%s' can only be set at " + "creation time"), propname); + (void) zfs_error(hdl, EZFS_BADPROP, errbuf); + goto error; + } + break; + default: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "property '%s'(%d) not defined"), propname, prop); |