Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
Show All 16 Lines | |||||
* information: Portions Copyright [yyyy] [name of copyright owner] | * information: Portions Copyright [yyyy] [name of copyright owner] | ||||
* | * | ||||
* CDDL HEADER END | * CDDL HEADER END | ||||
*/ | */ | ||||
/* | /* | ||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | ||||
* Copyright 2019 Joyent, Inc. | * Copyright 2019 Joyent, Inc. | ||||
* Copyright (c) 2011, 2017 by Delphix. All rights reserved. | * Copyright (c) 2011, 2018 by Delphix. All rights reserved. | ||||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com> | * Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com> | ||||
* Copyright (c) 2017 Datto Inc. | * Copyright (c) 2017 Datto Inc. | ||||
*/ | */ | ||||
/* | /* | ||||
* Internal utility routines for the ZFS library. | * Internal utility routines for the ZFS library. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | libzfs_error_description(libzfs_handle_t *hdl) | ||||
case EZFS_ISL2CACHE: | case EZFS_ISL2CACHE: | ||||
return (dgettext(TEXT_DOMAIN, "device is in use as a cache")); | return (dgettext(TEXT_DOMAIN, "device is in use as a cache")); | ||||
case EZFS_VDEVNOTSUP: | case EZFS_VDEVNOTSUP: | ||||
return (dgettext(TEXT_DOMAIN, "vdev specification is not " | return (dgettext(TEXT_DOMAIN, "vdev specification is not " | ||||
"supported")); | "supported")); | ||||
case EZFS_NOTSUP: | case EZFS_NOTSUP: | ||||
return (dgettext(TEXT_DOMAIN, "operation not supported " | return (dgettext(TEXT_DOMAIN, "operation not supported " | ||||
"on this dataset")); | "on this dataset")); | ||||
case EZFS_IOC_NOTSUPPORTED: | |||||
return (dgettext(TEXT_DOMAIN, "operation not supported by " | |||||
"zfs kernel module")); | |||||
case EZFS_ACTIVE_SPARE: | case EZFS_ACTIVE_SPARE: | ||||
return (dgettext(TEXT_DOMAIN, "pool has active shared spare " | return (dgettext(TEXT_DOMAIN, "pool has active shared spare " | ||||
"device")); | "device")); | ||||
case EZFS_UNPLAYED_LOGS: | case EZFS_UNPLAYED_LOGS: | ||||
return (dgettext(TEXT_DOMAIN, "log device has unplayed intent " | return (dgettext(TEXT_DOMAIN, "log device has unplayed intent " | ||||
"logs")); | "logs")); | ||||
case EZFS_REFTAG_RELE: | case EZFS_REFTAG_RELE: | ||||
return (dgettext(TEXT_DOMAIN, "no such tag on this dataset")); | return (dgettext(TEXT_DOMAIN, "no such tag on this dataset")); | ||||
▲ Show 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...) | ||||
case EAGAIN: | case EAGAIN: | ||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, | zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, | ||||
"pool I/O is currently suspended")); | "pool I/O is currently suspended")); | ||||
zfs_verror(hdl, EZFS_POOLUNAVAIL, fmt, ap); | zfs_verror(hdl, EZFS_POOLUNAVAIL, fmt, ap); | ||||
break; | break; | ||||
case EREMOTEIO: | case EREMOTEIO: | ||||
zfs_verror(hdl, EZFS_ACTIVE_POOL, fmt, ap); | zfs_verror(hdl, EZFS_ACTIVE_POOL, fmt, ap); | ||||
break; | break; | ||||
case ZFS_ERR_IOC_CMD_UNAVAIL: | |||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "the loaded zfs " | |||||
"module does not support this operation. A reboot may " | |||||
"be required to enable this operation.")); | |||||
zfs_verror(hdl, EZFS_IOC_NOTSUPPORTED, fmt, ap); | |||||
break; | |||||
case ZFS_ERR_IOC_ARG_UNAVAIL: | |||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "the loaded zfs " | |||||
"module does not support an option for this operation. " | |||||
"A reboot may be required to enable this option.")); | |||||
zfs_verror(hdl, EZFS_IOC_NOTSUPPORTED, fmt, ap); | |||||
break; | |||||
case ZFS_ERR_IOC_ARG_REQUIRED: | |||||
case ZFS_ERR_IOC_ARG_BADTYPE: | |||||
zfs_verror(hdl, EZFS_IOC_NOTSUPPORTED, fmt, ap); | |||||
break; | |||||
default: | default: | ||||
zfs_error_aux(hdl, strerror(error)); | zfs_error_aux(hdl, strerror(error)); | ||||
zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap); | zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap); | ||||
break; | break; | ||||
} | } | ||||
va_end(ap); | va_end(ap); | ||||
return (-1); | return (-1); | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...) | ||||
case ZFS_ERR_DEVRM_IN_PROGRESS: | case ZFS_ERR_DEVRM_IN_PROGRESS: | ||||
zfs_verror(hdl, EZFS_DEVRM_IN_PROGRESS, fmt, ap); | zfs_verror(hdl, EZFS_DEVRM_IN_PROGRESS, fmt, ap); | ||||
break; | break; | ||||
case ZFS_ERR_VDEV_TOO_BIG: | case ZFS_ERR_VDEV_TOO_BIG: | ||||
zfs_verror(hdl, EZFS_VDEV_TOO_BIG, fmt, ap); | zfs_verror(hdl, EZFS_VDEV_TOO_BIG, fmt, ap); | ||||
break; | break; | ||||
case ZFS_ERR_WRONG_PARENT: | case ZFS_ERR_WRONG_PARENT: | ||||
zfs_verror(hdl, EZFS_WRONG_PARENT, fmt, ap); | zfs_verror(hdl, EZFS_WRONG_PARENT, fmt, ap); | ||||
break; | |||||
case ZFS_ERR_IOC_CMD_UNAVAIL: | |||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "the loaded zfs " | |||||
"module does not support this operation. A reboot may " | |||||
"be required to enable this operation.")); | |||||
zfs_verror(hdl, EZFS_IOC_NOTSUPPORTED, fmt, ap); | |||||
break; | |||||
case ZFS_ERR_IOC_ARG_UNAVAIL: | |||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "the loaded zfs " | |||||
"module does not support an option for this operation. " | |||||
"A reboot may be required to enable this option.")); | |||||
zfs_verror(hdl, EZFS_IOC_NOTSUPPORTED, fmt, ap); | |||||
break; | |||||
case ZFS_ERR_IOC_ARG_REQUIRED: | |||||
case ZFS_ERR_IOC_ARG_BADTYPE: | |||||
zfs_verror(hdl, EZFS_IOC_NOTSUPPORTED, fmt, ap); | |||||
break; | break; | ||||
default: | default: | ||||
zfs_error_aux(hdl, strerror(error)); | zfs_error_aux(hdl, strerror(error)); | ||||
zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap); | zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap); | ||||
} | } | ||||
va_end(ap); | va_end(ap); | ||||
return (-1); | return (-1); | ||||
▲ Show 20 Lines • Show All 1,075 Lines • Show Last 20 Lines |