Changeset 101472 in vbox for trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
- Timestamp:
- Oct 17, 2023 11:45:00 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.