diff options
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/fm/fmd/common/fmd_dr.c | 2 | ||||
| -rw-r--r-- | usr/src/cmd/fm/fmd/common/fmd_topo.c | 19 | ||||
| -rw-r--r-- | usr/src/cmd/fm/fmd/common/fmd_topo.h | 5 | ||||
| -rw-r--r-- | usr/src/lib/fm/topo/libtopo/common/libtopo.h | 4 | ||||
| -rw-r--r-- | usr/src/lib/fm/topo/libtopo/common/mapfile-vers | 1 | ||||
| -rw-r--r-- | usr/src/lib/fm/topo/libtopo/common/topo_snap.c | 50 | ||||
| -rw-r--r-- | usr/src/lib/fm/topo/libtopo/common/topo_subr.c | 4 | ||||
| -rw-r--r-- | usr/src/lib/fm/topo/libtopo/common/topo_subr.h | 4 |
8 files changed, 27 insertions, 62 deletions
diff --git a/usr/src/cmd/fm/fmd/common/fmd_dr.c b/usr/src/cmd/fm/fmd/common/fmd_dr.c index 3b5eba87aa..e4fec10d08 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_dr.c +++ b/usr/src/cmd/fm/fmd/common/fmd_dr.c @@ -134,7 +134,7 @@ fmd_dr_event(sysevent_t *sep) (void) pthread_mutex_unlock(&fmd.d_stats_lock); TRACE((FMD_DBG_XPRT, "dr event %p, gen=%llu", (void *)sep, gen)); - fmd_topo_update(B_FALSE); + fmd_topo_update(); ftp = fmd_topo_hold(); e = fmd_event_create(FMD_EVT_TOPO, ftp->ft_time_end, NULL, ftp); diff --git a/usr/src/cmd/fm/fmd/common/fmd_topo.c b/usr/src/cmd/fm/fmd/common/fmd_topo.c index 3173f82ce1..a7d80b4396 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_topo.c +++ b/usr/src/cmd/fm/fmd/common/fmd_topo.c @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -61,7 +60,7 @@ fmd_topo_rele_locked(fmd_topo_t *ftp) } void -fmd_topo_update(boolean_t need_force) +fmd_topo_update(void) { int err; topo_hdl_t *tp; @@ -87,15 +86,9 @@ fmd_topo_update(boolean_t need_force) ftp->ft_hdl = tp; ftp->ft_time_begin = fmd_time_gethrtime(); - if (need_force) { - if ((id = topo_snap_hold(tp, NULL, &err)) == NULL) - fmd_panic("failed to get topology snapshot: %s", - topo_strerror(err)); - } else { - if ((id = topo_snap_hold_no_forceload(tp, NULL, &err)) == NULL) - fmd_panic("failed to get topology snapshot: %s", - topo_strerror(err)); - } + if ((id = topo_snap_hold(tp, NULL, &err)) == NULL) + fmd_panic("failed to get topology snapshot: %s", + topo_strerror(err)); topo_hdl_strfree(tp, id); @@ -166,7 +159,7 @@ fmd_topo_rele_hdl(topo_hdl_t *thp) void fmd_topo_init(void) { - fmd_topo_update(B_TRUE); + fmd_topo_update(); } void diff --git a/usr/src/cmd/fm/fmd/common/fmd_topo.h b/usr/src/cmd/fm/fmd/common/fmd_topo.h index 9b53e8ab8a..faabb66b24 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_topo.h +++ b/usr/src/cmd/fm/fmd/common/fmd_topo.h @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _FMD_TOPO_H @@ -45,7 +44,7 @@ typedef struct fmd_topo { hrtime_t ft_time_end; } fmd_topo_t; -extern void fmd_topo_update(boolean_t); +extern void fmd_topo_update(void); extern fmd_topo_t *fmd_topo_hold(void); extern void fmd_topo_addref(fmd_topo_t *); extern void fmd_topo_rele(fmd_topo_t *); diff --git a/usr/src/lib/fm/topo/libtopo/common/libtopo.h b/usr/src/lib/fm/topo/libtopo/common/libtopo.h index a79476e6c4..9b7102f882 100644 --- a/usr/src/lib/fm/topo/libtopo/common/libtopo.h +++ b/usr/src/lib/fm/topo/libtopo/common/libtopo.h @@ -20,8 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _LIBTOPO_H @@ -60,7 +59,6 @@ typedef struct topo_faclist { extern topo_hdl_t *topo_open(int, const char *, int *); extern void topo_close(topo_hdl_t *); extern char *topo_snap_hold(topo_hdl_t *, const char *, int *); -extern char *topo_snap_hold_no_forceload(topo_hdl_t *, const char *, int *); extern void topo_snap_release(topo_hdl_t *); /* diff --git a/usr/src/lib/fm/topo/libtopo/common/mapfile-vers b/usr/src/lib/fm/topo/libtopo/common/mapfile-vers index b8aba822c2..1cde0dee1f 100644 --- a/usr/src/lib/fm/topo/libtopo/common/mapfile-vers +++ b/usr/src/lib/fm/topo/libtopo/common/mapfile-vers @@ -188,7 +188,6 @@ SYMBOL_VERSION SUNWprivate { topo_sensor_units_name; topo_stability2name; topo_snap_hold; - topo_snap_hold_no_forceload; topo_snap_release; topo_strerror; topo_walk_fini; diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_snap.c b/usr/src/lib/fm/topo/libtopo/common/topo_snap.c index 638d8c0677..53d91cd838 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_snap.c +++ b/usr/src/lib/fm/topo/libtopo/common/topo_snap.c @@ -292,8 +292,14 @@ topo_snap_create(topo_hdl_t *thp, int *errp, boolean_t need_force) return (NULL); } - thp->th_di = di_init("/", (need_force ? DINFOFORCE : 0) | - DINFOSUBTREE | DINFOMINOR | DINFOPROP | DINFOPATH); + if (need_force) { + topo_dprintf(thp, TOPO_DBG_FORCE, + "taking a DINFOFORCE snapshot\n"); + thp->th_di = di_init("/", DINFOFORCE | + DINFOSUBTREE | DINFOMINOR | DINFOPROP | DINFOPATH); + } else { + thp->th_di = di_init("/", DINFOCACHE); + } thp->th_pi = di_prom_init(); if (topo_tree_enum_all(thp) < 0) { @@ -374,46 +380,16 @@ topo_snap_hold(topo_hdl_t *thp, const char *uuid, int *errp) if (uuid == NULL) { char *ret; - ret = topo_snap_create(thp, errp, B_TRUE); - - /* - * Now walk the tree and invoke any facility enumeration methods - */ - if (ret != NULL && getzoneid() == 0) { - if ((twp = topo_walk_init(thp, FM_FMRI_SCHEME_HC, - fac_walker, (void *)0, errp)) == NULL) { - return (ret); - } - (void) topo_walk_step(twp, TOPO_WALK_CHILD); - topo_walk_fini(twp); + if (thp->th_debug & TOPO_DBG_FORCE) { + ret = topo_snap_create(thp, errp, B_TRUE); + } else { + ret = topo_snap_create(thp, errp, B_FALSE); } - return (ret); - } - return (topo_snap_log_create(thp, uuid, errp)); -} - -/* - * Return snapshot id. This variant calls di_init() without DINFOFORCE, - * and is intended for use on DR events where there is no need to force - * attach of all devices. - */ -char * -topo_snap_hold_no_forceload(topo_hdl_t *thp, const char *uuid, int *errp) -{ - topo_walk_t *twp; - - if (thp == NULL) - return (NULL); - - if (uuid == NULL) { - char *ret; - - ret = topo_snap_create(thp, errp, B_FALSE); /* * Now walk the tree and invoke any facility enumeration methods */ - if (ret != NULL) { + if (ret != NULL && getzoneid() == 0) { if ((twp = topo_walk_init(thp, FM_FMRI_SCHEME_HC, fac_walker, (void *)0, errp)) == NULL) { return (ret); diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_subr.c b/usr/src/lib/fm/topo/libtopo/common/topo_subr.c index 28831ae0fa..7a6ed4be77 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_subr.c +++ b/usr/src/lib/fm/topo/libtopo/common/topo_subr.c @@ -20,8 +20,7 @@ */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <alloca.h> @@ -98,6 +97,7 @@ static const topo_debug_mode_t _topo_dbflag_modes[] = { TOPO_DBG_MODSVC }, { "walk", "walker subsystem debug messages enabled", TOPO_DBG_WALK }, { "xml", "xml file parsing messages enabled", TOPO_DBG_XML }, + { "devinfoforce", "devinfo DINFOFORCE snapshot used", TOPO_DBG_FORCE }, { "all", "all debug modes enabled", TOPO_DBG_ALL}, { NULL, NULL, 0 } }; diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_subr.h b/usr/src/lib/fm/topo/libtopo/common/topo_subr.h index 6cc4674bb6..ecb076b08a 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_subr.h +++ b/usr/src/lib/fm/topo/libtopo/common/topo_subr.h @@ -20,8 +20,7 @@ */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _TOPO_SUBR_H @@ -51,6 +50,7 @@ typedef struct topo_debug_mode { #define TOPO_DBG_MODSVC 0x0004 /* enable module services debug messages */ #define TOPO_DBG_WALK 0x0008 /* enable walker debug messages */ #define TOPO_DBG_XML 0x0010 /* enable xml parsing debug messages */ +#define TOPO_DBG_FORCE 0x0020 /* use DINFOFORCE snapshot for topology */ #define TOPO_DBG_ALL 0xffff /* enable all debug modes */ #define TOPO_STABSTR_INTERNAL "Internal" /* private to libtopo */ |
