summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2013-12-29 13:40:46 -0500
committerBrian Behlendorf <[email protected]>2016-02-25 11:58:39 -0800
commitd2f3e292dccab23e47ade3c67677a10f353b9e85 (patch)
tree89ffd386e9a11e4464386a4141ce1cca978a6c05 /include
parente79a6bacc6666233e109513b614d19d9d7742820 (diff)
Add -gLp to zpool subcommands for alt vdev names
The following options have been added to the zpool add, iostat, list, status, and split subcommands. The default behavior was not modified, from zfs(8). -g Display vdev GUIDs instead of the normal short device names. These GUIDs can be used in-place of device names for the zpool detach/off‐ line/remove/replace commands. -L Display real paths for vdevs resolving all symbolic links. This can be used to lookup the current block device name regardless of the /dev/disk/ path used to open it. -p Display full paths for vdevs instead of only the last component of the path. This can be used in conjunction with the -L flag. This behavior may also be enabled using the following environment variables. ZPOOL_VDEV_NAME_GUID ZPOOL_VDEV_NAME_FOLLOW_LINKS ZPOOL_VDEV_NAME_PATH This change is based on worked originally started by Richard Yao to add a -g option. Then extended by @ilovezfs to add a -L option for openzfsonosx. Those changes have been merged, re-factored, a -p option added and extended to all relevant zpool subcommands. Original-patch-by: Richard Yao <[email protected]> Extended-by: ilovezfs <[email protected]> Extended-by: Brian Behlendorf <[email protected]> Signed-off-by: ilovezfs <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2011 Closes #4341
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 82e8647df..b8419e2e9 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -248,6 +248,7 @@ typedef struct splitflags {
/* after splitting, import the pool */
int import : 1;
+ int name_flags;
} splitflags_t;
/*
@@ -406,8 +407,15 @@ struct zfs_cmd;
extern const char *zfs_history_event_names[];
+typedef enum {
+ VDEV_NAME_PATH = 1 << 0,
+ VDEV_NAME_GUID = 1 << 1,
+ VDEV_NAME_FOLLOW_LINKS = 1 << 2,
+ VDEV_NAME_TYPE_ID = 1 << 3,
+} vdev_name_t;
+
extern char *zpool_vdev_name(libzfs_handle_t *, zpool_handle_t *, nvlist_t *,
- boolean_t verbose);
+ int name_flags);
extern int zpool_upgrade(zpool_handle_t *, uint64_t);
extern int zpool_get_history(zpool_handle_t *, nvlist_t **);
extern int zpool_history_unpack(char *, uint64_t, uint64_t *,