ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * CDDL HEADER START
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * The contents of this file are subject to the terms of the
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * Common Development and Distribution License (the "License").
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * You may not use this file except in compliance with the License.
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * See the License for the specific language governing permissions
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * and limitations under the License.
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * When distributing Covered Code, include this CDDL HEADER in each
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * If applicable, add the following below this CDDL HEADER, with the
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * fields enclosed by brackets "[]" replaced with your own identifying
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * information: Portions Copyright [yyyy] [name of copyright owner]
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * CDDL HEADER END
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
6df8993a38afb6d317b6683918241d0656eecdbaGarrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
990b4856d0eaada6f8140335733a1b1771ed2746lling if (zpool_get_prop_int(zhp, ZPOOL_PROP_GUID, NULL) == cbp->cb_guid) {
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock return (1);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock return (0);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockfmd_fmri_nvl2str(nvlist_t *nvl, char *buf, size_t buflen)
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock (void) nvlist_lookup_uint64(nvl, FM_FMRI_ZFS_POOL, &pool_guid);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * Attempt to convert the pool guid to a name.
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock (void) snprintf(guidbuf, sizeof (guidbuf), "%llx", pool_guid);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock if (nvlist_lookup_uint64(nvl, FM_FMRI_ZFS_VDEV, &vdev_guid) == 0)
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock len = snprintf(buf, buflen, "%s://pool=%s/vdev=%llx",
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &guid);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
6df8993a38afb6d317b6683918241d0656eecdbaGarrett D'Amore for (c = 0; c < children; c++)
6df8993a38afb6d317b6683918241d0656eecdbaGarrett D'Amore if ((ret = find_vdev_iter(child[c], search)) != 0)
c5904d138f3bdf0762dbf452a43d5a5c387ea6a8eschrock if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
6df8993a38afb6d317b6683918241d0656eecdbaGarrett D'Amore for (c = 0; c < children; c++)
6df8993a38afb6d317b6683918241d0656eecdbaGarrett D'Amore if ((ret = find_vdev_iter(child[c], search)) != 0)
6df8993a38afb6d317b6683918241d0656eecdbaGarrett D'Amore if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
6df8993a38afb6d317b6683918241d0656eecdbaGarrett D'Amore for (c = 0; c < children; c++)
6df8993a38afb6d317b6683918241d0656eecdbaGarrett D'Amore if ((ret = find_vdev_iter(child[c], search)) != 0)
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock (void) nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nvroot);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock (void) nvlist_lookup_uint64(nvl, FM_FMRI_ZFS_POOL, &pool_guid);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock return (0);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock if (nvlist_lookup_uint64(nvl, FM_FMRI_ZFS_VDEV, &vdev_guid) != 0) {
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock return (1);
46b28a98f70a2da2a80c8dade6586885a4241f7fStephen Hanson (void) nvlist_lookup_uint64(nvl, FM_FMRI_ZFS_POOL, &pool_guid);
46b28a98f70a2da2a80c8dade6586885a4241f7fStephen Hanson if (nvlist_lookup_uint64(nvl, FM_FMRI_ZFS_VDEV, &vdev_guid) != 0) {
46b28a98f70a2da2a80c8dade6586885a4241f7fStephen Hanson ret = (find_vdev(cb.cb_pool, vdev_guid) != NULL) ?
46b28a98f70a2da2a80c8dade6586885a4241f7fStephen Hanson FMD_OBJ_STATE_STILL_PRESENT : FMD_OBJ_STATE_NOT_PRESENT;
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock (void) nvlist_lookup_uint64(nvl, FM_FMRI_ZFS_POOL, &pool_guid);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock return (1);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock if (nvlist_lookup_uint64(nvl, FM_FMRI_ZFS_VDEV, &vdev_guid) != 0) {
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock ret = (zpool_get_state(cb.cb_pool) == POOL_STATE_UNAVAIL);
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling (void) nvlist_lookup_uint64_array(vd, ZPOOL_CONFIG_VDEV_STATS,
99653d4ee642c6528e88224f12409a5f23060994eschrock return (-1);
99653d4ee642c6528e88224f12409a5f23060994eschrock return (0);