Changeset 59758 in vbox
- Timestamp:
- Feb 20, 2016 3:02:15 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r59691 r59758 1001 1001 { 1002 1002 /* 1003 * Just open the file (throws error) and write the destination (nothrow). 1003 * Open the file (throws error) and add a read ahead thread so we can do 1004 * concurrent reads (+digest) and writes. 1004 1005 */ 1005 1006 RTVFSIOSTREAM hVfsIosSrc = i_importOpenSourceFile(stack, rstrSrcPath, pszManifestEntry); 1006 HRESULT hrc = i_importCreateAndWriteDestinationFile(rstrDstPath, hVfsIosSrc, rstrSrcPath); 1007 RTVFSIOSTREAM hVfsIosReadAhead; 1008 int vrc = RTVfsCreateReadAheadForIoStream(hVfsIosSrc, 0 /*fFlags*/, 0 /*cBuffers=default*/, 0 /*cbBuffers=default*/, 1009 &hVfsIosReadAhead); 1010 if (RT_FAILURE(vrc)) 1011 { 1012 RTVfsIoStrmRelease(hVfsIosSrc); 1013 throw setErrorVrc(vrc, tr("Error initializing read ahead thread for '%s' (%Rrc)"), rstrSrcPath.c_str(), vrc); 1014 } 1015 1016 /* 1017 * Write the destination file (nothrow). 1018 */ 1019 HRESULT hrc = i_importCreateAndWriteDestinationFile(rstrDstPath, hVfsIosReadAhead, rstrSrcPath); 1020 RTVfsIoStrmRelease(hVfsIosReadAhead); 1007 1021 1008 1022 /* … … 1040 1054 * is done on one thread, while unpacking and writing is one on this thread. 1041 1055 */ 1042 /** @todo read thread */ 1056 RTVFSIOSTREAM hVfsIosReadAhead; 1057 int vrc = RTVfsCreateReadAheadForIoStream(hVfsIosSrcCompressed, 0 /*fFlags*/, 0 /*cBuffers=default*/, 1058 0 /*cbBuffers=default*/, &hVfsIosReadAhead); 1059 if (RT_FAILURE(vrc)) 1060 { 1061 RTVfsIoStrmRelease(hVfsIosSrcCompressed); 1062 throw setErrorVrc(vrc, tr("Error initializing read ahead thread for '%s' (%Rrc)"), rstrSrcPath.c_str(), vrc); 1063 } 1043 1064 1044 1065 /* … … 1046 1067 */ 1047 1068 RTVFSIOSTREAM hVfsIosSrc; 1048 int vrc = RTZipGzipDecompressIoStream(hVfsIosSrcCompressed, 0, &hVfsIosSrc); 1069 vrc = RTZipGzipDecompressIoStream(hVfsIosReadAhead, 0, &hVfsIosSrc); 1070 RTVfsIoStrmRelease(hVfsIosReadAhead); 1049 1071 if (RT_FAILURE(vrc)) 1050 1072 { … … 2581 2603 hVfsIosSrc = i_importOpenSourceFile(stack, strSrcFilePath, strSourceOVF.c_str()); 2582 2604 2605 /* Add a read ahead thread to try speed things up with concurrent reads and 2606 writes going on in different threads. */ 2607 RTVFSIOSTREAM hVfsIosReadAhead; 2608 vrc = RTVfsCreateReadAheadForIoStream(hVfsIosSrc, 0 /*fFlags*/, 0 /*cBuffers=default*/, 2609 0 /*cbBuffers=default*/, &hVfsIosReadAhead); 2610 RTVfsIoStrmRelease(hVfsIosSrc); 2611 if (RT_FAILURE(vrc)) 2612 throw setErrorVrc(vrc, tr("Error initializing read ahead thread for '%s' (%Rrc)"), 2613 strSrcFilePath.c_str(), vrc); 2614 2583 2615 /* Start the source image cloning operation. */ 2584 2616 ComObjPtr<Medium> nullParent; … … 2586 2618 srcFormat, 2587 2619 MediumVariant_Standard, 2588 hVfsIos Src,2620 hVfsIosReadAhead, 2589 2621 nullParent, 2590 2622 pProgress); 2591 RTVfsIoStrmRelease(hVfsIos Src);2623 RTVfsIoStrmRelease(hVfsIosReadAhead); 2592 2624 hVfsIosSrc = NIL_RTVFSIOSTREAM; 2593 2625 if (FAILED(rc))
Note:
See TracChangeset
for help on using the changeset viewer.