Changeset 43715 in vbox for trunk/src/VBox/Main/src-server/linux
- Timestamp:
- Oct 24, 2012 8:32:14 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/linux/PerformanceLinux.cpp
r43629 r43715 28 28 #include <iprt/err.h> 29 29 #include <iprt/param.h> 30 #include <iprt/path.h> 30 31 #include <iprt/string.h> 31 32 #include <iprt/mp.h> … … 36 37 #include "Logging.h" 37 38 #include "Performance.h" 39 40 #define VBOXVOLINFO_NAME "VBoxVolInfo" 38 41 39 42 namespace pm { … … 365 368 } 366 369 370 static void addVolumeDependencies(const char *pcszVolume, DiskList& listDisks) 371 { 372 char szVolInfo[RTPATH_MAX]; 373 int rc = RTPathExecDir(szVolInfo, sizeof(szVolInfo) - sizeof("/" VBOXVOLINFO_NAME " ") - strlen(pcszVolume)); 374 if (RT_FAILURE(rc)) 375 { 376 LogRel(("VolInfo: Failed to get program path, rc=%Rrc\n", rc)); 377 return VERR_INVALID_PARAMETER; 378 } 379 strcat(szVolInfo, "/" VBOXVOLINFO_NAME " "); 380 strcat(szVolInfo, pcszVolume); 381 382 FILE *fp = popen(szVolInfo, "r"); 383 if (fp) 384 { 385 char szBuf[128]; 386 387 while (fgets(szBuf, sizeof(szBuf), fp)) 388 listDisks.push_back(RTCString(szBuf)); 389 390 pclose(fp); 391 } 392 else 393 listDisks.push_back(RTCString(pcszVolume)); 394 } 367 395 368 396 int getDiskListByFs(const char *pszPath, DiskList& listDisks) … … 376 404 if (strcmp(pszPath, mntent->mnt_dir) == 0) 377 405 { 378 char szDevName[32]; 379 listDisks.push_back(RTCString(getDiskName(szDevName, sizeof(szDevName), mntent->mnt_fsname))); 406 char szDevName[128]; 407 getDiskName(szDevName, sizeof(szDevName), mntent->mnt_fsname); 408 if (strncmp(mntent->mnt_fsname, "/dev/mapper", 11)) 409 listDisks.push_back(RTCString(szDevName)); 410 else 411 addVolumeDependencies(szDevName, listDisks); 380 412 break; 381 413 }
Note:
See TracChangeset
for help on using the changeset viewer.