Changeset 84153 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- May 5, 2020 8:00:32 PM (5 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r84141 r84153 505 505 * Public method implementation. 506 506 */ 507 HRESULT Appliance::getManifest(com::Utf8Str &aManifest, com::Utf8Str &aManifestName)508 {509 /* Write lock the appliance here as we don't want concurrent hMemFileTheirManifest510 accesses (lazyness/paranoia). */511 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);512 513 Assert(aManifest.isEmpty());514 if (m->hMemFileTheirManifest != NIL_RTVFSFILE)515 {516 uint64_t cchManifest = 0;517 int rc = RTVfsFileQuerySize(m->hMemFileTheirManifest, &cchManifest);518 AssertRCReturn(rc, setErrorVrc(rc));519 520 rc = aManifest.reserveNoThrow(cchManifest + 1);521 AssertRCReturn(rc, setErrorVrc(rc));522 523 char *pszManifest = aManifest.mutableRaw();524 rc = RTVfsFileReadAt(m->hMemFileTheirManifest, 0, pszManifest, cchManifest, NULL);525 pszManifest[cchManifest] = '\0';526 AssertRCReturn(rc, setErrorVrc(rc));527 RTStrPurgeEncoding(pszManifest);528 aManifest.jolt();529 }530 531 aManifestName = m->strManifestName;532 return S_OK;533 }534 535 /**536 * Public method implementation.537 */538 507 HRESULT Appliance::getDisks(std::vector<com::Utf8Str> &aDisks) 539 508 { -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r84141 r84153 2561 2561 * reference is always consumed. 2562 2562 * @param pszSubFileNm The manifest filename (no path) for error 2563 * messages , logging and strManifestName.2563 * messages and logging. 2564 2564 * @returns COM status code, error info set. 2565 2565 * @throws Nothing … … 2568 2568 { 2569 2569 LogFlowFunc(("%s[%s]\n", pTask->locInfo.strPath.c_str(), pszSubFileNm)); 2570 2571 /* Remember the manifet file name */2572 HRESULT hrc = m->strManifestName.assignEx(pszSubFileNm);2573 AssertReturn(SUCCEEDED(hrc), hrc);2574 2570 2575 2571 /* … … 2595 2591 RTVfsIoStrmRelease(hVfsIos); 2596 2592 if (RT_FAILURE(vrc)) 2597 returnsetErrorVrc(vrc, tr("Failed to parse manifest file '%s' for '%s' (%Rrc): %s"),2598 2593 throw setErrorVrc(vrc, tr("Failed to parse manifest file '%s' for '%s' (%Rrc): %s"), 2594 pszSubFileNm, pTask->locInfo.strPath.c_str(), vrc, szErr); 2599 2595 2600 2596 /*
Note:
See TracChangeset
for help on using the changeset viewer.