Changeset 33320 in vbox
- Timestamp:
- Oct 21, 2010 5:09:15 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImplExport.cpp
r33289 r33320 1736 1736 // Now fully build a valid ovf document in memory 1737 1737 buildXML(writeLock, doc, stack, pTask->locInfo.strPath, pTask->enFormat); 1738 /* Extract the path */ 1739 Utf8Str strOvfFile = Utf8Str(pTask->locInfo.strPath).stripExt().append(".ovf"); 1738 1740 // Create a memory buffer containing the XML. */ 1739 void *pvBuf ;1741 void *pvBuf = 0; 1740 1742 size_t cbSize; 1741 1743 xml::XmlMemWriter writer; 1742 1744 writer.write(doc, &pvBuf, &cbSize); 1743 /* Extract the path */ 1744 Utf8Str tmpPath = pTask->locInfo.strPath; 1745 /* Remove the extension and add ovf. */ 1746 tmpPath.stripExt() 1747 .append(".ovf"); 1745 if (RT_UNLIKELY(!pvBuf)) 1746 throw setError(VBOX_E_FILE_ERROR, 1747 tr("Could not create OVF file '%s'"), 1748 strOvfFile.c_str()); 1748 1749 /* Write the ovf file to disk. */ 1749 vrc = Sha1WriteBuf(tmpPath.c_str(), pvBuf, cbSize, pCallbacks, pStorage); 1750 vrc = Sha1WriteBuf(strOvfFile.c_str(), pvBuf, cbSize, pCallbacks, pStorage); 1751 RTMemFree(pvBuf); 1750 1752 if (RT_FAILURE(vrc)) 1751 1753 throw setError(VBOX_E_FILE_ERROR, 1752 1754 tr("Could not create OVF file '%s' (%Rrc)"), 1753 tmpPath.c_str(), vrc);1754 fileList.push_back(STRPAIR( tmpPath, pStorage->strDigest));1755 strOvfFile.c_str(), vrc); 1756 fileList.push_back(STRPAIR(strOvfFile, pStorage->strDigest)); 1755 1757 } 1756 1758 … … 1840 1842 // Create & write the manifest file 1841 1843 Utf8Str strMfFilePath = Utf8Str(pTask->locInfo.strPath).stripExt().append(".mf"); 1842 Utf8Str strMfFileName = Utf8Str(strMfFilePath) 1843 .stripPath(); 1844 Utf8Str strMfFileName = Utf8Str(strMfFilePath).stripPath(); 1844 1845 pTask->pProgress->SetNextOperation(BstrFmt(tr("Creating manifest file '%s'"), strMfFileName.c_str()).raw(), 1845 1846 m->ulWeightForManifestOperation); // operation's weight, as set up with the IProgress originally); -
trunk/src/VBox/Main/ApplianceImplImport.cpp
r33294 r33320 2490 2490 if (FAILED(rc)) throw rc; 2491 2491 2492 // return the new machine as an IMachine 2493 IMachine *p; 2494 rc = pNewMachine.queryInterfaceTo(&p); 2495 if (FAILED(rc)) throw rc; 2496 pReturnNewMachine = p; 2492 pReturnNewMachine = ComPtr<IMachine>(pNewMachine); 2497 2493 2498 2494 // and register it
Note:
See TracChangeset
for help on using the changeset viewer.