Lines Matching defs:thp
128 print_node(topo_hdl_t *thp, tnode_t *node, nvlist_t *nvl, const char *fmri)
140 (void) topo_fmri_nvl2str(thp, asru, &aname, &err);
142 (void) topo_fmri_nvl2str(thp, fru, &fname, &err);
147 topo_hdl_strfree(thp, aname);
154 topo_hdl_strfree(thp, fname);
160 topo_hdl_strfree(thp, lname);
167 if ((ret = topo_fmri_present(thp, nvl, &err)) < 0)
173 if ((ret = topo_fmri_unusable(thp, nvl, &err)) < 0)
239 print_prop_nameval(topo_hdl_t *thp, tnode_t *node, nvlist_t *nvl)
404 if (topo_fmri_nvl2str(thp, val, &fmri, &err) != 0) {
418 topo_hdl_strfree(thp, fmri);
480 print_pgroup(topo_hdl_t *thp, tnode_t *node, const char *pgn, char *dstab,
512 topo_hdl_strfree(thp, (char *)pgi->tpi_name);
513 topo_hdl_free(thp, pgi, sizeof (topo_pgroup_info_t));
518 print_all_props(topo_hdl_t *thp, tnode_t *node, nvlist_t *p_nv,
572 print_pgroup(thp, node, pgn, dstab, nstab,
584 print_prop_nameval(thp, node, pv_nv);
596 set_prop(topo_hdl_t *thp, tnode_t *node, nvlist_t *fmri, struct prop_args *pp)
685 if ((ret = topo_fmri_str2nvl(thp, pp->value, &val,
715 if ((ret = topo_fmri_setprop(thp, fmri, pp->group, nvl,
738 if ((ret = topo_fmri_getprop(thp, fmri, pp->group, pp->prop,
746 print_pgroup(thp, node, pp->group, NULL, NULL, 0);
747 print_prop_nameval(thp, node, nvl);
754 print_props(topo_hdl_t *thp, tnode_t *node)
788 print_all_props(thp, node, nvl,
802 print_pgroup(thp, node, pp->group, NULL,
804 print_prop_nameval(thp, node, nvl);
808 set_prop(thp, node, NULL, pp);
815 walk_node(topo_hdl_t *thp, tnode_t *node, void *arg)
832 if (topo_fmri_nvl2str(thp, rsrc, &s, &err) < 0) {
842 topo_hdl_strfree(thp, s);
846 print_node(thp, node, rsrc, s);
847 topo_hdl_strfree(thp, s);
867 print_all_props(thp, node, nvl, ALL);
871 print_props(thp, node);
954 walk_topo(topo_hdl_t *thp, char *uuid)
965 if ((twp = topo_walk_init(thp, opt_s, walk_node, NULL, &err))
1001 print_fmri_pgroup(topo_hdl_t *thp, const char *pgn, nvlist_t *nvl)
1012 print_pgroup(thp, NULL, pgn, dstab, nstab, version);
1023 print_prop_nameval(thp, NULL, pnvl);
1031 print_fmri_props(topo_hdl_t *thp, nvlist_t *nvl)
1056 if (topo_fmri_getpgrp(thp, nvl, pp->group,
1063 print_fmri_pgroup(thp, pp->group,
1069 if (topo_fmri_getprop(thp, nvl, pp->group, pp->prop,
1077 print_fmri_pgroup(thp, pp->group, pnvl);
1078 print_prop_nameval(thp, NULL, pnvl);
1082 set_prop(thp, NULL, nvl, pp);
1088 print_fmri(topo_hdl_t *thp, char *uuid)
1095 if (topo_fmri_str2nvl(thp, g_fmri, &nvl, &err) < 0) {
1113 if (topo_fmri_asru(thp, nvl, &asru, &err) == 0)
1114 (void) topo_fmri_nvl2str(thp, asru, &aname, &err);
1115 if (topo_fmri_fru(thp, nvl, &fru, &err) == 0)
1116 (void) topo_fmri_nvl2str(thp, fru, &fname, &err);
1117 (void) topo_fmri_label(thp, nvl, &lname, &err);
1124 topo_hdl_strfree(thp, aname);
1130 topo_hdl_strfree(thp, fname);
1136 topo_hdl_strfree(thp, lname);
1143 if (topo_fmri_str2nvl(thp, g_fmri, &nvl, &err) < 0) {
1149 if ((ret = topo_fmri_present(thp, nvl, &err)) < 0)
1155 if ((ret = topo_fmri_unusable(thp, nvl, &err)) < 0)
1165 print_fmri_props(thp, nvl);
1169 fmtopo_exit(topo_hdl_t *thp, char *uuid, int err)
1172 topo_hdl_strfree(thp, uuid);
1174 if (thp != NULL) {
1175 topo_snap_release(thp);
1176 topo_close(thp);
1192 topo_hdl_t *thp = NULL;
1259 if ((thp = topo_open(TOPO_VERSION, opt_R, &err)) == NULL) {
1262 return (fmtopo_exit(thp, uuid, FMTOPO_EXIT_ERROR));
1266 topo_debug_set(thp, "module", "stderr");
1268 if ((uuid = topo_snap_hold(thp, NULL, &err)) == NULL) {
1271 return (fmtopo_exit(thp, uuid, FMTOPO_EXIT_ERROR));
1285 return (fmtopo_exit(thp, uuid, FMTOPO_EXIT_USAGE));
1289 if (topo_xml_print(thp, stdout, opt_s, &err) < 0)
1294 return (fmtopo_exit(thp, uuid, err ? FMTOPO_EXIT_ERROR :
1298 if (opt_t || walk_topo(thp, uuid) < 0) {
1303 print_fmri(thp, uuid);
1305 return (fmtopo_exit(thp, uuid, FMTOPO_EXIT_ERROR));
1308 return (fmtopo_exit(thp, uuid, FMTOPO_EXIT_SUCCESS));