Changeset View
Changeset View
Standalone View
Standalone View
head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
Show First 20 Lines • Show All 3,294 Lines • ▼ Show 20 Lines | zpool_vdev_remove(zpool_handle_t *zhp, const char *path) | ||||
version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL); | version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL); | ||||
if (islog && version < SPA_VERSION_HOLES) { | if (islog && version < SPA_VERSION_HOLES) { | ||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, | zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, | ||||
"pool must be upgraded to support log removal")); | "pool must be upgraded to support log removal")); | ||||
return (zfs_error(hdl, EZFS_BADVERSION, msg)); | return (zfs_error(hdl, EZFS_BADVERSION, msg)); | ||||
} | } | ||||
if (!islog && !avail_spare && !l2cache && zpool_is_bootable(zhp)) { | |||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, | |||||
"root pool can not have removed devices, " | |||||
"because GRUB does not understand them")); | |||||
return (zfs_error(hdl, EINVAL, msg)); | |||||
} | |||||
zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); | zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); | ||||
if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) | if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) | ||||
return (0); | return (0); | ||||
switch (errno) { | switch (errno) { | ||||
case EINVAL: | case EINVAL: | ||||
▲ Show 20 Lines • Show All 1,188 Lines • Show Last 20 Lines |