Support shorthand names with zpool remove
authorNed Bass <bass6@llnl.gov>
Thu, 14 Oct 2010 00:27:41 +0000 (17:27 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 22 Oct 2010 19:25:46 +0000 (12:25 -0700)
commita2c6816c34952eb6dad51248d31172189fba9126
tree88d34b6138c54e561f9ceadf110f5fdd4e019d6d
parent79e7242a91c17f50c857b53d2a7313cf363ea535
Support shorthand names with zpool remove

zpool status displays abbreviated vdev names without leading path components
and, in the case of whole disks, without partition information.  Also, the
zpool subcommands 'create' and 'add' support using shorthand devices names
without qualified paths.  Prior to this change, however, removing a device
generally required specifying its name as it is stored in the vdev label.  So
while zpool status might list a cache disk with a name like A16, removing it
would require a full path such as /dev/disk/zpool/A16-part1, which is
non-intuitive.

This change adds support for shorthand device names with the remove subcommand
so one can simply type, for example,

        zpool remove tank A16

A consequence of this change is that including the partition information when
removing a whole-disk vdev now results in an error.  While this is arguably the
correct behavior, it is a departure from how zpool previously worked in this
project.

This change removes the only reference to ctd_check_path(), so that function is
also removed to avoid compiler warnings.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
lib/libzfs/libzfs_pool.c