Changeset 17287 in vbox
- Timestamp:
- Mar 3, 2009 2:45:17 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
-
Frontends/VBoxManage/VBoxManageImport.cpp (modified) (1 diff)
-
Main/ApplianceImpl.cpp (modified) (7 diffs)
-
Main/idl/VirtualBox.xidl (modified) (6 diffs)
-
Main/include/ApplianceImpl.h (modified) (3 diffs)
-
Main/include/MachineImpl.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp
r17098 r17287 581 581 break; 582 582 583 CHECK_ERROR_BREAK(pAppliance, Write(Bstr(strOutputFile))); 583 ComPtr<IProgress> progress; 584 CHECK_ERROR_BREAK(pAppliance, Write(Bstr(strOutputFile), progress.asOutParam())); 585 586 showProgress(progress); 587 588 if (SUCCEEDED(rc)) 589 progress->COMGETTER(ResultCode)(&rc); 590 591 if (FAILED(rc)) 592 { 593 com::ProgressErrorInfo info(progress); 594 com::GluePrintErrorInfo(info); 595 com::GluePrintErrorContext("Write", __FILE__, __LINE__); 596 } 597 else 598 RTPrintf("Successfully exported %d machine(s).\n", llMachines.size()); 584 599 585 600 } while (0); -
trunk/src/VBox/Main/ApplianceImpl.cpp
r17162 r17287 199 199 }; 200 200 201 struct Appliance::Task 202 { 203 Task (Appliance *aThat, Progress *aProgress)201 struct Appliance::TaskImportMachines 202 { 203 TaskImportMachines(Appliance *aThat, Progress *aProgress) 204 204 : that(aThat) 205 205 , progress(aProgress) 206 206 , rc(S_OK) 207 207 {} 208 ~Task () {}208 ~TaskImportMachines() {} 209 209 210 210 HRESULT startThread(); … … 263 263 //////////////////////////////////////////////////////////////////////////////// 264 264 265 HRESULT Appliance::Task ::startThread()266 { 267 int vrc = RTThreadCreate(NULL, Appliance::taskThread , this,265 HRESULT Appliance::TaskImportMachines::startThread() 266 { 267 int vrc = RTThreadCreate(NULL, Appliance::taskThreadImportMachines, this, 268 268 0, RTTHREADTYPE_MAIN_HEAVY_WORKER, 0, 269 269 "Appliance::Task"); … … 1653 1653 1654 1654 /* Initialize our worker task */ 1655 std::auto_ptr<Task > task(new Task(this, progress));1655 std::auto_ptr<TaskImportMachines> task(new TaskImportMachines(this, progress)); 1656 1656 //AssertComRCThrowRC (task->autoCaller.rc()); 1657 1657 … … 1673 1673 } 1674 1674 1675 STDMETHODIMP Appliance::Write(IN_BSTR path )1675 STDMETHODIMP Appliance::Write(IN_BSTR path, IProgress **aProgress) 1676 1676 { 1677 1677 HRESULT rc = S_OK; … … 1740 1740 */ 1741 1741 /* static */ 1742 DECLCALLBACK(int) Appliance::taskThread (RTTHREAD aThread, void *pvUser)1743 { 1744 std::auto_ptr<Task > task(static_cast<Task*>(pvUser));1742 DECLCALLBACK(int) Appliance::taskThreadImportMachines(RTTHREAD aThread, void *pvUser) 1743 { 1744 std::auto_ptr<TaskImportMachines> task(static_cast<TaskImportMachines*>(pvUser)); 1745 1745 AssertReturn(task.get(), VERR_GENERAL_FAILURE); 1746 1746 … … 2696 2696 fDVDEnabled = 1; 2697 2697 2698 // hardDiskAttachments2699 // mHDData->mAttachments @todo2700 2701 2698 // this is more tricky so use the COM method 2702 2699 rc = COMGETTER(USBController)(pUsbController.asOutParam()); … … 2740 2737 strMemory); 2741 2738 2739 uint32_t uControllerId = 1; 2740 Utf8Str strIdeControllerID; 2741 Utf8Str strSataControllerID; 2742 2742 2743 // <const name="HardDiskControllerIDE" value="6" /> 2744 ComPtr<IBIOSSettings> pBiosSettings; 2745 pBiosSettings = mBIOSSettings; 2746 Utf8Str strConfig; 2747 IDEControllerType_T ctlr; 2748 rc = pBiosSettings->COMGETTER(IDEControllerType)(&ctlr); 2749 if (FAILED(rc)) throw rc; 2750 switch(ctlr) 2751 { 2752 case IDEControllerType_PIIX3: strConfig = "PIIX3"; break; 2753 case IDEControllerType_PIIX4: strConfig = "PIIX4"; break; 2754 case IDEControllerType_ICH6: strConfig = "ICH6"; break; 2755 } 2756 2757 if (strConfig.length()) 2758 { 2759 strIdeControllerID = Utf8StrFmt("%RI32", uControllerId++); 2760 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, strIdeControllerID, strConfig, ""); 2761 } 2762 2763 #ifdef VBOX_WITH_AHCI 2743 2764 // <const name="HardDiskControllerSATA" value="7" /> 2765 ComPtr<ISATAController> pSataController; 2766 pSataController = mSATAController; 2767 BOOL fSataEnabled; 2768 rc = pSataController->COMGETTER(Enabled)(&fSataEnabled); 2769 if (FAILED(rc)) throw rc; 2770 if (fSataEnabled) 2771 { 2772 strSataControllerID = Utf8StrFmt("%RI32", uControllerId++); 2773 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, strSataControllerID, strConfig, ""); 2774 } 2775 #endif // VBOX_WITH_AHCI 2776 2744 2777 // <const name="HardDiskControllerSCSI" value="8" /> 2778 // @todo 2779 2745 2780 // <const name="HardDiskImage" value="9" /> 2781 // hardDiskAttachments 2782 // mHDData->mAttachments @todo 2783 HDData::AttachmentList::iterator itA; 2784 for (itA = mHDData->mAttachments.begin(); 2785 itA != mHDData->mAttachments.end(); 2786 ++itA) 2787 { 2788 ComObjPtr<HardDiskAttachment> pHDA = *itA; 2789 2790 // get the attachment's data 2791 ComPtr<IHardDisk> pHardDisk; 2792 StorageBus_T storageBus; 2793 LONG lChannel; 2794 LONG lDevice; 2795 2796 rc = pHDA->COMGETTER(HardDisk)(pHardDisk.asOutParam()); 2797 if (FAILED(rc)) throw rc; 2798 2799 rc = pHDA->COMGETTER(Bus)(&storageBus); 2800 if (FAILED(rc)) throw rc; 2801 2802 rc = pHDA->COMGETTER(Channel)(&lChannel); 2803 if (FAILED(rc)) throw rc; 2804 2805 rc = pHDA->COMGETTER(Device)(&lDevice); 2806 if (FAILED(rc)) throw rc; 2807 2808 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskImage, 2809 "", // hd.strDiskId, 2810 "", // di.strHref, 2811 "", 2812 ""); // strExtraConfig 2813 } 2746 2814 2747 2815 /* Floppy Drive */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r17275 r17287 2927 2927 <attribute name="path" type="wstring" readonly="yes"> 2928 2928 <desc>Path to the main file of the OVF appliance, which is either the <tt>.ovf</tt> or 2929 the <tt>.ova</tt> file passed to <link to="IAppliance::read" />.</desc> 2929 the <tt>.ova</tt> file passed to <link to="#read" /> (for import) or 2930 <link to="#write" /> (for export). 2931 This attribute is empty until one of these methods has been called. 2932 </desc> 2930 2933 </attribute> 2931 2934 … … 2971 2974 <attribute name="virtualSystemDescriptions" type="IVirtualSystemDescription" readonly="yes" safearray="yes"> 2972 2975 <desc> Array of virtual system descriptions. One such description is created 2973 for each virtual system found in the OVF. The array is empty until after <link to="#interpret" /> 2974 has been called. 2976 for each virtual system found in the OVF. 2977 This array is empty until either <link to="#interpret" /> (for import) or <link to="IMachine::export" /> 2978 (for export) has been called. 2975 2979 </desc> 2976 2980 </attribute> … … 3015 3019 see <link to="IAppliance" /> for an overview. 3016 3020 3017 Since importing the appliance may imply copying disk images, which can take a long3018 time, this method operates asynchronously and returns an IProgress object to allow3019 the caller to monitor the progress.3021 Since importing the appliance will most probably involve copying and converting 3022 disk images, which can take a long time, this method operates asynchronously and 3023 returns an IProgress object to allow the caller to monitor the progress. 3020 3024 </desc> 3021 3025 … … 3031 3035 Calling this method is the final step of exporting an appliance from VirtualBox; 3032 3036 see <link to="IAppliance" /> for an overview. 3037 3038 Since importing the appliance will most probably involve copying and converting 3039 disk images, which can take a long time, this method operates asynchronously and 3040 returns an IProgress object to allow the caller to monitor the progress. 3033 3041 </desc> 3034 3042 <param name="path" type="wstring" dir="in"> … … 3037 3045 on whether the appliance is distributed as a set of files or as a single file, respectively). 3038 3046 </desc> 3047 </param> 3048 <param name="aProgress" type="IProgress" dir="return"> 3049 <desc></desc> 3039 3050 </param> 3040 3051 </method> … … 3135 3146 </li> 3136 3147 <li> 3137 "Hard disk": a virtual hard disk, most probably as a reference to an image file. There can be an3148 "HardDiskImage": a virtual hard disk, most probably as a reference to an image file. There can be an 3138 3149 arbitrary number of these items, one for each virtual disk image that accompanies the OVF. The 3139 3150 array item in aOrigValues[] will contain the file specification from the OVF file, whereas the -
trunk/src/VBox/Main/include/ApplianceImpl.h
r17099 r17287 77 77 STDMETHOD(Interpret)(void); 78 78 STDMETHOD(ImportMachines)(IProgress **aProgress); 79 STDMETHOD(Write)(IN_BSTR path );79 STDMETHOD(Write)(IN_BSTR path, IProgress **aProgress); 80 80 /* public methods only for internal purposes */ 81 81 … … 85 85 const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox; 86 86 87 struct Task; /* Worker thread for import */ 87 struct TaskImportMachines; /* Worker thread for import */ 88 struct TaskExportOVF; /* Worker thread for import */ 88 89 89 90 struct Data; // obscure, defined in AppliannceImpl.cpp … … 98 99 HRESULT searchUniqueDiskImageFilePath(Utf8Str& aName) const; 99 100 100 static DECLCALLBACK(int) taskThread(RTTHREAD thread, void *pvUser); 101 static DECLCALLBACK(int) taskThreadImportMachines(RTTHREAD thread, void *pvUser); 102 static DECLCALLBACK(int) taskThreadExportOVF(RTTHREAD thread, void *pvUser); 101 103 102 104 friend class Machine; -
trunk/src/VBox/Main/include/MachineImpl.h
r17180 r17287 281 281 * taking or discarding snapshots, etc. 282 282 * 283 * The data variable is |mH WData|.283 * The data variable is |mHDData|. 284 284 */ 285 285 struct HDData
Note:
See TracChangeset
for help on using the changeset viewer.

