Changeset 90424 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 30, 2021 12:41:38 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146024
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ApplianceImpl.h
r86650 r90424 306 306 307 307 std::list<VirtualSystemDescriptionEntry*> i_findByType(VirtualSystemDescriptionType_T aType); 308 const VirtualSystemDescriptionEntry* i_findControllerFromID( uint32_tid);308 const VirtualSystemDescriptionEntry* i_findControllerFromID(const Utf8Str &id); 309 309 310 310 void i_importVBoxMachineXML(const xml::ElementNode &elmMachine); -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r86650 r90424 1757 1757 * virtual disk. 1758 1758 */ 1759 const VirtualSystemDescriptionEntry* VirtualSystemDescription::i_findControllerFromID(uint32_t id) 1760 { 1761 Utf8Str strRef = Utf8StrFmt("%RI32", id); 1759 const VirtualSystemDescriptionEntry* VirtualSystemDescription::i_findControllerFromID(const Utf8Str &id) 1760 { 1762 1761 vector<VirtualSystemDescriptionEntry>::const_iterator it; 1763 1762 for (it = m->maDescriptions.begin(); … … 1773 1772 case VirtualSystemDescriptionType_HardDiskControllerVirtioSCSI: 1774 1773 case VirtualSystemDescriptionType_HardDiskControllerSAS: 1775 if (d.strRef == strRef)1774 if (d.strRef == id) 1776 1775 return &d; 1777 1776 break; -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r86509 r90424 511 511 } 512 512 #endif /* VBOX_WITH_E1000 */ 513 else if ( !ea.strAdapterType.compare("VirtioNet", Utf8Str::CaseInsensitive) 514 || !ea.strAdapterType.compare("virtio-net", Utf8Str::CaseInsensitive) 515 || !ea.strAdapterType.compare("3", Utf8Str::CaseInsensitive)) 516 nwAdapterVBox = NetworkAdapterType_Virtio; 513 517 514 518 pNewDesc->i_addEntry(VirtualSystemDescriptionType_NetworkAdapter, … … 572 576 { 573 577 const ovf::HardDiskController &hdc = hdcIt->second; 574 Utf8Str strControllerID = Utf8StrFmt("%RI32", (uint32_t)hdc.idController);575 578 576 579 switch (hdc.system) … … 588 591 strType = "ICH6"; 589 592 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, 590 strControllerID,// strRef591 hdc.strControllerType, // aOvfValue592 strType); // aVBoxValue593 hdc.strIdController, // strRef 594 hdc.strControllerType, // aOvfValue 595 strType); // aVBoxValue 593 596 } 594 597 else … … 609 612 /* We only support a plain AHCI controller, so use them always */ 610 613 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, 611 strControllerID,614 hdc.strIdController, 612 615 hdc.strControllerType, 613 616 "AHCI"); … … 640 643 hdcController = "BusLogic"; 641 644 pNewDesc->i_addEntry(vsdet, 642 strControllerID,645 hdc.strIdController, 643 646 hdc.strControllerType, 644 647 hdcController); … … 650 653 vsysThis.strName.c_str(), 651 654 hdc.strControllerType.c_str(), 652 strControllerID.c_str());655 hdc.strIdController.c_str()); 653 656 ++cSCSIused; 654 657 break; … … 659 662 { 660 663 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerVirtioSCSI, 661 strControllerID,664 hdc.strIdController, 662 665 hdc.strControllerType, 663 666 "VirtioSCSI"); … … 753 756 754 757 /* find the description for the storage controller 755 * that has the same ID as hd. idController */758 * that has the same ID as hd.strIdController */ 756 759 const VirtualSystemDescriptionEntry *pController; 757 if (!(pController = pNewDesc->i_findControllerFromID(hd. idController)))760 if (!(pController = pNewDesc->i_findControllerFromID(hd.strIdController))) 758 761 throw setError(E_FAIL, 759 tr("Cannot find storage controller with OVF instance ID %RI32"762 tr("Cannot find storage controller with OVF instance ID \"%s\" " 760 763 "to which medium \"%s\" should be attached"), 761 hd. idController,764 hd.strIdController, 762 765 di.strHref.c_str()); 763 766 … … 1317 1320 1318 1321 int vrc = VINF_SUCCESS; 1322 /** @todo r=klaus This should be a MultiResult, because this can cause 1323 * multiple errors and warnings which should be relevant for the caller. 1324 * Needs some work, because there might be errors which need to be 1325 * excluded if they happen in error recovery code paths. */ 1319 1326 HRESULT hrc = S_OK; 1320 1327 bool fKeepDownloadedObject = false;//in the future should be passed from the caller … … 1789 1796 //It's thought that SATA is supported by any OS types 1790 1797 hdc.system = ovf::HardDiskController::SATA; 1791 hdc. idController = 0;1798 hdc.strIdController = "0"; 1792 1799 1793 1800 GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_HardDiskControllerSATA)//aVBoxValues is set in this #define … … 1798 1805 1799 1806 LogRel(("%s: Hard disk controller type is %s\n", __FUNCTION__, hdc.strControllerType.c_str())); 1800 vsys.mapControllers[hdc. idController] = hdc;1807 vsys.mapControllers[hdc.strIdController] = hdc; 1801 1808 1802 1809 if (aVBoxValues.size() == 0) … … 2030 2037 2031 2038 ovf::VirtualDisk vd; 2032 vd. idController = vsys.mapControllers[0].idController;2039 vd.strIdController = vsys.mapControllers[0].strIdController; 2033 2040 vd.ulAddressOnParent = 0; 2034 2041 vd.strDiskId = d.strDiskId; … … 5019 5026 5020 5027 // find the hard disk controller to which we should attach 5021 ovf::HardDiskController hdc = (*vsysThis.mapControllers.find(ovfVdisk. idController)).second;5028 ovf::HardDiskController hdc = (*vsysThis.mapControllers.find(ovfVdisk.strIdController)).second; 5022 5029 5023 5030 // this is for rollback later
Note:
See TracChangeset
for help on using the changeset viewer.