Changeset 101472 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Oct 17, 2023 11:45:00 AM (16 months ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r100852 r101472 1872 1872 case VirtualSystemDescriptionType_HardDiskControllerSCSI: 1873 1873 case VirtualSystemDescriptionType_HardDiskControllerVirtioSCSI: 1874 case VirtualSystemDescriptionType_HardDiskControllerNVMe: 1874 1875 case VirtualSystemDescriptionType_HardDiskControllerSAS: 1875 1876 if (d.strRef == id) -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r101456 r101472 205 205 int32_t lSCSIControllerIndex = 0; 206 206 int32_t lVirtioSCSIControllerIndex = 0; 207 int32_t lNVMeControllerIndex = 0; 207 208 208 209 /* Fetch all available storage controllers */ … … 214 215 ComPtr<IStorageController> pSATAController; 215 216 ComPtr<IStorageController> pSCSIController; 217 ComPtr<IStorageController> pSASController; 216 218 ComPtr<IStorageController> pVirtioSCSIController; 217 ComPtr<IStorageController> p SASController;219 ComPtr<IStorageController> pNVMeController; 218 220 for (size_t j = 0; j < nwControllers.size(); ++j) 219 221 { … … 236 238 && pVirtioSCSIController.isNull()) 237 239 pVirtioSCSIController = nwControllers[j]; 240 else if ( eType == StorageBus_PCIe 241 && pNVMeController.isNull()) 242 pNVMeController = nwControllers[j]; 238 243 } 239 244 … … 338 343 } 339 344 345 if (!pNVMeController.isNull()) 346 { 347 Utf8Str strVBox = "NVMe"; 348 lNVMeControllerIndex = (int32_t)pNewDesc->m->maDescriptions.size(); 349 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerNVMe, 350 Utf8StrFmt("%d", lNVMeControllerIndex), 351 strVBox, 352 strVBox); 353 } 354 340 355 // <const name="HardDiskImage" value="9" /> 341 356 // <const name="Floppy" value="18" /> … … 390 405 else if ( storageBus == StorageBus_SAS) 391 406 strStBus = "SAS"; 407 else if ( storageBus == StorageBus_PCIe) 408 strStBus = "PCIe"; 392 409 else if ( storageBus == StorageBus_VirtioSCSI) 393 410 strStBus = "VirtioSCSI"; … … 574 591 break; 575 592 593 case StorageBus_PCIe: 594 lChannelVsys = lChannel; // should be between 0 and 255 595 lControllerVsys = lNVMeControllerIndex; 596 break; 597 576 598 case StorageBus_Floppy: 577 599 lChannelVsys = 0; … … 1535 1557 uint32_t idVirtioSCSIController = 0; 1536 1558 int32_t lVirtioSCSIControllerIndex = 0; 1559 uint32_t idNVMeController = 0; 1560 int32_t lNVMeControllerIndex = 0; 1537 1561 1538 1562 uint32_t ulInstanceID = 1; … … 1557 1581 : desc.type == VirtualSystemDescriptionType_HardDiskControllerSCSI ? "HardDiskControllerSCSI" 1558 1582 : desc.type == VirtualSystemDescriptionType_HardDiskControllerSAS ? "HardDiskControllerSAS" 1583 : desc.type == VirtualSystemDescriptionType_HardDiskControllerNVMe ? "HardDiskControllerNVMe" 1559 1584 : desc.type == VirtualSystemDescriptionType_HardDiskImage ? "HardDiskImage" 1560 1585 : Utf8StrFmt("%d", desc.type).c_str()), … … 1773 1798 break; 1774 1799 1800 case VirtualSystemDescriptionType_HardDiskControllerNVMe: 1801 /* <Item> 1802 <rasd:Caption>NVMeController0</rasd:Caption> 1803 <rasd:Description>NVMe Controller</rasd:Description> 1804 <rasd:InstanceId>4</rasd:InstanceId> 1805 <rasd:ResourceType>20</rasd:ResourceType> 1806 <rasd:Address>0</rasd:Address> 1807 <rasd:BusNumber>0</rasd:BusNumber> 1808 </Item> 1809 */ 1810 if (uLoop == 1) 1811 { 1812 strDescription = "NVMe Controller"; 1813 strCaption = "nvmeController0"; 1814 type = ovf::ResourceType_OtherStorageDevice; // 20 1815 lAddress = 0; 1816 lBusNumber = 0; 1817 strResourceSubType = "NVMe"; 1818 // remember this ID 1819 idNVMeController = ulInstanceID; 1820 lNVMeControllerIndex = lIndexThis; 1821 } 1822 break; 1823 1775 1824 case VirtualSystemDescriptionType_HardDiskImage: 1776 1825 /* <Item> … … 1811 1860 else if (lControllerIndex == lVirtioSCSIControllerIndex) 1812 1861 ulParent = idVirtioSCSIController; 1862 else if (lControllerIndex == lNVMeControllerIndex) 1863 ulParent = idNVMeController; 1813 1864 } 1814 1865 if (pos2 != Utf8Str::npos) -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r101057 r101472 419 419 420 420 const settings::NetworkAdaptersList &llNetworkAdapters = pNewDesc->m->pConfig->hardwareMachine.llNetworkAdapters; 421 /* Check for the constrain s */421 /* Check for the constraints */ 422 422 if (llNetworkAdapters.size() > maxNetworkAdapters) 423 423 i_addWarning(tr("Virtual appliance \"%s\" was configured with %zu network adapters however " … … 449 449 uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(ChipsetType_PIIX3); /** @todo BUGBUG x86 only for now. */ 450 450 451 /* Check for the constrain s */451 /* Check for the constraints */ 452 452 if (cEthernetAdapters > maxNetworkAdapters) 453 453 i_addWarning(tr("Virtual appliance \"%s\" was configured with %zu network adapters however " … … 582 582 uint16_t cSCSIused = 0; NOREF(cSCSIused); 583 583 uint16_t cVIRTIOSCSIused = 0; NOREF(cVIRTIOSCSIused); 584 uint16_t cNVMeused = 0; NOREF(cNVMeused); 584 585 585 586 ovf::ControllersMap::const_iterator hdcIt; … … 594 595 { 595 596 case ovf::HardDiskController::IDE: 596 /* Check for the constrain s */597 /* Check for the constraints */ 597 598 if (cIDEused < 4) 598 599 { … … 621 622 622 623 case ovf::HardDiskController::SATA: 623 /* Check for the constrain s */624 /* Check for the constraints */ 624 625 if (cSATAused < 1) 625 626 { … … 645 646 646 647 case ovf::HardDiskController::SCSI: 647 /* Check for the constrain s */648 /* Check for the constraints */ 648 649 if (cSCSIused < 1) 649 650 { … … 674 675 675 676 case ovf::HardDiskController::VIRTIOSCSI: 676 /* Check for the constrain s */677 /* Check for the constraints */ 677 678 if (cVIRTIOSCSIused < 1) 678 679 { … … 693 694 } 694 695 ++cVIRTIOSCSIused; 696 break; 697 698 case ovf::HardDiskController::NVMe: 699 /* Check for the constraints */ 700 if (cNVMeused < 1) 701 { 702 pNewDesc->i_addEntry(VirtualSystemDescriptionType_HardDiskControllerNVMe, 703 hdc.strIdController, 704 hdc.strControllerType, 705 "NVMe"); 706 } 707 else 708 { 709 /* Warn only once */ 710 if (cNVMeused == 1) 711 i_addWarning(tr("Virtual appliance \"%s\" was configured with more than one " 712 "NVMe controller however VirtualBox supports a maximum " 713 "of one NVMe controller."), 714 vsysThis.strName.c_str()); 715 716 } 717 ++cNVMeused; 695 718 break; 696 719 … … 4856 4879 } 4857 4880 4881 /* Storage controller NVMe */ 4882 std::list<VirtualSystemDescriptionEntry*> vsdeHDCNVMe = 4883 vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerNVMe); 4884 if (vsdeHDCNVMe.size() > 1) 4885 throw setError(VBOX_E_FILE_ERROR, 4886 tr("Too many NVMe controllers in OVF; import facility only supports one")); 4887 if (!vsdeHDCNVMe.empty()) 4888 { 4889 ComPtr<IStorageController> pController; 4890 Utf8Str strName("NVMe"); 4891 const Utf8Str &hdcVBox = vsdeHDCNVMe.front()->strVBoxCurrent; 4892 if (hdcVBox == "NVMe") 4893 { 4894 hrc = pNewMachine->AddStorageController(Bstr(strName).raw(), StorageBus_PCIe, pController.asOutParam()); 4895 if (FAILED(hrc)) throw hrc; 4896 4897 hrc = pController->COMSETTER(ControllerType)(StorageControllerType_NVMe); 4898 if (FAILED(hrc)) throw hrc; 4899 } 4900 else 4901 throw setError(VBOX_E_FILE_ERROR, tr("Invalid NVMe controller type \"%s\""), hdcVBox.c_str()); 4902 } 4903 4858 4904 /* Now its time to register the machine before we add any storage devices */ 4859 4905 hrc = mVirtualBox->RegisterMachine(pNewMachine);
Note:
See TracChangeset
for help on using the changeset viewer.