Print this page
LOCAL: libtopo obsessed with fac_prov_ipmi

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/fm/topo/libtopo/common/topo_xml.c
          +++ new/usr/src/lib/fm/topo/libtopo/common/topo_xml.c
↓ open down ↓ 1368 lines elided ↑ open up ↑
1369 1369              "fac_enum_process() called for %s=%d\n", topo_node_name(ptn),
1370 1370              topo_node_instance(ptn));
1371 1371  
1372 1372          for (cn = pn->xmlChildrenNode; cn != NULL; cn = cn->next) {
1373 1373  
1374 1374                  if (xmlStrcmp(cn->name, (xmlChar *)"fac-enum") != 0)
1375 1375                          continue;
1376 1376  
1377 1377                  if ((fprov = xmlGetProp(cn, (xmlChar *)Provider)) == NULL)
1378 1378                          goto fenumdone;
1379      -
1380      -                if (xmlStrcmp(fprov, (xmlChar *)"fac_prov_ipmi") != 0) {
1381      -                        topo_dprintf(mp->tm_hdl, TOPO_DBG_XML,
1382      -                            "Invalid provider specified: %s\n", fprov);
1383      -                        goto fenumdone;
1384      -                }
1385      -
1386 1379                  /*
1387      -                 * Invoke enum entry point in fac provider which will cause the
1388      -                 * facility enumeration node method to be registered.
     1380 +                 * Invoke enum entry point in facility provider which will
     1381 +                 * cause the facility enumeration node method to be
     1382 +                 * registered.
1389 1383                   */
1390 1384                  if (fac_enum_run(mp, ptn, (const char *)fprov) != 0) {
1391 1385                          topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR,
1392 1386                              "fac_enum_process: enum entry point failed!\n");
1393 1387                          goto fenumdone;
1394 1388                  }
1395 1389                  xmlFree(fprov);
1396 1390          }
1397 1391          return (0);
1398 1392  fenumdone:
↓ open down ↓ 34 lines elided ↑ open up ↑
1433 1427                  if ((ftype = xmlGetProp(cn, (xmlChar *)Type)) == NULL)
1434 1428                          goto facdone;
1435 1429  
1436 1430                  if ((provider = xmlGetProp(cn, (xmlChar *)Provider)) == NULL)
1437 1431                          goto facdone;
1438 1432  
1439 1433                  if (xmlStrcmp(ftype, (xmlChar *)Sensor) != 0 &&
1440 1434                      xmlStrcmp(ftype, (xmlChar *)Indicator) != 0)
1441 1435                          goto facdone;
1442 1436  
1443      -                if (xmlStrcmp(provider, (xmlChar *)"fac_prov_ipmi") != 0) {
1444      -                        topo_dprintf(mp->tm_hdl, TOPO_DBG_XML, "fac_process: "
1445      -                            "Invalid provider attr value: %s\n", provider);
1446      -                        goto facdone;
1447      -                }
1448      -
1449 1437                  if ((ntn = topo_node_facbind(mp, ptn, (char *)fname,
1450 1438                      (char *)ftype)) == NULL)
1451 1439                          goto facdone;
1452 1440  
1453 1441                  pgi.tpi_name = TOPO_PGROUP_FACILITY;
1454 1442                  pgi.tpi_namestab = TOPO_STABILITY_PRIVATE;
1455 1443                  pgi.tpi_datastab = TOPO_STABILITY_PRIVATE;
1456 1444                  pgi.tpi_version = 1;
1457 1445                  if (topo_pgroup_create(ntn, &pgi, &err) != 0) {
1458 1446                          if (err != ETOPO_PROP_DEFD) {
1459 1447                                  topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR,
1460 1448                                      "pgroups create failure: %s\n",
1461 1449                                      topo_strerror(err));
1462 1450                                  return (-1);
1463 1451                          }
1464 1452                  }
1465 1453                  /*
1466      -                 * Invoke enum entry point in fac_prov_ipmi module, which will
1467      -                 * cause the provider methods to be registered on this node
     1454 +                 * Invoke enum entry point in the facility provider module,
     1455 +                 * which will cause the provider methods to be registered on
     1456 +                 * this node
1468 1457                   */
1469 1458                  if (fac_enum_run(mp, ntn, (const char *)provider) != 0) {
1470 1459                          topo_dprintf(mp->tm_hdl, TOPO_DBG_ERR, "fac_process: "
1471 1460                              "enum entry point failed for provider %s!\n",
1472 1461                              provider);
1473 1462                          goto facdone;
1474 1463                  }
1475 1464  
1476 1465                  if ((newi = tf_idata_new(mp, 0, ntn)) == NULL)
1477 1466                          goto facdone;
↓ open down ↓ 670 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX