nvlist_t *config, *props = NULL;
nvlist_t *rootprops = NULL;
nvlist_t *zplprops = NULL;
+ char *spa_name = zc->zc_name;
if ((error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size,
zc->zc_iflags, &config)))
if (props) {
nvlist_t *nvl = NULL;
uint64_t version = SPA_VERSION;
+ char *tname;
(void) nvlist_lookup_uint64(props,
zpool_prop_to_name(ZPOOL_PROP_VERSION), &version);
zplprops, NULL);
if (error != 0)
goto pool_props_bad;
+
+ if (nvlist_lookup_string(props,
+ zpool_prop_to_name(ZPOOL_PROP_TNAME), &tname) == 0)
+ spa_name = tname;
}
error = spa_create(zc->zc_name, config, props, zplprops);
/*
* Set the remaining root properties
*/
- if (!error && (error = zfs_set_prop_nvlist(zc->zc_name,
+ if (!error && (error = zfs_set_prop_nvlist(spa_name,
ZPROP_SRC_LOCAL, rootprops, NULL)) != 0)
- (void) spa_destroy(zc->zc_name);
+ (void) spa_destroy(spa_name);
pool_props_bad:
nvlist_free(rootprops);