Changeset 32448 in vbox
- Timestamp:
- Sep 13, 2010 2:24:06 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r31976 r32448 342 342 RTPrintf("VBoxManage export <machines> --output|-o <ovf>\n" 343 343 " [--legacy09]\n" 344 " [--manifest]\n" 344 345 " [--vsys <number of virtual system>]\n" 345 346 " [--product <product name>]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp
r30681 r32448 726 726 { "--output", 'o', RTGETOPT_REQ_STRING }, 727 727 { "--legacy09", 'l', RTGETOPT_REQ_NOTHING }, 728 { "--manifest", 'm', RTGETOPT_REQ_NOTHING }, 728 729 { "--vsys", 's', RTGETOPT_REQ_UINT32 }, 729 730 { "--product", 'p', RTGETOPT_REQ_STRING }, … … 742 743 Utf8Str strOutputFile; 743 744 Utf8Str strOvfFormat("ovf-1.0"); // the default export version 745 bool fManifest = false; // the default 744 746 std::list< ComPtr<IMachine> > llMachines; 745 747 … … 771 773 case 'l': // --legacy09 772 774 strOvfFormat = "ovf-0.9"; 775 break; 776 777 case 'm': // --manifest 778 fManifest = true; 773 779 break; 774 780 … … 950 956 else 951 957 pszAbsFilePath = RTPathAbsDup(strOutputFile.c_str()); 952 CHECK_ERROR_BREAK(pAppliance, Write(Bstr(strOvfFormat), Bstr(pszAbsFilePath), progress.asOutParam()));958 CHECK_ERROR_BREAK(pAppliance, Write(Bstr(strOvfFormat), fManifest, Bstr(pszAbsFilePath), progress.asOutParam())); 953 959 RTStrFree(pszAbsFilePath); 954 960 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.cpp
r31676 r32448 530 530 if (fi.suffix().toLower() == "ovf") 531 531 { 532 files << fi.baseName() + ".mf"; 532 if (m_pSelectManifest->isChecked()) 533 files << fi.baseName() + ".mf"; 533 534 CVirtualSystemDescriptionVector vsds = appliance->GetVirtualSystemDescriptions(); 534 535 for (int i = 0; i < vsds.size(); ++ i) … … 600 601 /* Write the appliance */ 601 602 const QString version = m_pSelectOVF09->isChecked() ? "ovf-0.9" : "ovf-1.0"; 602 CProgress progress = appliance.Write(version, uri());603 CProgress progress = appliance.Write(version, m_pSelectManifest->isChecked() /* fManifest */, uri()); 603 604 bool fResult = appliance.isOk(); 604 605 if (fResult) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage4.ui
r28800 r32448 2 2 <ui version="4.0"> 3 3 <comment> 4 VBox frontends: Qt4 GUI ( "VirtualBox"):4 VBox frontends: Qt4 GUI ("VirtualBox"): 5 5 6 6 Copyright (C) 2009-2010 Oracle Corporation … … 10 10 you can redistribute it and/or modify it under the terms of the GNU 11 11 General Public License (GPL) as published by the Free Software 12 Foundation, in version 2 as it comes in the "COPYING"file of the12 Foundation, in version 2 as it comes in the "COPYING" file of the 13 13 VirtualBox OSE distribution. VirtualBox OSE is distributed in the 14 14 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. … … 30 30 </sizepolicy> 31 31 </property> 32 <layout class="QVBoxLayout" name="m_pLayout1"> 33 <property name="bottomMargin" > 34 <number>0</number> 35 </property> 32 <layout class="QVBoxLayout" name="verticalLayout"> 36 33 <item> 37 34 <widget class="QILabel" name="m_pPage4Text1"> … … 140 137 </item> 141 138 <item> 139 <widget class="QCheckBox" name="m_pSelectManifest"> 140 <property name="toolTip"> 141 <string>Create a Manifest file for automatic data integrity checks on import.</string> 142 </property> 143 <property name="text"> 144 <string>Write &Manifest file</string> 145 </property> 146 </widget> 147 </item> 148 <item> 142 149 <spacer name="m_pSpacer1"> 150 <property name="orientation"> 151 <enum>Qt::Vertical</enum> 152 </property> 143 153 <property name="sizeHint" stdset="0"> 144 154 <size> 145 <width> 0</width>146 <height>1 74</height>155 <width>579</width> 156 <height>144</height> 147 157 </size> 148 158 </property> -
trunk/src/VBox/Main/ApplianceImpl.cpp
r31677 r32448 825 825 } 826 826 case ImportFileWithManifest: 827 case WriteFile:828 827 { 829 828 ++cOperations; // another one for creating the manifest … … 832 831 m->ulWeightForManifestOperation = m->ulTotalDisksMB / 10; 833 832 ulTotalOperationsWeight += m->ulWeightForManifestOperation; 833 if (fOVA) 834 { 835 // Another operation for packing 836 ++cOperations; 837 838 // assume that packing the files into the archive has the same weight than creating all files in the ovf exporting step 839 ulTotalOperationsWeight += m->ulTotalDisksMB; 840 } 841 break; 842 } 843 case WriteFile: 844 { 845 // assume that creating the manifest will take 10% of the time it takes to export the disks 846 if (m->fManifest) 847 { 848 ++cOperations; // another one for creating the manifest 849 850 m->ulWeightForManifestOperation = m->ulTotalDisksMB / 10; 851 ulTotalOperationsWeight += m->ulWeightForManifestOperation; 852 } 834 853 if (fOVA) 835 854 { -
trunk/src/VBox/Main/ApplianceImplExport.cpp
r32064 r32448 552 552 * @return 553 553 */ 554 STDMETHODIMP Appliance::Write(IN_BSTR format, IN_BSTR path, IProgress **aProgress)554 STDMETHODIMP Appliance::Write(IN_BSTR format, BOOL fManifest, IN_BSTR path, IProgress **aProgress) 555 555 { 556 556 if (!path) return E_POINTER; … … 573 573 tr("Appliance file must have .ovf or .ova extension")); 574 574 575 m->fManifest = !!fManifest; 575 576 Utf8Str strFormat(format); 576 577 OVFFormat ovfF; … … 1617 1618 writer.write(pTask->locInfo.strPath.c_str(), false /*fSafe*/); 1618 1619 1619 // Create & write the manifest file 1620 Utf8Str strMfFile = manifestFileName(pTask->locInfo.strPath.c_str()); 1621 const char *pcszManifestFileOnly = RTPathFilename(strMfFile.c_str()); 1622 pTask->pProgress->SetNextOperation(BstrFmt(tr("Creating manifest file '%s'"), pcszManifestFileOnly), 1623 m->ulWeightForManifestOperation); // operation's weight, as set up with the IProgress originally); 1624 1625 const char** ppManifestFiles = (const char**)RTMemAlloc(sizeof(char*)*diskList.size() + 1); 1626 ppManifestFiles[0] = pTask->locInfo.strPath.c_str(); 1627 list<Utf8Str>::const_iterator it1; 1628 size_t i = 1; 1629 for (it1 = diskList.begin(); 1630 it1 != diskList.end(); 1631 ++it1, ++i) 1632 ppManifestFiles[i] = (*it1).c_str(); 1633 int vrc = RTManifestWriteFiles(strMfFile.c_str(), ppManifestFiles, diskList.size()+1, NULL, NULL); 1634 RTMemFree(ppManifestFiles); 1635 if (RT_FAILURE(vrc)) 1636 throw setError(VBOX_E_FILE_ERROR, 1637 tr("Could not create manifest file '%s' (%Rrc)"), 1638 pcszManifestFileOnly, vrc); 1620 if (m->fManifest) 1621 { 1622 // Create & write the manifest file 1623 Utf8Str strMfFile = manifestFileName(pTask->locInfo.strPath.c_str()); 1624 const char *pcszManifestFileOnly = RTPathFilename(strMfFile.c_str()); 1625 pTask->pProgress->SetNextOperation(BstrFmt(tr("Creating manifest file '%s'"), pcszManifestFileOnly), 1626 m->ulWeightForManifestOperation); // operation's weight, as set up with the IProgress originally); 1627 1628 const char** ppManifestFiles = (const char**)RTMemAlloc(sizeof(char*)*diskList.size() + 1); 1629 ppManifestFiles[0] = pTask->locInfo.strPath.c_str(); 1630 list<Utf8Str>::const_iterator it1; 1631 size_t i = 1; 1632 for (it1 = diskList.begin(); 1633 it1 != diskList.end(); 1634 ++it1, ++i) 1635 ppManifestFiles[i] = (*it1).c_str(); 1636 int vrc = RTManifestWriteFiles(strMfFile.c_str(), ppManifestFiles, diskList.size()+1, NULL, NULL); 1637 RTMemFree(ppManifestFiles); 1638 if (RT_FAILURE(vrc)) 1639 throw setError(VBOX_E_FILE_ERROR, 1640 tr("Could not create manifest file '%s' (%Rrc)"), 1641 pcszManifestFileOnly, vrc); 1642 } 1639 1643 } 1640 1644 catch (iprt::Error &x) // includes all XML exceptions … … 1720 1724 throw setError(VBOX_E_FILE_ERROR, 1721 1725 tr("Cannot find source file '%s' (%Rrc)"), strTmpOvf.c_str(), vrc); 1726 ULONG ulWeight = m->ulWeightForXmlOperation; 1722 1727 /* Add the OVF file */ 1723 1728 filesList.push_back(strTmpOvf); /* Use 1% of the total for the OVF file upload */ 1724 Utf8Str strMfFile = manifestFileName(strTmpOvf); 1725 filesList.push_back(strMfFile); /* Use 1% of the total for the manifest file upload */ 1726 1727 ULONG ulWeight = 2 * m->ulWeightForXmlOperation; 1729 /* Add the manifest file */ 1730 if (m->fManifest) 1731 { 1732 Utf8Str strMfFile = manifestFileName(strTmpOvf); 1733 filesList.push_back(strMfFile); /* Use 1% of the total for the manifest file upload */ 1734 ulWeight += m->ulWeightForXmlOperation; 1735 } 1736 1728 1737 /* Now add every disks of every virtual system */ 1729 1738 list< ComObjPtr<VirtualSystemDescription> >::const_iterator it; … … 1753 1762 } 1754 1763 } 1764 ulWeight = m->ulTotalDisksMB; 1755 1765 paFiles = (const char**)RTMemAlloc(sizeof(char*) * filesList.size()); 1756 1766 int i = 0; … … 1874 1884 /* Add the OVF file */ 1875 1885 filesList.push_back(pair<Utf8Str, ULONG>(strTmpOvf, m->ulWeightForXmlOperation)); /* Use 1% of the total for the OVF file upload */ 1876 Utf8Str strMfFile = manifestFileName(strTmpOvf); 1877 filesList.push_back(pair<Utf8Str, ULONG>(strMfFile , m->ulWeightForXmlOperation)); /* Use 1% of the total for the manifest file upload */ 1886 /* Add the manifest file */ 1887 if (m->fManifest) 1888 { 1889 Utf8Str strMfFile = manifestFileName(strTmpOvf); 1890 filesList.push_back(pair<Utf8Str, ULONG>(strMfFile , m->ulWeightForXmlOperation)); /* Use 1% of the total for the manifest file upload */ 1891 } 1878 1892 1879 1893 /* Now add every disks of every virtual system */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r32398 r32448 2391 2391 <interface 2392 2392 name="IAppliance" extends="$unknown" 2393 uuid=" fb61a4fc-57e7-48d6-859b-71f37d484cf2"2393 uuid="7b148032-4124-4f46-b56a-b48ac1273f5a" 2394 2394 wsmap="managed" 2395 2395 > … … 2621 2621 </desc> 2622 2622 </param> 2623 <param name="manifest" type="boolean" dir="in"> 2624 <desc> 2625 Indicate if the optional manifest file (.mf) should be written. The manifest file 2626 is used for integrity checks prior import. 2627 </desc> 2628 </param> 2623 2629 <param name="path" type="wstring" dir="in"> 2624 2630 <desc> … … 2627 2633 </desc> 2628 2634 </param> 2629 <param name=" aProgress" type="IProgress" dir="return">2635 <param name="progress" type="IProgress" dir="return"> 2630 2636 <desc>Progress object to track the operation completion.</desc> 2631 2637 </param> … … 2633 2639 2634 2640 <method name="getWarnings"> 2635 <desc>Returns textual warnings which occur ed during execution of <link to="#interpret" />.</desc>2641 <desc>Returns textual warnings which occurred during execution of <link to="#interpret" />.</desc> 2636 2642 2637 2643 <param name="aWarnings" type="wstring" dir="return" safearray="yes"> -
trunk/src/VBox/Main/include/ApplianceImpl.h
r31676 r32448 93 93 /* Export methods */ 94 94 STDMETHOD(CreateVFSExplorer)(IN_BSTR aURI, IVFSExplorer **aExplorer); 95 STDMETHOD(Write)(IN_BSTR format, IN_BSTR path, IProgress **aProgress);95 STDMETHOD(Write)(IN_BSTR format, BOOL fManifest, IN_BSTR path, IProgress **aProgress); 96 96 97 97 STDMETHOD(GetWarnings)(ComSafeArrayOut(BSTR, aWarnings)); -
trunk/src/VBox/Main/include/ApplianceImplPrivate.h
r31676 r32448 48 48 49 49 Data() 50 : state(ApplianceIdle), 51 pReader(NULL) 50 : state(ApplianceIdle) 51 , fManifest(true) 52 , pReader(NULL) 52 53 { 53 54 } … … 65 66 66 67 LocationInfo locInfo; // location info for the currently processed OVF 68 bool fManifest; // Create a manifest file on export 67 69 68 70 ovf::OVFReader *pReader;
Note:
See TracChangeset
for help on using the changeset viewer.