xref: /titanic_51/usr/src/uts/intel/zfs/spa_boot.c (revision 283b84606b6fc326692c03273de1774e8c122f9a)
1e7cbe64fSgw25295 /*
2e7cbe64fSgw25295  * CDDL HEADER START
3e7cbe64fSgw25295  *
4e7cbe64fSgw25295  * The contents of this file are subject to the terms of the
5e7cbe64fSgw25295  * Common Development and Distribution License (the "License").
6e7cbe64fSgw25295  * You may not use this file except in compliance with the License.
7e7cbe64fSgw25295  *
8e7cbe64fSgw25295  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e7cbe64fSgw25295  * or http://www.opensolaris.org/os/licensing.
10e7cbe64fSgw25295  * See the License for the specific language governing permissions
11e7cbe64fSgw25295  * and limitations under the License.
12e7cbe64fSgw25295  *
13e7cbe64fSgw25295  * When distributing Covered Code, include this CDDL HEADER in each
14e7cbe64fSgw25295  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15e7cbe64fSgw25295  * If applicable, add the following below this CDDL HEADER, with the
16e7cbe64fSgw25295  * fields enclosed by brackets "[]" replaced with your own identifying
17e7cbe64fSgw25295  * information: Portions Copyright [yyyy] [name of copyright owner]
18e7cbe64fSgw25295  *
19e7cbe64fSgw25295  * CDDL HEADER END
20e7cbe64fSgw25295  */
21e7cbe64fSgw25295 
22e7cbe64fSgw25295 /*
23b24ab676SJeff Bonwick  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24e7cbe64fSgw25295  * Use is subject to license terms.
25e7cbe64fSgw25295  */
26e7cbe64fSgw25295 
27*283b8460SGeorge.Wilson /*
28*283b8460SGeorge.Wilson  * Copyright (c) 2012 by Delphix. All rights reserved.
29*283b8460SGeorge.Wilson  */
30*283b8460SGeorge.Wilson 
31b24ab676SJeff Bonwick #include <sys/zio.h>
32e7cbe64fSgw25295 #include <sys/spa.h>
33e7cbe64fSgw25295 #include <sys/sunddi.h>
34*283b8460SGeorge.Wilson #include <sys/x86_archext.h>
35*283b8460SGeorge.Wilson 
36*283b8460SGeorge.Wilson extern int zfs_deadman_enabled;
37e7cbe64fSgw25295 
38e7cbe64fSgw25295 char *
39051aabe6Staylor spa_get_bootprop(char *propname)
40e7cbe64fSgw25295 {
41051aabe6Staylor 	char *value;
42e7cbe64fSgw25295 
43e7cbe64fSgw25295 	if (ddi_prop_lookup_string(DDI_DEV_T_ANY, ddi_root_node(),
44051aabe6Staylor 	    DDI_PROP_DONTPASS, propname, &value) != DDI_SUCCESS)
45e7cbe64fSgw25295 		return (NULL);
46051aabe6Staylor 	return (value);
47e7cbe64fSgw25295 }
48e7cbe64fSgw25295 
49e7cbe64fSgw25295 void
50051aabe6Staylor spa_free_bootprop(char *value)
51e7cbe64fSgw25295 {
52051aabe6Staylor 	ddi_prop_free(value);
53e7cbe64fSgw25295 }
54*283b8460SGeorge.Wilson 
55*283b8460SGeorge.Wilson void
56*283b8460SGeorge.Wilson spa_arch_init(void)
57*283b8460SGeorge.Wilson {
58*283b8460SGeorge.Wilson 	/*
59*283b8460SGeorge.Wilson 	 * Configure the default settings for the zfs deadman unless
60*283b8460SGeorge.Wilson 	 * overriden by /etc/system.
61*283b8460SGeorge.Wilson 	 */
62*283b8460SGeorge.Wilson 	if (zfs_deadman_enabled == -1) {
63*283b8460SGeorge.Wilson 		/*
64*283b8460SGeorge.Wilson 		 * Disable the zfs deadman logic on VMware deployments.
65*283b8460SGeorge.Wilson 		 */
66*283b8460SGeorge.Wilson 		if (get_hwenv() == HW_VMWARE)
67*283b8460SGeorge.Wilson 			zfs_deadman_enabled = 0;
68*283b8460SGeorge.Wilson 		else
69*283b8460SGeorge.Wilson 			zfs_deadman_enabled = 1;
70*283b8460SGeorge.Wilson 	}
71*283b8460SGeorge.Wilson }
72