- Timestamp:
- Oct 17, 2023 11:45:00 AM (12 months ago)
- Location:
- trunk/src/VBox
- Files:
-
- 10 edited
-
Frontends/VBoxManage/VBoxManageAppliance.cpp (modified) (1 diff)
-
Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp (modified) (4 diffs)
-
Frontends/VirtualBox/src/widgets/UIApplianceExportEditorWidget.cpp (modified) (1 diff)
-
Main/idl/VirtualBox.xidl (modified) (1 diff)
-
Main/include/ovfreader.h (modified) (1 diff)
-
Main/src-server/ApplianceImpl.cpp (modified) (1 diff)
-
Main/src-server/ApplianceImplExport.cpp (modified) (10 diffs)
-
Main/src-server/ApplianceImplImport.cpp (modified) (9 diffs)
-
Main/testcase/tstOVF.cpp (modified) (1 diff)
-
Main/xml/ovfreader.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
r101035 r101472 864 864 else 865 865 RTPrintf(Appliance::tr("%2u: VirtioSCSI controller, type %ls\n" 866 " (disable with \"--vsys %u --unit %u --ignore\")\n"), 867 a, 868 aVBoxValues[a], 869 i, a); 870 break; 871 872 case VirtualSystemDescriptionType_HardDiskControllerNVMe: 873 if (fIgnoreThis) 874 { 875 RTPrintf(Appliance::tr("%2u: NVMe controller, type %ls -- disabled\n"), 876 a, 877 aVBoxValues[a]); 878 aEnabled[a] = false; 879 } 880 else 881 RTPrintf(Appliance::tr("%2u: NVMe controller, type %ls\n" 866 882 " (disable with \"--vsys %u --unit %u --ignore\")\n"), 867 883 a, -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r101316 r101472 499 499 case KVirtualSystemDescriptionType_HardDiskControllerVirtioSCSI: value = UIApplianceEditorWidget::tr("Storage Controller (VirtioSCSI)"); break; 500 500 case KVirtualSystemDescriptionType_HardDiskControllerSAS: value = UIApplianceEditorWidget::tr("Storage Controller (SAS)"); break; 501 case KVirtualSystemDescriptionType_HardDiskControllerNVMe: value = UIApplianceEditorWidget::tr("Storage Controller (NVMe)"); break; 501 502 case KVirtualSystemDescriptionType_CDROM: value = UIApplianceEditorWidget::tr("DVD"); break; 502 503 case KVirtualSystemDescriptionType_Floppy: value = UIApplianceEditorWidget::tr("Floppy"); break; … … 674 675 case KVirtualSystemDescriptionType_HardDiskControllerVirtioSCSI: value = UIIconPool::iconSet(":/virtio_scsi_16px.png"); break; 675 676 case KVirtualSystemDescriptionType_HardDiskControllerSAS: value = UIIconPool::iconSet(":/sas_16px.png"); break; 677 case KVirtualSystemDescriptionType_HardDiskControllerNVMe: value = UIIconPool::iconSet(":/pcie_16px.png"); break; 676 678 case KVirtualSystemDescriptionType_HardDiskImage: value = UIIconPool::iconSet(":/hd_16px.png"); break; 677 679 case KVirtualSystemDescriptionType_CDROM: value = UIIconPool::iconSet(":/cd_16px.png"); break; … … 1361 1363 types[i] == KVirtualSystemDescriptionType_HardDiskControllerSCSI || 1362 1364 types[i] == KVirtualSystemDescriptionType_HardDiskControllerVirtioSCSI || 1363 types[i] == KVirtualSystemDescriptionType_HardDiskControllerSAS) 1365 types[i] == KVirtualSystemDescriptionType_HardDiskControllerSAS || 1366 types[i] == KVirtualSystemDescriptionType_HardDiskControllerNVMe) 1364 1367 controllerMap[i] = pHardwareItem; 1365 1368 } … … 1703 1706 KVirtualSystemDescriptionType_HardDiskControllerVirtioSCSI, 1704 1707 KVirtualSystemDescriptionType_HardDiskControllerSAS, 1708 KVirtualSystemDescriptionType_HardDiskControllerNVMe, 1705 1709 /* OCI */ 1706 1710 KVirtualSystemDescriptionType_CloudProfileName, -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceExportEditorWidget.cpp
r98103 r101472 58 58 << KVirtualSystemDescriptionType_HardDiskControllerVirtioSCSI 59 59 << KVirtualSystemDescriptionType_HardDiskControllerSAS 60 << KVirtualSystemDescriptionType_HardDiskControllerNVMe 60 61 << KVirtualSystemDescriptionType_CloudProfileName; 61 62 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r101418 r101472 4668 4668 <const name="CloudImageFreeFormTags" value="56" /> 4669 4669 <const name="HardDiskControllerVirtioSCSI" value="60" /> 4670 <const name="HardDiskControllerNVMe" value="61" /> 4670 4671 </enum> 4671 4672 -
trunk/src/VBox/Main/include/ovfreader.h
r99604 r101472 568 568 RTCString strIdController; // instance ID (Item/InstanceId); this gets referenced from VirtualDisk 569 569 570 enum ControllerSystemType { IDE, SATA, SCSI, VIRTIOSCSI };571 ControllerSystemType system; // one of IDE, SATA, SCSI, VIRTIOSCSI 570 enum ControllerSystemType { IDE, SATA, SCSI, VIRTIOSCSI, NVMe }; 571 ControllerSystemType system; // one of IDE, SATA, SCSI, VIRTIOSCSI, NVMe 572 572 573 573 RTCString strControllerType; -
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); -
trunk/src/VBox/Main/testcase/tstOVF.cpp
r101463 r101472 209 209 break; 210 210 211 case VirtualSystemDescriptionType_HardDiskControllerNVMe: 212 pcszType = "nvme"; 213 break; 214 211 215 case VirtualSystemDescriptionType_HardDiskImage: 212 216 pcszType = "hd"; -
trunk/src/VBox/Main/xml/ovfreader.cpp
r99739 r101472 653 653 break; 654 654 655 case ResourceType_OtherStorageDevice: // 20 SATA controller655 case ResourceType_OtherStorageDevice: // 20 SATA/Virtio-SCSI/NVMe controller 656 656 { 657 657 /* <Item> … … 678 678 { 679 679 HardDiskController hdc; 680 hdc.system = HardDiskController::VIRTIOSCSI; /**< r=klaus: GUI needs to learn about this in the import dialog, currently shown as "Unknown Hardware Item". */680 hdc.system = HardDiskController::VIRTIOSCSI; 681 681 hdc.strIdController = i.strInstanceID; 682 682 //<rasd:ResourceSubType>VirtioSCSI</rasd:ResourceSubType> … … 684 684 vsys.mapControllers[i.strInstanceID] = hdc; 685 685 } 686 else if ( i.strResourceSubType.compare("NVMe", RTCString::CaseInsensitive) == 0 687 || i.strResourceSubType.compare("vmware.nvme.controller", RTCString::CaseInsensitive) == 0 ) 688 { 689 HardDiskController hdc; 690 hdc.system = HardDiskController::NVMe; 691 hdc.strIdController = i.strInstanceID; 692 //<rasd:ResourceSubType>NVMe</rasd:ResourceSubType> 693 hdc.strControllerType = i.strResourceSubType; 694 vsys.mapControllers[i.strInstanceID] = hdc; 695 } 686 696 else 687 throw OVFLogicError(N_("Error reading \"%s\": Host resource of type \"Other Storage Device (%d)\" is supported with SATA AHCI or virtio-scsicontrollers only, line %d (subtype:%s)"),697 throw OVFLogicError(N_("Error reading \"%s\": Host resource of type \"Other Storage Device (%d)\" is supported with SATA AHCI or Virtio-SCSI or NVMe controllers only, line %d (subtype:%s)"), 688 698 m_strPath.c_str(), 689 699 ResourceType_OtherStorageDevice,
Note:
See TracChangeset
for help on using the changeset viewer.

