Deleted Added
sdiff udiff text old ( 224171 ) new ( 228103 )
full compact
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25/*
26 * Pool import support functions.
27 *
28 * To import a pool, we rely on reading the configuration information from the
29 * ZFS label of each device. If we successfully read the label, then we
30 * organize the configuration information in the following hierarchy:

--- 399 unchanged lines hidden (view full) ---

430 pool_entry_t *pe;
431 vdev_entry_t *ve;
432 config_entry_t *ce;
433 nvlist_t *ret = NULL, *config = NULL, *tmp, *nvtop, *nvroot;
434 nvlist_t **spares, **l2cache;
435 uint_t i, nspares, nl2cache;
436 boolean_t config_seen;
437 uint64_t best_txg;
438 char *name, *hostname;
439 uint64_t version, guid;
440 uint_t children = 0;
441 nvlist_t **child = NULL;
442 uint_t holes;
443 uint64_t *hole_array, max_id;
444 uint_t c;
445 boolean_t isactive;
446 uint64_t hostid;

--- 72 unchanged lines hidden (view full) ---

519 if (!config_seen) {
520 /*
521 * Copy the relevant pieces of data to the pool
522 * configuration:
523 *
524 * version
525 * pool guid
526 * name
527 * pool state
528 * hostid (if available)
529 * hostname (if available)
530 */
531 uint64_t state;
532
533 verify(nvlist_lookup_uint64(tmp,
534 ZPOOL_CONFIG_VERSION, &version) == 0);

--- 5 unchanged lines hidden (view full) ---

540 if (nvlist_add_uint64(config,
541 ZPOOL_CONFIG_POOL_GUID, guid) != 0)
542 goto nomem;
543 verify(nvlist_lookup_string(tmp,
544 ZPOOL_CONFIG_POOL_NAME, &name) == 0);
545 if (nvlist_add_string(config,
546 ZPOOL_CONFIG_POOL_NAME, name) != 0)
547 goto nomem;
548 verify(nvlist_lookup_uint64(tmp,
549 ZPOOL_CONFIG_POOL_STATE, &state) == 0);
550 if (nvlist_add_uint64(config,
551 ZPOOL_CONFIG_POOL_STATE, state) != 0)
552 goto nomem;
553 hostid = 0;
554 if (nvlist_lookup_uint64(tmp,
555 ZPOOL_CONFIG_HOSTID, &hostid) == 0) {
556 if (nvlist_add_uint64(config,
557 ZPOOL_CONFIG_HOSTID, hostid) != 0)
558 goto nomem;
559 verify(nvlist_lookup_string(tmp,
560 ZPOOL_CONFIG_HOSTNAME,

--- 1166 unchanged lines hidden ---