mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Implement -t option to zpool import for temporary pool names
Originally, users had to handle spa namespace collisions by either exporting the already imported pool or by specifying a new name for the pool with a conflicting name. In the case of root pools from virtual guests, neither approach to collision resolution is reasonable. This is addressed by extending the new name syntax with a -t option to specify that the new name is temporary. When specified, this sets an internal flag that is passed into the kernel to tell it that all label updates should refer to the name used in the original label. Consequently, the original pool name will be retained on export. Signed-off-by: Richard Yao <ryao@gentoo.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #2189
This commit is contained in:
committed by
Brian Behlendorf
parent
8959b29e31
commit
26b42f3f9d
@@ -2013,7 +2013,7 @@ zpool_do_import(int argc, char **argv)
|
||||
char *endptr;
|
||||
|
||||
/* check options */
|
||||
while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:T:VX")) != -1) {
|
||||
while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:tT:VX")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
do_all = B_TRUE;
|
||||
@@ -2075,6 +2075,10 @@ zpool_do_import(int argc, char **argv)
|
||||
ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE))
|
||||
goto error;
|
||||
break;
|
||||
case 't':
|
||||
flags |= ZFS_IMPORT_TEMP_NAME;
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
errno = 0;
|
||||
txg = strtoull(optarg, &endptr, 10);
|
||||
|
||||
Reference in New Issue
Block a user