- Timestamp:
- Jun 2, 2017 11:20:54 AM (8 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/MediumImpl.h
r67203 r67231 203 203 HRESULT i_fixParentUuidOfChildren(MediumLockList *pChildrenToReparent); 204 204 205 HRESULT i_addRawToFss(const char *aFilename, SecretKeyStore *pKeyStore, 206 RTVFSFSSTREAM hVfsFssDst /*, const ComObjPtr<Progress> &aProgress*/);205 HRESULT i_addRawToFss(const char *aFilename, SecretKeyStore *pKeyStore, RTVFSFSSTREAM hVfsFssDst, 206 const ComObjPtr<Progress> &aProgress, bool fSparse); 207 207 208 208 HRESULT i_exportFile(const char *aFilename, -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r67225 r67231 2333 2333 pDiskEntry->ulSizeMB); // operation's weight, as set up 2334 2334 // with the IProgress originally 2335 hrc = ptrSourceDisk->i_addRawToFss(strInsideName.c_str(), m->m_pSecretKeyStore, hVfsFssTar /*, pProgress2*/); 2335 hrc = ptrSourceDisk->i_addRawToFss(strInsideName.c_str(), m->m_pSecretKeyStore, hVfsFssTar, 2336 pTask->pProgress, true /*fSparse*/); 2336 2337 if (FAILED(hrc)) 2337 2338 throw hrc; … … 2538 2539 * Export a disk image. 2539 2540 */ 2541 /** @todo this progress object needs to be hooked up to pTask->pProgress... */ 2540 2542 ComObjPtr<Progress> pProgress2; 2541 2543 pProgress2.createObject(); … … 2588 2590 2589 2591 #ifdef VBOX_WITH_NEW_TAR_CREATOR 2590 rc = pSourceDisk->i_addRawToFss(strTargetFilePath.c_str(), m->m_pSecretKeyStore, hVfsFssDst /*, pProgress2*/); 2592 rc = pSourceDisk->i_addRawToFss(strTargetFilePath.c_str(), m->m_pSecretKeyStore, hVfsFssDst, 2593 pTask->pProgress, false /*fSparse*/); 2591 2594 if (FAILED(rc)) throw rc; 2592 2595 #else -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r67226 r67231 6107 6107 * @note Similar code exists in i_taskExportHandler. 6108 6108 */ 6109 HRESULT Medium::i_addRawToFss(const char *aFilename, SecretKeyStore *pKeyStore, 6110 RTVFSFSSTREAM hVfsFssDst /*, const ComObjPtr<Progress> &aProgress*/)6109 HRESULT Medium::i_addRawToFss(const char *aFilename, SecretKeyStore *pKeyStore, RTVFSFSSTREAM hVfsFssDst, 6110 const ComObjPtr<Progress> &aProgress, bool fSparse) 6111 6111 { 6112 6112 /** @todo fix progress object. */ … … 6235 6235 6236 6236 /* 6237 * Create a VFS file interface to the HDD. 6237 * Create a VFS file interface to the HDD and attach a progress wrapper 6238 * that monitors the progress reading of the raw image. The image will 6239 * be read twice if hVfsFssDst does sparse processing. 6238 6240 */ 6239 RTVFSFILE hVfsFile = NIL_RTVFSFILE;6240 vrc = VDCreateVfsFileFromDisk(hdd, 0 /*fFlags*/, &hVfsFile );6241 RTVFSFILE hVfsFileDisk = NIL_RTVFSFILE; 6242 vrc = VDCreateVfsFileFromDisk(hdd, 0 /*fFlags*/, &hVfsFileDisk); 6241 6243 if (RT_SUCCESS(vrc)) 6242 6244 { 6243 RTVFSOBJ hVfsObj = RTVfsObjFromFile(hVfsFile); 6244 RTVfsFileRelease(hVfsFile); 6245 vrc = RTVfsFsStrmAdd(hVfsFssDst, aFilename, hVfsObj, 0 /*fFlags*/); 6246 RTVfsObjRelease(hVfsObj); 6247 if (RT_FAILURE(vrc)) 6248 rc = setErrorBoth(VBOX_E_FILE_ERROR, vrc, tr("Failed to add '%s' to output (%Rrc)"), aFilename, vrc); 6245 RTVFSFILE hVfsFileProgress = NIL_RTVFSFILE; 6246 vrc = RTVfsCreateProgressForFile(hVfsFileDisk, aProgress->i_iprtProgressCallback, &*aProgress, 6247 RTVFSPROGRESS_F_CANCELABLE | RTVFSPROGRESS_F_FORWARD_SEEK_AS_READ, 6248 VDGetSize(hdd, VD_LAST_IMAGE) * (fSparse ? 2 : 1) /*cbExpectedRead*/, 6249 0 /*cbExpectedWritten*/, &hVfsFileProgress); 6250 RTVfsFileRelease(hVfsFileDisk); 6251 if (RT_SUCCESS(rc)) 6252 { 6253 RTVFSOBJ hVfsObj = RTVfsObjFromFile(hVfsFileProgress); 6254 RTVfsFileRelease(hVfsFileProgress); 6255 6256 vrc = RTVfsFsStrmAdd(hVfsFssDst, aFilename, hVfsObj, 0 /*fFlags*/); 6257 RTVfsObjRelease(hVfsObj); 6258 if (RT_FAILURE(vrc)) 6259 rc = setErrorBoth(VBOX_E_FILE_ERROR, vrc, tr("Failed to add '%s' to output (%Rrc)"), aFilename, vrc); 6260 6261 } 6262 else 6263 rc = setErrorBoth(VBOX_E_FILE_ERROR, vrc, 6264 tr("RTVfsCreateProgressForFile failed when processing '%s' (%Rrc)"), aFilename, vrc); 6249 6265 } 6250 6266 else
Note:
See TracChangeset
for help on using the changeset viewer.