Changeset 84532 in vbox for trunk/src/VBox/Main
- Timestamp:
- May 26, 2020 10:39:05 AM (5 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r84326 r84532 3957 3957 <enum 3958 3958 name="VirtualSystemDescriptionType" 3959 uuid=" 9078595f-74cf-4454-8787-34a8f72beed5"3959 uuid="6e18c6d7-e1b7-4cb0-9706-1f31d18248f8" 3960 3960 > 3961 3961 <desc>Used with <link to="IVirtualSystemDescription" /> to describe the type of … … 4025 4025 <const name="CloudPublicSSHKey" value="48" /> 4026 4026 <const name="BootingFirmware" value="49" /> 4027 <const name="HardDiskControllerVirtioSCSI" value="60" /> 4027 4028 </enum> 4028 4029 -
trunk/src/VBox/Main/include/ovfreader.h
r82968 r84532 535 535 uint32_t idController; // instance ID (Item/InstanceId); this gets referenced from VirtualDisk 536 536 537 enum ControllerSystemType { IDE, SATA, SCSI };538 ControllerSystemType system; // one of IDE, SATA, SCSI 537 enum ControllerSystemType { IDE, SATA, SCSI, VIRTIOSCSI }; 538 ControllerSystemType system; // one of IDE, SATA, SCSI, VIRTIOSCSI 539 539 540 540 RTCString strControllerType; -
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r84153 r84532 1770 1770 case VirtualSystemDescriptionType_HardDiskControllerSATA: 1771 1771 case VirtualSystemDescriptionType_HardDiskControllerSCSI: 1772 case VirtualSystemDescriptionType_HardDiskControllerVirtioSCSI: 1772 1773 case VirtualSystemDescriptionType_HardDiskControllerSAS: 1773 1774 if (d.strRef == strRef) -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r83794 r84532 187 187 int32_t lSATAControllerIndex = 0; 188 188 int32_t lSCSIControllerIndex = 0; 189 int32_t lVirtioSCSIControllerIndex = 0; 189 190 190 191 /* Fetch all available storage controllers */ … … 196 197 ComPtr<IStorageController> pSATAController; 197 198 ComPtr<IStorageController> pSCSIController; 199 ComPtr<IStorageController> pVirtioSCSIController; 198 200 ComPtr<IStorageController> pSASController; 199 201 for (size_t j = 0; j < nwControllers.size(); ++j) … … 214 216 && pSASController.isNull()) 215 217 pSASController = nwControllers[j]; 218 else if ( eType == StorageBus_VirtioSCSI 219 && pVirtioSCSIController.isNull()) 220 pVirtioSCSIController = nwControllers[j]; 216 221 } 217 222 … … 294 299 } 295 300 301 if (!pVirtioSCSIController.isNull()) 302 { 303 StorageControllerType_T ctlr; 304 rc = pVirtioSCSIController->COMGETTER(ControllerType)(&ctlr); 305 if (SUCCEEDED(rc)) 306 { 307 Utf8Str strVBox = "VirtioSCSI"; // the default in VBox 308 switch (ctlr) 309 { 310 case StorageControllerType_VirtioSCSI: strVBox = "VirtioSCSI"; break; 311 default: break; /* Shut up MSC. */ 312 } 313 lVirtioSCSIControllerIndex = (int32_t)pNewDesc->m->maDescriptions.size(); 314 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerVirtioSCSI, 315 Utf8StrFmt("%d", lVirtioSCSIControllerIndex), 316 strVBox, 317 strVBox); 318 } 319 else 320 throw rc; 321 } 322 296 323 // <const name="HardDiskImage" value="9" /> 297 324 // <const name="Floppy" value="18" /> … … 339 366 Utf8Str strStBus; 340 367 if ( storageBus == StorageBus_IDE) 341 strStBus = "IDE";368 strStBus = "IDE"; 342 369 else if ( storageBus == StorageBus_SATA) 343 strStBus = "SATA";370 strStBus = "SATA"; 344 371 else if ( storageBus == StorageBus_SCSI) 345 strStBus = "SCSI";372 strStBus = "SCSI"; 346 373 else if ( storageBus == StorageBus_SAS) 347 strStBus = "SAS"; 374 strStBus = "SAS"; 375 else if ( storageBus == StorageBus_VirtioSCSI) 376 strStBus = "VirtioSCSI"; 377 348 378 LogRel(("Warning: skip the medium (bus: %s, slot: %d, port: %d). No storage device attached.\n", 349 379 strStBus.c_str(), lDevice, lChannel)); … … 516 546 break; 517 547 548 case StorageBus_VirtioSCSI: 549 lChannelVsys = lChannel; // should be between 0 and 255 550 lControllerVsys = lVirtioSCSIControllerIndex; 551 break; 552 518 553 case StorageBus_SCSI: 519 554 case StorageBus_SAS: … … 896 931 } 897 932 898 // we need to do that as otherwise Task won't be created successfully 899 /// @todo r=bird: What's 'that' here exactly? 933 // Create a progress object here otherwise Task won't be created successfully 900 934 HRESULT hrc = aProgress.createObject(); 901 935 if (SUCCEEDED(hrc)) … … 1479 1513 uint32_t idSCSIController = 0; 1480 1514 int32_t lSCSIControllerIndex = 0; 1515 uint32_t idVirtioSCSIController = 0; 1516 int32_t lVirtioSCSIControllerIndex = 0; 1481 1517 1482 1518 uint32_t ulInstanceID = 1; … … 1691 1727 break; 1692 1728 1729 1730 case VirtualSystemDescriptionType_HardDiskControllerVirtioSCSI: 1731 /* <Item> 1732 <rasd:Caption>VirtioSCSIController0</rasd:Caption> 1733 <rasd:Description>VirtioSCSI Controller</rasd:Description> 1734 <rasd:InstanceId>4</rasd:InstanceId> 1735 <rasd:ResourceType>20</rasd:ResourceType> 1736 <rasd:Address>0</rasd:Address> 1737 <rasd:BusNumber>0</rasd:BusNumber> 1738 </Item> 1739 */ 1740 if (uLoop == 1) 1741 { 1742 strDescription = "VirtioSCSI Controller"; 1743 strCaption = "virtioSCSIController0"; 1744 type = ovf::ResourceType_OtherStorageDevice; // 20 1745 lAddress = 0; 1746 lBusNumber = 0; 1747 strResourceSubType = "VirtioSCSI"; 1748 // remember this ID 1749 idVirtioSCSIController = ulInstanceID; 1750 lVirtioSCSIControllerIndex = lIndexThis; 1751 } 1752 break; 1753 1693 1754 case VirtualSystemDescriptionType_HardDiskImage: 1694 1755 /* <Item> … … 1727 1788 else if (lControllerIndex == lSATAControllerIndex) 1728 1789 ulParent = idSATAController; 1790 else if (lControllerIndex == lVirtioSCSIControllerIndex) 1791 ulParent = idVirtioSCSIController; 1729 1792 } 1730 1793 if (pos2 != Utf8Str::npos) -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r84531 r84532 563 563 uint16_t cSATAused = 0; NOREF(cSATAused); 564 564 uint16_t cSCSIused = 0; NOREF(cSCSIused); 565 uint16_t cVIRTIOSCSIused = 0; NOREF(cVIRTIOSCSIused); 566 565 567 ovf::ControllersMap::const_iterator hdcIt; 566 568 /* Iterate through all storage controllers */ … … 651 653 ++cSCSIused; 652 654 break; 655 656 case ovf::HardDiskController::VIRTIOSCSI: 657 /* Check for the constrains */ 658 if (cVIRTIOSCSIused < 1) 659 { 660 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerVirtioSCSI, 661 strControllerID, 662 hdc.strControllerType, 663 "VirtioSCSI"); 664 } 665 else 666 { 667 /* Warn only once */ 668 if (cVIRTIOSCSIused == 1) 669 i_addWarning(tr("The virtual system \"%s\" requests support for more than one " 670 "VirtioSCSI controller, but VirtualBox has support for only one"), 671 vsysThis.strName.c_str()); 672 673 } 674 ++cVIRTIOSCSIused; 675 break; 676 653 677 } 654 678 } … … 3944 3968 } 3945 3969 3970 case ovf::HardDiskController::VIRTIOSCSI: 3971 controllerName = "VirtioSCSI"; 3972 lControllerPort = (long)ulAddressOnParent; 3973 lDevice = (long)0; 3974 break; 3975 3946 3976 default: break; 3947 3977 } … … 4655 4685 rc = pController->COMSETTER(ControllerType)(StorageControllerType_LsiLogicSas); 4656 4686 if (FAILED(rc)) throw rc; 4687 } 4688 4689 4690 /* Storage controller VirtioSCSI */ 4691 std::list<VirtualSystemDescriptionEntry*> vsdeHDCVirtioSCSI = 4692 vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerVirtioSCSI); 4693 if (vsdeHDCVirtioSCSI.size() > 1) 4694 throw setError(VBOX_E_FILE_ERROR, 4695 tr("Too many VirtioSCSI controllers in OVF; import facility only supports one")); 4696 if (!vsdeHDCVirtioSCSI.empty()) 4697 { 4698 ComPtr<IStorageController> pController; 4699 Utf8Str strName("VirtioSCSI"); 4700 const Utf8Str &hdcVBox = vsdeHDCVirtioSCSI.front()->strVBoxCurrent; 4701 if (hdcVBox == "VirtioSCSI") 4702 { 4703 rc = pNewMachine->AddStorageController(Bstr(strName).raw(), 4704 StorageBus_VirtioSCSI, 4705 pController.asOutParam()); 4706 if (FAILED(rc)) throw rc; 4707 4708 rc = pController->COMSETTER(ControllerType)(StorageControllerType_VirtioSCSI); 4709 if (FAILED(rc)) throw rc; 4710 } 4711 else 4712 throw setError(VBOX_E_FILE_ERROR, 4713 tr("Invalid VirtioSCSI controller type \"%s\""), 4714 hdcVBox.c_str()); 4657 4715 } 4658 4716 -
trunk/src/VBox/Main/xml/ovfreader.cpp
r82968 r84532 662 662 vsys.mapControllers[i.ulInstanceID] = hdc; 663 663 } 664 else if ( i.strResourceSubType.compare("VirtioSCSI", RTCString::CaseInsensitive) == 0 ) 665 { 666 HardDiskController hdc; 667 hdc.system = HardDiskController::VIRTIOSCSI; 668 hdc.idController = i.ulInstanceID; 669 //<rasd:ResourceSubType>VirtioSCSI</rasd:ResourceSubType> 670 hdc.strControllerType = i.strResourceSubType; 671 vsys.mapControllers[i.ulInstanceID] = hdc; 672 } 664 673 else 665 674 throw OVFLogicError(N_("Error reading \"%s\": Host resource of type \"Other Storage Device (%d)\" is supported with SATA AHCI controllers only, line %d (subtype:%s)"),
Note:
See TracChangeset
for help on using the changeset viewer.