Lines Matching defs:zhp
75 zpool_get_all_props(zpool_handle_t *zhp)
78 libzfs_handle_t *hdl = zhp->zpool_hdl;
80 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
82 if (zhp->zpool_n_propnames > 0) {
85 zhp->zpool_propnames, zhp->zpool_n_propnames);
100 if (zcmd_read_dst_nvlist(hdl, &zc, &zhp->zpool_props) != 0) {
111 zpool_props_refresh(zpool_handle_t *zhp)
115 old_props = zhp->zpool_props;
117 if (zpool_get_all_props(zhp) != 0)
125 zpool_get_prop_string(zpool_handle_t *zhp, zpool_prop_t prop,
132 nvl = zhp->zpool_props;
149 zpool_get_prop_int(zpool_handle_t *zhp, zpool_prop_t prop, zprop_source_t *src)
155 if (zhp->zpool_props == NULL && zpool_get_all_props(zhp)) {
159 * vdev's guid then get it from the zhp config nvlist.
162 (nvlist_lookup_nvlist(zhp->zpool_config,
171 nvl = zhp->zpool_props;
254 zpool_get_state_str(zpool_handle_t *zhp)
260 status = zpool_get_status(zhp, NULL, &errata);
262 if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
270 zpool_get_config(zhp, NULL), ZPOOL_CONFIG_VDEV_TREE);
284 zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf,
291 if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
294 (void) strlcpy(buf, zpool_get_name(zhp), len);
298 (void) strlcpy(buf, zpool_get_state_str(zhp), len);
302 intval = zpool_get_prop_int(zhp, prop, &src);
310 if (zhp->zpool_props != NULL ||
311 zpool_get_all_props(zhp) == 0) {
313 zpool_get_prop_string(zhp, prop, &src),
333 zpool_add_propname(zhp, ZPOOL_DEDUPCACHED_PROP_NAME);
334 (void) zpool_get_all_props(zhp);
337 if (zhp->zpool_props == NULL && zpool_get_all_props(zhp) &&
343 (void) strlcpy(buf, zpool_get_prop_string(zhp, prop, &src),
348 intval = zpool_get_prop_int(zhp, prop, &src);
435 (void) strlcpy(buf, zpool_get_state_str(zhp), len);
449 intval = zpool_get_prop_int(zhp, prop, &src);
471 zpool_get_userprop(zpool_handle_t *zhp, const char *propname, char *buf,
479 if (zhp->zpool_props == NULL)
480 zpool_get_all_props(zhp);
482 if (nvlist_lookup_nvlist(zhp->zpool_props, propname, &nv) == 0) {
536 zpool_handle_t *zhp;
750 if ((zhp = zpool_open_canfail(hdl, poolname)) == NULL) {
756 zpool_close(zhp);
894 zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval)
906 zhp->zpool_name);
909 return (no_memory(zhp->zpool_hdl));
913 return (no_memory(zhp->zpool_hdl));
916 version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL);
917 if ((realprops = zpool_valid_proplist(zhp->zpool_hdl,
918 zhp->zpool_name, nvl, version, flags, errbuf)) == NULL) {
929 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
931 zcmd_write_src_nvlist(zhp->zpool_hdl, &zc, nvl);
933 ret = zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_SET_PROPS, &zc);
939 (void) zpool_standard_error(zhp->zpool_hdl, errno, errbuf);
941 (void) zpool_props_refresh(zhp);
947 zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp,
950 libzfs_handle_t *hdl = zhp->zpool_hdl;
970 features = zpool_get_features(zhp);
974 if (zhp->zpool_props == NULL && zpool_props_refresh(zhp))
978 while ((nvp = nvlist_next_nvpair(zhp->zpool_props, nvp)) !=
1054 zpool_get_prop(zhp, entry->pl_prop, buf, sizeof (buf),
1060 zpool_get_userprop(zhp, entry->pl_user_prop, buf,
1071 vdev_expand_proplist(zpool_handle_t *zhp, const char *vdevname,
1089 if (zpool_get_vdev_prop(zhp, vdevname, entry->pl_prop,
1106 err = zpool_get_all_vdev_props(zhp, vdevname, &vprops);
1123 entry = zfs_alloc(zhp->zpool_hdl,
1126 entry->pl_user_prop = zfs_strdup(zhp->zpool_hdl,
1142 zpool_prop_get_feature(zpool_handle_t *zhp, const char *propname, char *buf,
1147 nvlist_t *features = zpool_get_features(zhp);
1305 zpool_handle_t *zhp;
1318 zhp = zfs_alloc(hdl, sizeof (zpool_handle_t));
1320 zhp->zpool_hdl = hdl;
1321 (void) strlcpy(zhp->zpool_name, pool, sizeof (zhp->zpool_name));
1323 if (zpool_refresh_stats(zhp, &missing) != 0) {
1324 zpool_close(zhp);
1332 zpool_close(zhp);
1336 return (zhp);
1346 zpool_handle_t *zhp;
1349 zhp = zfs_alloc(hdl, sizeof (zpool_handle_t));
1351 zhp->zpool_hdl = hdl;
1352 (void) strlcpy(zhp->zpool_name, pool, sizeof (zhp->zpool_name));
1354 if (zpool_refresh_stats(zhp, &missing) != 0) {
1355 zpool_close(zhp);
1360 zpool_close(zhp);
1365 *ret = zhp;
1376 zpool_handle_t *zhp;
1378 if ((zhp = zpool_open_canfail(hdl, pool)) == NULL)
1381 if (zhp->zpool_state == POOL_STATE_UNAVAIL) {
1383 dgettext(TEXT_DOMAIN, "cannot open '%s'"), zhp->zpool_name);
1384 zpool_close(zhp);
1388 return (zhp);
1395 zpool_close(zpool_handle_t *zhp)
1397 nvlist_free(zhp->zpool_config);
1398 nvlist_free(zhp->zpool_old_config);
1399 nvlist_free(zhp->zpool_props);
1400 free(zhp);
1407 zpool_get_name(zpool_handle_t *zhp)
1409 return (zhp->zpool_name);
1417 zpool_get_state(zpool_handle_t *zhp)
1419 return (zhp->zpool_state);
1686 zpool_destroy(zpool_handle_t *zhp, const char *log_str)
1690 libzfs_handle_t *hdl = zhp->zpool_hdl;
1693 if (zhp->zpool_state == POOL_STATE_ACTIVE &&
1694 (zfp = zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_FILESYSTEM)) == NULL)
1697 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
1702 "cannot destroy '%s'"), zhp->zpool_name);
1729 zpool_checkpoint(zpool_handle_t *zhp)
1731 libzfs_handle_t *hdl = zhp->zpool_hdl;
1735 error = lzc_pool_checkpoint(zhp->zpool_name);
1738 "cannot checkpoint '%s'"), zhp->zpool_name);
1750 zpool_discard_checkpoint(zpool_handle_t *zhp)
1752 libzfs_handle_t *hdl = zhp->zpool_hdl;
1756 error = lzc_pool_checkpoint_discard(zhp->zpool_name);
1759 "cannot discard checkpoint in '%s'"), zhp->zpool_name);
1771 zpool_prefetch(zpool_handle_t *zhp, zpool_prefetch_type_t type)
1773 libzfs_handle_t *hdl = zhp->zpool_hdl;
1777 error = lzc_pool_prefetch(zhp->zpool_name, type);
1781 type == ZPOOL_PREFETCH_DDT ? "ddt" : "", zhp->zpool_name);
1794 zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot, boolean_t check_ashift)
1798 libzfs_handle_t *hdl = zhp->zpool_hdl;
1804 "cannot add to '%s'"), zhp->zpool_name);
1806 if (zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL) <
1815 if (zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL) <
1825 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
1904 zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce,
1909 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
1914 if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_EXPORT, &zc) != 0) {
1917 zfs_error_aux(zhp->zpool_hdl, dgettext(TEXT_DOMAIN,
1921 zhp->zpool_name, zhp->zpool_name);
1922 return (zfs_error_fmt(zhp->zpool_hdl, EZFS_ACTIVE_SPARE,
1924 zhp->zpool_name));
1926 return (zpool_standard_error_fmt(zhp->zpool_hdl, errno,
1928 zhp->zpool_name));
1936 zpool_export(zpool_handle_t *zhp, boolean_t force, const char *log_str)
1938 return (zpool_export_common(zhp, force, B_FALSE, log_str));
1942 zpool_export_force(zpool_handle_t *zhp, const char *log_str)
1944 return (zpool_export_common(zhp, B_TRUE, B_TRUE, log_str));
2383 zpool_handle_t *zhp;
2388 if (zpool_open_silent(hdl, thename, &zhp) != 0)
2390 else if (zhp != NULL)
2391 zpool_close(zhp);
2409 zpool_translate_vdev_guids(zpool_handle_t *zhp, nvlist_t *vds,
2420 nvlist_t *tgt = zpool_find_vdev(zhp, vd_path, &spare, &cache,
2476 zpool_initialize_impl(zpool_handle_t *zhp, pool_initialize_func_t cmd_type,
2487 err = zpool_translate_vdev_guids(zhp, vds, vdev_guids,
2495 err = lzc_initialize(zhp->zpool_name, cmd_type,
2505 zfs_error_aux(zhp->zpool_hdl, dgettext(TEXT_DOMAIN,
2509 (void) zpool_standard_error(zhp->zpool_hdl, err,
2520 err = lzc_wait_tag(zhp->zpool_name,
2523 (void) zpool_standard_error_fmt(zhp->zpool_hdl,
2544 (void) zfs_error_fmt(zhp->zpool_hdl, vd_error,
2559 zpool_initialize(zpool_handle_t *zhp, pool_initialize_func_t cmd_type,
2562 return (zpool_initialize_impl(zhp, cmd_type, vds, B_FALSE));
2566 zpool_initialize_wait(zpool_handle_t *zhp, pool_initialize_func_t cmd_type,
2569 return (zpool_initialize_impl(zhp, cmd_type, vds, B_TRUE));
2592 zpool_trim_wait(zpool_handle_t *zhp, nvlist_t *vdev_guids)
2602 err = lzc_wait_tag(zhp->zpool_name,
2605 (void) zpool_standard_error_fmt(zhp->zpool_hdl,
2620 check_trim_errs(zpool_handle_t *zhp, trimflags_t *trim_flags,
2655 (void) zfs_error_fmt(zhp->zpool_hdl, vd_error,
2660 (void) zfs_error_aux(zhp->zpool_hdl, dgettext(TEXT_DOMAIN,
2662 (void) (zfs_error(zhp->zpool_hdl, EZFS_TRIM_NOTSUP,
2675 zpool_trim(zpool_handle_t *zhp, pool_trim_func_t cmd_type, nvlist_t *vds,
2685 err = zpool_translate_vdev_guids(zhp, vds, vdev_guids,
2688 check_trim_errs(zhp, trim_flags, guids_to_paths, vds, errlist);
2693 err = lzc_trim(zhp->zpool_name, cmd_type, trim_flags->rate,
2699 if (check_trim_errs(zhp, trim_flags, guids_to_paths,
2709 zpool_standard_error(zhp->zpool_hdl, err, errbuf);
2717 retval = zpool_trim_wait(zhp, vdev_guids);
2731 zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func, pool_scrub_cmd_t cmd)
2735 libzfs_handle_t *hdl = zhp->zpool_hdl;
2741 err = lzc_scrub(ZFS_IOC_POOL_SCRUB, zhp->zpool_name, args, NULL);
2748 (void) strlcpy(zc.zc_name, zhp->zpool_name,
2782 zhp->zpool_name);
2787 zhp->zpool_name);
2792 "cannot restart resilver on %s"), zhp->zpool_name);
2795 "cannot cancel scrubbing %s"), zhp->zpool_name);
2816 nvroot = fnvlist_lookup_nvlist(zhp->zpool_config,
3085 zpool_find_vdev_by_physpath(zpool_handle_t *zhp, const char *ppath,
3101 nvroot = fnvlist_lookup_nvlist(zhp->zpool_config,
3141 __zpool_find_vdev(zpool_handle_t *zhp, const char *path, boolean_t *avail_spare,
3160 nvroot = fnvlist_lookup_nvlist(zhp->zpool_config,
3187 zpool_find_vdev(zpool_handle_t *zhp, const char *path, boolean_t *avail_spare,
3190 return (__zpool_find_vdev(zhp, path, avail_spare, l2cache, log,
3196 zpool_find_parent_vdev(zpool_handle_t *zhp, const char *path,
3199 return (__zpool_find_vdev(zhp, path, avail_spare, l2cache, log,
3211 zpool_vdev_path_to_guid_impl(zpool_handle_t *zhp, const char *path,
3217 if ((tgt = zpool_find_vdev(zhp, path, &spare, &l2cache,
3233 zpool_vdev_path_to_guid(zpool_handle_t *zhp, const char *path)
3235 return (zpool_vdev_path_to_guid_impl(zhp, path, NULL, NULL, NULL));
3243 zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
3250 libzfs_handle_t *hdl = zhp->zpool_hdl;
3260 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
3261 if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
3273 zpool_get_prop_int(zhp, ZPOOL_PROP_AUTOEXPAND, NULL)) &&
3332 zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp)
3338 libzfs_handle_t *hdl = zhp->zpool_hdl;
3343 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
3344 if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
3386 zpool_vdev_remove_wanted(zpool_handle_t *zhp, const char *path)
3392 libzfs_handle_t *hdl = zhp->zpool_hdl;
3397 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
3398 if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
3416 zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
3420 libzfs_handle_t *hdl = zhp->zpool_hdl;
3425 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
3451 zpool_vdev_set_state(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux,
3456 libzfs_handle_t *hdl = zhp->zpool_hdl;
3462 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
3477 zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
3479 return (zpool_vdev_set_state(zhp, guid, aux, VDEV_STATE_DEGRADED));
3489 zpool_vdev_set_removed_state(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
3491 return (zpool_vdev_set_state(zhp, guid, aux, VDEV_STATE_REMOVED));
3526 zpool_vdev_attach(zpool_handle_t *zhp, const char *old_disk,
3540 libzfs_handle_t *hdl = zhp->zpool_hdl;
3549 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
3550 if ((tgt = zpool_find_vdev(zhp, old_disk, &avail_spare, &l2cache,
3586 config_root = fnvlist_lookup_nvlist(zpool_get_config(zhp, NULL),
3598 (zpool_find_vdev(zhp, newname, &avail_spare, &l2cache,
3624 uint64_t version = zpool_get_prop_int(zhp,
3652 zpool_prop_get_feature(zhp,
3756 zpool_vdev_detach(zpool_handle_t *zhp, const char *path)
3762 libzfs_handle_t *hdl = zhp->zpool_hdl;
3767 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
3768 if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
3820 find_vdev_entry(zpool_handle_t *zhp, nvlist_t **mchild, uint_t mchildren,
3827 char *mpath = zpool_vdev_name(zhp->zpool_hdl, zhp,
3831 char *spath = zpool_vdev_name(zhp->zpool_hdl, zhp,
3853 zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot,
3862 libzfs_handle_t *hdl = zhp->zpool_hdl;
3868 dgettext(TEXT_DOMAIN, "Unable to split %s"), zhp->zpool_name);
3873 if ((config = zpool_get_config(zhp, NULL)) == NULL) {
3884 if ((zc_props = zpool_valid_proplist(hdl, zhp->zpool_name,
3973 (entry = find_vdev_entry(zhp, mchild, mchildren,
4052 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
4095 zpool_vdev_remove(zpool_handle_t *zhp, const char *path)
4101 libzfs_handle_t *hdl = zhp->zpool_hdl;
4113 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
4114 if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
4118 version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL);
4173 zpool_vdev_remove_cancel(zpool_handle_t *zhp)
4177 libzfs_handle_t *hdl = zhp->zpool_hdl;
4182 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
4192 zpool_vdev_indirect_size(zpool_handle_t *zhp, const char *path,
4198 libzfs_handle_t *hdl = zhp->zpool_hdl;
4204 if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
4225 zpool_clear(zpool_handle_t *zhp, const char *path, nvlist_t *rewindnvl)
4232 libzfs_handle_t *hdl = zhp->zpool_hdl;
4243 zhp->zpool_name);
4245 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
4247 if ((tgt = zpool_find_vdev(zhp, path, &avail_spare,
4264 zcmd_alloc_dst_nvlist(hdl, &zc, zhp->zpool_config_size * 2);
4293 zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid)
4297 libzfs_handle_t *hdl = zhp->zpool_hdl;
4303 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
4322 zpool_set_guid(zpool_handle_t *zhp, const uint64_t *guid)
4325 libzfs_handle_t *hdl = zhp->zpool_hdl;
4343 dgettext(TEXT_DOMAIN, "cannot reguid '%s'"), zhp->zpool_name);
4345 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
4361 zpool_reguid(zpool_handle_t *zhp)
4363 return (zpool_set_guid(zhp, NULL));
4370 zpool_reopen_one(zpool_handle_t *zhp, void *data)
4372 libzfs_handle_t *hdl = zpool_get_handle(zhp);
4373 const char *pool_name = zpool_get_name(zhp);
4388 zpool_sync_one(zpool_handle_t *zhp, void *data)
4391 libzfs_handle_t *hdl = zpool_get_handle(zhp);
4392 const char *pool_name = zpool_get_name(zhp);
4421 * If 'zhp' is NULL, then this is an exported pool, and we don't need to do any
4425 zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
4439 if (zhp != NULL && strcmp(type, "root") == 0)
4440 return (zfs_strdup(hdl, zpool_get_name(zhp)));
4539 zpool_add_propname(zpool_handle_t *zhp, const char *propname)
4541 assert(zhp->zpool_n_propnames < ZHP_MAX_PROPNAMES);
4542 zhp->zpool_propnames[zhp->zpool_n_propnames] = propname;
4543 zhp->zpool_n_propnames++;
4551 zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp)
4554 libzfs_handle_t *hdl = zhp->zpool_hdl;
4558 if (fnvlist_lookup_uint64(zhp->zpool_config,
4566 (void) strcpy(zc.zc_name, zhp->zpool_name);
4568 buf = zfs_alloc(zhp->zpool_hdl,
4572 if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_ERROR_LOG,
4636 return (no_memory(zhp->zpool_hdl));
4643 zpool_upgrade(zpool_handle_t *zhp, uint64_t new_version)
4646 libzfs_handle_t *hdl = zhp->zpool_hdl;
4648 (void) strcpy(zc.zc_name, zhp->zpool_name);
4654 zhp->zpool_name));
4695 get_history(zpool_handle_t *zhp, char *buf, uint64_t *off, uint64_t *len)
4698 libzfs_handle_t *hdl = zhp->zpool_hdl;
4700 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
4712 zhp->zpool_name));
4716 "'%s'"), zhp->zpool_name));
4720 "'%s', pool must be upgraded"), zhp->zpool_name));
4724 "cannot get history for '%s'"), zhp->zpool_name));
4738 zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp, uint64_t *off,
4741 libzfs_handle_t *hdl = zhp->zpool_hdl;
4756 if ((err = get_history(zhp, buf, off, &bytes_read)) != 0)
4769 "cannot get history for '%s'"), zhp->zpool_name);
4915 zpool_obj_to_path_impl(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
4931 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
4933 if (zfs_ioctl(zhp->zpool_hdl,
4943 mounted = !always_unmounted && is_mounted(zhp->zpool_hdl, dsname,
4949 if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_OBJ_TO_PATH,
4966 zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
4969 zpool_obj_to_path_impl(zhp, dsobj, obj, pathname, len, B_FALSE);
4973 zpool_obj_to_path_ds(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
4976 zpool_obj_to_path_impl(zhp, dsobj, obj, pathname, len, B_TRUE);
4982 zpool_wait(zpool_handle_t *zhp, zpool_wait_activity_t activity)
4986 int error = zpool_wait_status(zhp, activity, &missing, NULL);
4989 (void) zpool_standard_error_fmt(zhp->zpool_hdl, ENOENT,
4991 zhp->zpool_name);
5009 zpool_wait_status(zpool_handle_t *zhp, zpool_wait_activity_t activity,
5012 int error = lzc_wait(zhp->zpool_name, activity, waited);
5018 (void) zpool_standard_error_fmt(zhp->zpool_hdl, error,
5020 zhp->zpool_name);
5027 zpool_set_bootenv(zpool_handle_t *zhp, const nvlist_t *envmap)
5029 int error = lzc_set_bootenv(zhp->zpool_name, envmap);
5031 (void) zpool_standard_error_fmt(zhp->zpool_hdl, error,
5033 "error setting bootenv in pool '%s'"), zhp->zpool_name);
5040 zpool_get_bootenv(zpool_handle_t *zhp, nvlist_t **nvlp)
5046 error = lzc_get_bootenv(zhp->zpool_name, &nvl);
5048 (void) zpool_standard_error_fmt(zhp->zpool_hdl, error,
5050 "error getting bootenv in pool '%s'"), zhp->zpool_name);
5298 zpool_vdev_guid(zpool_handle_t *zhp, const char *vdevname, uint64_t *vdev_guid)
5303 verify(zhp != NULL);
5304 if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
5308 return (zfs_error(zhp->zpool_hdl, EZFS_POOLUNAVAIL, errbuf));
5311 if ((tgt = zpool_find_vdev(zhp, vdevname, &avail_spare, &l2cache,
5316 vdevname, zhp->zpool_name);
5317 return (zfs_error(zhp->zpool_hdl, EZFS_NODEVICE, errbuf));
5503 zpool_get_vdev_prop(zpool_handle_t *zhp, const char *vdevname, vdev_prop_t prop,
5512 if ((ret = zpool_vdev_guid(zhp, vdevname, &vdev_guid)) != 0)
5516 return (no_memory(zhp->zpool_hdl));
5518 return (no_memory(zhp->zpool_hdl));
5535 return (no_memory(zhp->zpool_hdl));
5540 ret = lzc_get_vdev_prop(zhp->zpool_name, reqnvl, &retprops);
5549 " %s in %s"), prop_name, vdevname, zhp->zpool_name);
5550 (void) zpool_standard_error(zhp->zpool_hdl, ret, errbuf);
5564 zpool_get_all_vdev_props(zpool_handle_t *zhp, const char *vdevname,
5571 if ((ret = zpool_vdev_guid(zhp, vdevname, &vdev_guid)) != 0)
5575 return (no_memory(zhp->zpool_hdl));
5579 ret = lzc_get_vdev_prop(zhp->zpool_name, nvl, outnvl);
5587 " %s in %s"), vdevname, zhp->zpool_name);
5588 (void) zpool_standard_error(zhp->zpool_hdl, errno, errbuf);
5598 zpool_set_vdev_prop(zpool_handle_t *zhp, const char *vdevname,
5610 if ((ret = zpool_vdev_guid(zhp, vdevname, &vdev_guid)) != 0)
5614 return (no_memory(zhp->zpool_hdl));
5616 return (no_memory(zhp->zpool_hdl));
5622 return (no_memory(zhp->zpool_hdl));
5628 propname, vdevname, zhp->zpool_name);
5631 version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL);
5632 if ((realprops = zpool_valid_proplist(zhp->zpool_hdl,
5633 zhp->zpool_name, props, version, flags, errbuf)) == NULL) {
5644 ret = lzc_set_vdev_prop(zhp->zpool_name, nvl, &outnvl);
5651 (void) zpool_standard_error(zhp->zpool_hdl, errno, errbuf);
5660 zpool_ddt_prune(zpool_handle_t *zhp, zpool_ddt_prune_unit_t unit,
5663 int error = lzc_ddt_prune(zhp->zpool_name, unit, amount);
5665 libzfs_handle_t *hdl = zhp->zpool_hdl;
5669 "cannot prune dedup table on '%s'"), zhp->zpool_name);