- Timestamp:
- Jun 1, 2017 7:42:17 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r67184 r67190 1994 1994 1995 1995 #ifdef VBOX_WITH_NEW_TAR_CREATOR 1996 HRESULT hrc = E_NOTIMPL; 1997 AssertFailed(); 1998 RT_NOREF(pTask, writeLock); 1999 2000 /** @todo need a FSS creator wrapper around a directory here. */ 1996 /* 1997 * Create write-to-dir file system stream for the target directory. 1998 * This unifies the disk access with the TAR based OVA variant. 1999 */ 2000 HRESULT hrc; 2001 int vrc; 2002 RTVFSFSSTREAM hVfsFss2Dir = NIL_RTVFSFSSTREAM; 2003 try 2004 { 2005 Utf8Str strTargetDir(pTask->locInfo.strPath); 2006 strTargetDir.stripFilename(); 2007 vrc = RTVfsFsStrmToNormalDir(strTargetDir.c_str(), 0 /*fFlags*/, &hVfsFss2Dir); 2008 if (RT_SUCCESS(vrc)) 2009 hrc = S_OK; 2010 else 2011 hrc = setErrorVrc(vrc, tr("Failed to open directory '%s' (%Rrc)"), strTargetDir.c_str(), vrc); 2012 } 2013 catch (std::bad_alloc) 2014 { 2015 hrc = E_OUTOFMEMORY; 2016 } 2017 if (SUCCEEDED(hrc)) 2018 { 2019 /* 2020 * Join i_writeFSOVA. On failure, delete (undo) anything we might 2021 * have written to the disk before failing. 2022 */ 2023 hrc = i_writeFSImpl(pTask, writeLock, hVfsFss2Dir); 2024 if (FAILED(hrc)) 2025 RTVfsFsStrmToDirUndo(hVfsFss2Dir); 2026 RTVfsFsStrmRelease(hVfsFss2Dir); 2027 } 2001 2028 2002 2029 LogFlowFuncLeave(); … … 2068 2095 if (RT_SUCCESS(vrc)) 2069 2096 { 2070 /** @todo which format does the standard dic ate here actually?2097 /** @todo which format does the standard dictate here actually? 2071 2098 * GNU or USTAR/POSIX? */ 2072 2099 RTVFSFSSTREAM hVfsFssTar; … … 2181 2208 /* Construct the OVF name. */ 2182 2209 Utf8Str strOvfFile(pTask->locInfo.strPath); 2210 #ifdef VBOX_WITH_NEW_TAR_CREATOR 2211 strOvfFile.stripPath().stripSuffix().append(".ovf"); 2212 #else 2183 2213 strOvfFile.stripSuffix().append(".ovf"); 2214 #endif 2184 2215 2185 2216 /* Render a valid ovf document into a memory buffer. */ … … 2283 2314 const Utf8Str &strTargetFileNameOnly = pDiskEntry->strOvf; 2284 2315 // target path needs to be composed from where the output OVF is 2316 #ifdef VBOX_WITH_NEW_TAR_CREATOR 2317 const Utf8Str &strTargetFilePath = strTargetFileNameOnly; 2318 #else 2285 2319 Utf8Str strTargetFilePath(pTask->locInfo.strPath); 2286 2320 strTargetFilePath.stripFilename() 2287 2321 .append("/") 2288 2322 .append(strTargetFileNameOnly); 2323 #endif 2289 2324 2290 2325 // The exporting requests a lock on the media tree. So leave our lock temporary. … … 2500 2535 { 2501 2536 RTVFSOBJ hVfsObjManifest = RTVfsObjFromIoStream(hVfsIosManifest); 2502 vrc = RTVfsFsStrmAdd(hVfsFssDst, strMfFile Path.c_str(), hVfsObjManifest, 0 /*fFlags*/);2537 vrc = RTVfsFsStrmAdd(hVfsFssDst, strMfFileName.c_str(), hVfsObjManifest, 0 /*fFlags*/); 2503 2538 if (RT_SUCCESS(vrc)) 2504 2539 rc = S_OK;
Note:
See TracChangeset
for help on using the changeset viewer.

