Changeset 43835 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 8, 2012 6:43:02 AM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/solaris/PerformanceSolaris.cpp
r43831 r43835 79 79 void updateFilesystemMap(void); 80 80 RTCString physToInstName(const char *pcszPhysName); 81 RTCString pathToInstName(const char *pcszDevPathName); 81 82 82 83 kstat_ctl_t *mKC; … … 539 540 } 540 541 542 RTCString CollectorSolaris::pathToInstName(const char *pcszDevPathName) 543 { 544 char szLink[RTPATH_MAX]; 545 if (readlink(pcszDevPathName, szLink, sizeof(szLink)) != -1) 546 { 547 char *pszStart, *pszEnd; 548 pszStart = strstr(szLink, "/devices/"); 549 pszEnd = strrchr(szLink, ':'); 550 if (pszStart && pszEnd) 551 { 552 pszStart += 8; // Skip "/devices" 553 *pszEnd = '\0'; // Trim partition 554 return physToInstName(pszStart); 555 } 556 } 557 558 return RTCString(pcszDevPathName); 559 } 560 541 561 int CollectorSolaris::getDiskListByFs(const char *name, DiskList& list) 542 562 { … … 546 566 547 567 RTCString strName = it->second.substr(0, it->second.find("/")); 548 if (mZpoolOpen && mZpoolClose && mZpoolGetConfig )568 if (mZpoolOpen && mZpoolClose && mZpoolGetConfig && !strName.isEmpty()) 549 569 { 550 570 zpool_handle_t *zh = mZpoolOpen(mZfsLib, strName.c_str()); … … 591 611 } 592 612 else 593 list.push_back( RTCString(name));613 list.push_back(pathToInstName(it->second.c_str())); 594 614 return VINF_SUCCESS; 595 615 } -
trunk/src/VBox/Main/testcase/tstCollector.cpp
r43831 r43835 246 246 if (RT_FAILURE(rc)) 247 247 { 248 RTPrintf("tstCollector: getRawHost NetworkLoad() -> %Rrc\n", rc);248 RTPrintf("tstCollector: getRawHostDiskLoad() -> %Rrc\n", rc); 249 249 return 1; 250 250 } … … 261 261 if (RT_FAILURE(rc)) 262 262 { 263 RTPrintf("tstCollector: getRawHost NetworkLoad() -> %Rrc\n", rc);263 RTPrintf("tstCollector: getRawHostDiskLoad() -> %Rrc\n", rc); 264 264 return 1; 265 265 }
Note:
See TracChangeset
for help on using the changeset viewer.