mirror_zfs/cmd
Brian Behlendorf eac4720465 Allow 'zpool replace' to use short device names
The 'zpool replace' command would fail when given a short name
because unlike on other platforms the short name cannot be
deterministically expanded to a single path.  Multiple path
prefixes must be checked and in addition the partition suffix
for whole disks is determined by the prefix.

To handle this complexity a zfs_strcmp_pathname() function was
added which takes either a short or fully qualified device name.
Short names will be expanded using the prefixes in the default
import search path, or the ZPOOL_IMPORT_PATH environment variable
if it's defined.  All posible expansions are then compared against
the comparison path.  Care is taken to strip redundant slashes to
ensure legitimate matches are not missed.

In the context of this work the existing zfs_resolve_shortname()
function was extended to consider the ZPOOL_IMPORT_PATH when set.
The zfs_append_partition() interface was also simplified to take
only a single buffer.

The vast majority of these changes rework existing Linux specific
code which was originally written to accomidate udev.  However,
there is some minimal cleanup which removes Illumos specific code.
This was done to improve readability but the basic flow and intent
of the upstream code was maintained.

These changes are the logical conclusion of the previos work to
adjust the 'zpool import' search behavior, see commit 44867b6a.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #544
Closes #976
2012-10-22 08:45:58 -07:00
..
mount_zfs Add libnvpair to mount_zfs dependencies 2012-09-02 15:36:09 -07:00
vdev_id Remove autotools products 2012-08-27 11:47:44 -07:00
zdb Illumos #2088 zdb could use a reasonable manual page 2012-09-18 09:09:13 -07:00
zfs Illumos #2703: add mechanism to report ZFS send progress 2012-09-19 13:39:06 -07:00
zinject Remove autotools products 2012-08-27 11:47:44 -07:00
zpios Remove autotools products 2012-08-27 11:47:44 -07:00
zpool Allow 'zpool replace' to use short device names 2012-10-22 08:45:58 -07:00
zpool_id Remove autotools products 2012-08-27 11:47:44 -07:00
zpool_layout Remove autotools products 2012-08-27 11:47:44 -07:00
zstreamdump Add zstreamdump .gitignore 2012-09-06 14:23:11 -07:00
ztest Disable ztest deadman timer 2012-10-14 19:35:09 -07:00
zvol_id Remove autotools products 2012-08-27 11:47:44 -07:00
Makefile.am Add zstreamdump(8) command to examine ZFS send streams. 2012-09-02 14:54:27 -07:00