Changeset 16495 in vbox
- Timestamp:
- Feb 3, 2009 9:20:36 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
include/VBox/com/string.h (modified) (1 diff)
-
src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp (modified) (3 diffs)
-
src/VBox/Main/ApplianceImpl.cpp (modified) (48 diffs)
-
src/VBox/Main/glue/string.cpp (modified) (1 diff)
-
src/VBox/Main/idl/VirtualBox.xidl (modified) (3 diffs)
-
src/VBox/Main/include/ApplianceImpl.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/string.h
r16384 r16495 513 513 514 514 /** 515 * Attempts to convert the member string into an unsigned 64-bit integer. 516 * @return IPRT error code. 517 * @param i Output buffer. 518 */ 519 int toInt(uint64_t &i) const; 520 521 /** 522 * Attempts to convert the member string into an unsigned 32-bit integer. 523 * @return IPRT error code. 524 * @param i Output buffer. 525 */ 526 int toInt(uint32_t &i) const; 527 528 /** 515 529 * Intended to pass instances as out (|char **|) parameters to methods. 516 530 * Takes the ownership of the returned data. -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp
r16491 r16495 25 25 * Header Files * 26 26 *******************************************************************************/ 27 #ifndef VBOX_ONLY_DOCS 28 #include <VBox/com/com.h> 29 #include <VBox/com/string.h> 30 #include <VBox/com/Guid.h> 31 #include <VBox/com/array.h> 32 #include <VBox/com/ErrorInfo.h> 33 #include <VBox/com/EventQueue.h> 34 35 #include <VBox/com/VirtualBox.h> 36 37 #include <list> 38 #endif /* !VBOX_ONLY_DOCS */ 39 40 #include <iprt/stream.h> 41 42 #include <VBox/log.h> 43 27 44 #include "VBoxManage.h" 28 45 using namespace com; … … 31 48 // funcs 32 49 /////////////////////////////////////////////////////////////////////////////// 33 34 35 50 36 51 int handleImportAppliance(HandlerArg *a) … … 38 53 HRESULT rc = S_OK; 39 54 55 Utf8Str strOvfFilename; 56 57 for (int i = 0; i < a->argc; i++) 58 { 59 if (!strOvfFilename) 60 strOvfFilename = a->argv[i]; 61 else 62 return errorSyntax(USAGE_IMPORTAPPLIANCE, "Too many arguments for \"import\" command."); 63 } 64 65 if (!strOvfFilename) 66 return errorSyntax(USAGE_IMPORTAPPLIANCE, "Not enough arguments for \"import\" command."); 67 68 do 69 { 70 Bstr bstrOvfFilename(strOvfFilename); 71 ComPtr<IAppliance> appliance; 72 CHECK_ERROR_BREAK(a->virtualBox, OpenAppliance(bstrOvfFilename, appliance.asOutParam())); 73 74 RTPrintf("Interpreting...\n"); 75 CHECK_ERROR_BREAK(appliance, Interpret()); 76 RTPrintf("OK.\n"); 77 78 // fetch all disks 79 com::SafeArray<BSTR> retDisks; 80 CHECK_ERROR_BREAK(appliance, 81 COMGETTER(Disks)(ComSafeArrayAsOutParam(retDisks))); 82 if (retDisks.size() > 0) 83 { 84 RTPrintf("Disks:"); 85 for (unsigned i = 0; i < retDisks.size(); i++) 86 RTPrintf(" %ls", retDisks[i]); 87 RTPrintf("\n"); 88 } 89 90 // fetch virtual system descriptions 91 com::SafeIfaceArray<IVirtualSystemDescription> aVirtualSystemDescriptions; 92 CHECK_ERROR_BREAK(appliance, 93 COMGETTER(VirtualSystemDescriptions)(ComSafeArrayAsOutParam(aVirtualSystemDescriptions))); 94 if (aVirtualSystemDescriptions.size() > 0) 95 { 96 for (unsigned i = 0; i < aVirtualSystemDescriptions.size(); ++i) 97 { 98 com::SafeArray<VirtualSystemDescriptionType_T> retTypes; 99 com::SafeArray<ULONG> aRefs; 100 com::SafeArray<BSTR> aOrigValues; 101 com::SafeArray<BSTR> aConfigValues; 102 com::SafeArray<BSTR> aExtraConfigValues; 103 CHECK_ERROR_BREAK(aVirtualSystemDescriptions[i], 104 GetDescription(ComSafeArrayAsOutParam(retTypes), 105 ComSafeArrayAsOutParam(aRefs), 106 ComSafeArrayAsOutParam(aOrigValues), 107 ComSafeArrayAsOutParam(aConfigValues), 108 ComSafeArrayAsOutParam(aExtraConfigValues))); 109 110 RTPrintf("Virtual system %i:\n", i); 111 for (unsigned a = 0; a < retTypes.size(); ++a) 112 { 113 VirtualSystemDescriptionType_T t = retTypes[a]; 114 115 Bstr bstrVMname; 116 Bstr bstrOstype; 117 uint32_t ulMemMB; 118 bool fUSB = false; 119 120 switch (t) 121 { 122 case VirtualSystemDescriptionType_Name: 123 bstrVMname = aConfigValues[a]; 124 RTPrintf("%2d: Suggested VM name \"%ls\"" 125 "\n (change with \"-vsys %d -vmname <name>\")\n", 126 a, bstrVMname.raw(), i); 127 break; 128 129 case VirtualSystemDescriptionType_OS: 130 bstrOstype = aConfigValues[a]; 131 RTPrintf("%2d: Suggested OS type: \"%ls\"" 132 "\n (change with \"-vsys %d -ostype <type>\"; use \"list ostypes\" to list all)\n", 133 a, bstrOstype.raw(), i); 134 break; 135 136 case VirtualSystemDescriptionType_CPU: 137 RTPrintf("%2d: Number of CPUs (ignored): %ls\n", 138 a, aConfigValues[a]); 139 break; 140 141 case VirtualSystemDescriptionType_Memory: 142 Utf8Str(Bstr(aConfigValues[a])).toInt(ulMemMB); 143 ulMemMB /= 1024 * 1024; 144 RTPrintf("%2d: Guest memory: %u MB\n (change with \"-vsys %d -memory <MB>\")\n", 145 a, ulMemMB, i); 146 break; 147 148 case VirtualSystemDescriptionType_HardDiskControllerIDE: 149 RTPrintf("%2d: IDE controller: reference ID %d" 150 "\n (disable with \"-vsys %d -ignore %d\")\n", 151 a, 152 aRefs[a], 153 i, a); 154 break; 155 156 case VirtualSystemDescriptionType_HardDiskControllerSATA: 157 RTPrintf("%2d: SATA controller: reference ID %d" 158 "\n (disable with \"-vsys %d -ignore %d\")\n", 159 a, 160 aRefs[a], 161 i, a); 162 break; 163 164 case VirtualSystemDescriptionType_HardDiskControllerSCSI: 165 RTPrintf("%2d: SCSI controller: reference ID %d, type %ls" 166 "\n (change with \"-vsys %d -scsitype%d={BusLogic|LsiLogic}\";" 167 "\n disable with \"-vsys %d -ignore %d\")\n", 168 a, 169 aRefs[a], 170 aConfigValues[a], 171 i, a, i, a); 172 break; 173 174 case VirtualSystemDescriptionType_HardDiskImage: 175 RTPrintf("%2d: Hard disk image: controller %d, source image \"%ls\", target image \"%ls\"" 176 "\n (change controller with \"-vsys %d -controller%d=<id>\";" 177 "\n disable with \"-vsys %d -ignore %d\")\n", 178 a, 179 aRefs[a], 180 aOrigValues[a], 181 aConfigValues[a], 182 i, a, i, a); 183 break; 184 185 case VirtualSystemDescriptionType_CDROM: 186 RTPrintf("%2d: CD-ROM" 187 "\n (disable with \"-vsys %d -ignore %d\")\n", 188 a, i, a); 189 break; 190 191 case VirtualSystemDescriptionType_Floppy: 192 RTPrintf("%2d: Floppy" 193 "\n (disable with \"-vsys %d -ignore %d\")\n", 194 a, i, a); 195 break; 196 197 case VirtualSystemDescriptionType_NetworkAdapter: 198 RTPrintf("%2d: Network adapter: orig %ls, auto %ls, conf %ls\n", 199 a, 200 aOrigValues[a], 201 aConfigValues[a], 202 aExtraConfigValues[a]); 203 break; 204 205 case VirtualSystemDescriptionType_USBController: 206 RTPrintf("%2d: USB controller" 207 "\n (disable with \"-vsys %d -ignore %d\")\n", 208 a, i, a); 209 break; 210 211 case VirtualSystemDescriptionType_SoundCard: 212 RTPrintf("%2d: Sound card (appliance expects \"%ls\", can change on import)" 213 "\n (disable with \"-vsys %d -ignore %d\")\n", 214 a, 215 aOrigValues[a], 216 i, 217 a); 218 break; 219 } 220 } 221 } 222 RTPrintf("\n"); 223 } 224 } while (0); 225 40 226 return SUCCEEDED(rc) ? 0 : 1; 41 227 } -
trunk/src/VBox/Main/ApplianceImpl.cpp
r16362 r16495 108 108 }; 109 109 110 typedef map< Utf8Str, DiskImage> DiskImagesMap;110 typedef map<uint32_t, DiskImage> DiskImagesMap; 111 111 typedef map<Utf8Str, Network> NetworksMap; 112 112 … … 129 129 typedef map<uint32_t, VirtualHardwareItem> HardwareItemsMap; 130 130 131 enum ControllerSystemType { IDE, SATA, SCSI };132 131 struct HardDiskController 133 132 { 134 133 uint32_t idController; // instance ID (Item/InstanceId); this gets referenced from HardDisk 135 ControllerSystemType controllerSystem; // one of IDE, SATA, SCSI 134 enum ControllerSystemType { IDE, SATA, SCSI }; 135 ControllerSystemType system; // one of IDE, SATA, SCSI 136 136 Utf8Str strControllerType; // controllertype (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE) 137 137 Utf8Str strAddress; // for IDE … … 446 446 const xml::Node *pelmVirtualSystem) 447 447 { 448 VirtualSystem d;448 VirtualSystem vsys; 449 449 450 450 const xml::Node *pIdAttr = pelmVirtualSystem->findAttribute("id"); 451 451 if (pIdAttr) 452 d.strName = pIdAttr->getValue();452 vsys.strName = pIdAttr->getValue(); 453 453 454 454 xml::NodesLoop loop(*pelmVirtualSystem); // all child elements … … 472 472 ) 473 473 { 474 d.strLicenceInfo = pelmInfo->getValue();475 d.strLicenceText = pelmLicense->getValue();474 vsys.strLicenceInfo = pelmInfo->getValue(); 475 vsys.strLicenceText = pelmLicense->getValue(); 476 476 } 477 477 } … … 491 491 </System>*/ 492 492 if ((pelmVirtualSystemType = pelmSystem->findChildElement("VirtualSystemType"))) 493 d.strVirtualSystemType = pelmVirtualSystemType->getValue();493 vsys.strVirtualSystemType = pelmVirtualSystemType->getValue(); 494 494 } 495 495 … … 568 568 569 569 // store! 570 d.mapHardwareItems[i.ulInstanceID] = i;570 vsys.mapHardwareItems[i.ulInstanceID] = i; 571 571 } 572 572 573 573 HardwareItemsMap::const_iterator itH; 574 574 575 for (itH = d.mapHardwareItems.begin();576 itH != d.mapHardwareItems.end();575 for (itH = vsys.mapHardwareItems.begin(); 576 itH != vsys.mapHardwareItems.end(); 577 577 ++itH) 578 578 { … … 590 590 <rasd:VirtualQuantity>1</rasd:VirtualQuantity>*/ 591 591 if (i.ullVirtualQuantity < UINT16_MAX) 592 d.cCPUs = (uint16_t)i.ullVirtualQuantity;592 vsys.cCPUs = (uint16_t)i.ullVirtualQuantity; 593 593 else 594 594 return setError(VBOX_E_FILE_ERROR, … … 605 605 || (i.strAllocationUnits == "byte * 2^20") // suggested by OVF spec DSP0243 page 21 606 606 ) 607 d.ullMemorySize = i.ullVirtualQuantity * 1024 * 1024;607 vsys.ullMemorySize = i.ullVirtualQuantity * 1024 * 1024; 608 608 else 609 609 return setError(VBOX_E_FILE_ERROR, … … 625 625 </Item> */ 626 626 HardDiskController hdc; 627 hdc.system = HardDiskController::IDE; 627 628 hdc.idController = i.ulInstanceID; 628 hdc.controllerSystem = IDE;629 629 hdc.strAddress = i.strAddress; 630 630 hdc.ulBusNumber = i.ulBusNumber; 631 631 632 d.mapControllers[i.ulInstanceID] = hdc;632 vsys.mapControllers[i.ulInstanceID] = hdc; 633 633 } 634 break; 634 635 635 636 case OVFResourceType_ParallelScsiHba: // 6 SCSI controller … … 644 645 </Item> */ 645 646 HardDiskController hdc; 647 hdc.system = HardDiskController::SCSI; 646 648 hdc.idController = i.ulInstanceID; 647 hdc.controllerSystem = SCSI;648 649 hdc.strControllerType = i.strResourceSubType; 649 650 650 d.mapControllers[i.ulInstanceID] = hdc;651 vsys.mapControllers[i.ulInstanceID] = hdc; 651 652 } 652 653 break; … … 680 681 i.ulLineNumber); 681 682 682 d.llNetworkNames.push_back(i.strConnection);683 vsys.llNetworkNames.push_back(i.strConnection); 683 684 } 684 685 break; 685 686 686 687 case OVFResourceType_FloppyDrive: // 14 687 d.fHasFloppyDrive = true; // we have no additional information688 vsys.fHasFloppyDrive = true; // we have no additional information 688 689 break; 689 690 … … 700 701 // but then the ovftool dies with "Device backing not supported". So I guess if 701 702 // VMware can't export ISOs, then we don't need to be able to import them right now. 702 d.fHasCdromDrive = true; // we have no additional information703 vsys.fHasCdromDrive = true; // we have no additional information 703 704 break; 704 705 … … 717 718 // look up the hard disk controller element whose InstanceID equals our Parent; 718 719 // this is how the connection is specified in OVF 719 ControllersMap::const_iterator it = d.mapControllers.find(i.ulParent);720 if (it == d.mapControllers.end())720 ControllersMap::const_iterator it = vsys.mapControllers.find(i.ulParent); 721 if (it == vsys.mapControllers.end()) 721 722 return setError(VBOX_E_FILE_ERROR, 722 723 tr("Error reading \"%s\": Hard disk item with instance ID %d specifies invalid parent %d, line %d"), … … 747 748 i.ulLineNumber); 748 749 749 d.mapVirtualDisks[vd.strDiskId] = vd;750 vsys.mapVirtualDisks[vd.strDiskId] = vd; 750 751 } 751 752 break; … … 760 761 <rasd:BusNumber>0</rasd:BusNumber> 761 762 </Item> */ 762 d.fHasUsbController = true; // we have no additional information763 vsys.fHasUsbController = true; // we have no additional information 763 764 break; 764 765 … … 773 774 <rasd:AddressOnParent>3</rasd:AddressOnParent> 774 775 </Item> */ 775 d.strSoundCardType = i.strResourceSubType;776 vsys.strSoundCardType = i.strResourceSubType; 776 777 break; 777 778 … … 796 797 pelmThis->getLineNumber()); 797 798 798 d.cimos = (CIMOSType_T)cimos64;799 vsys.cimos = (CIMOSType_T)cimos64; 799 800 } 800 801 } 801 802 802 803 // now create the virtual system 803 m->llVirtualSystems.push_back( d);804 m->llVirtualSystems.push_back(vsys); 804 805 805 806 return S_OK; … … 972 973 } 973 974 975 void convertCIMOSType2VBoxOSType(Utf8Str &osTypeVBox, CIMOSType_T c) 976 { 977 switch (c) 978 { 979 case CIMOSType_CIMOS_Unknown: // 0 - Unknown 980 osTypeVBox = SchemaDefs_OSTypeId_Other; 981 break; 982 983 case CIMOSType_CIMOS_OS2: // 12 - OS/2 984 osTypeVBox = SchemaDefs_OSTypeId_OS2; 985 break; 986 987 case CIMOSType_CIMOS_MSDOS: // 14 - MSDOS 988 osTypeVBox = SchemaDefs_OSTypeId_DOS; 989 break; 990 991 case CIMOSType_CIMOS_WIN3x: // 15 - WIN3x 992 osTypeVBox = SchemaDefs_OSTypeId_Windows31; 993 break; 994 995 case CIMOSType_CIMOS_WIN95: // 16 - WIN95 996 osTypeVBox = SchemaDefs_OSTypeId_Windows95; 997 break; 998 999 case CIMOSType_CIMOS_WIN98: // 17 - WIN98 1000 osTypeVBox = SchemaDefs_OSTypeId_Windows98; 1001 break; 1002 1003 case CIMOSType_CIMOS_WINNT: // 18 - WINNT 1004 osTypeVBox = SchemaDefs_OSTypeId_WindowsNT4; 1005 break; 1006 1007 case CIMOSType_CIMOS_NetWare: // 21 - NetWare 1008 case CIMOSType_CIMOS_NovellOES: // 86 - Novell OES 1009 osTypeVBox = SchemaDefs_OSTypeId_Netware; 1010 break; 1011 1012 case CIMOSType_CIMOS_Solaris: // 29 - Solaris 1013 case CIMOSType_CIMOS_SunOS: // 30 - SunOS 1014 osTypeVBox = SchemaDefs_OSTypeId_Solaris; 1015 break; 1016 1017 case CIMOSType_CIMOS_FreeBSD: // 42 - FreeBSD 1018 osTypeVBox = SchemaDefs_OSTypeId_FreeBSD; 1019 break; 1020 1021 case CIMOSType_CIMOS_NetBSD: // 43 - NetBSD 1022 osTypeVBox = SchemaDefs_OSTypeId_NetBSD; 1023 break; 1024 1025 case CIMOSType_CIMOS_QNX: // 48 - QNX 1026 osTypeVBox = SchemaDefs_OSTypeId_QNX; 1027 break; 1028 1029 case CIMOSType_CIMOS_Windows2000: // 58 - Windows 2000 1030 osTypeVBox = SchemaDefs_OSTypeId_Windows2000; 1031 break; 1032 1033 case CIMOSType_CIMOS_WindowsMe: // 63 - Windows (R) Me 1034 osTypeVBox = SchemaDefs_OSTypeId_WindowsMe; 1035 break; 1036 1037 case CIMOSType_CIMOS_OpenBSD: // 65 - OpenBSD 1038 osTypeVBox = SchemaDefs_OSTypeId_OpenBSD; 1039 break; 1040 1041 case CIMOSType_CIMOS_WindowsXP: // 67 - Windows XP 1042 case CIMOSType_CIMOS_WindowsXPEmbedded: // 72 - Windows XP Embedded 1043 case CIMOSType_CIMOS_WindowsEmbeddedforPointofService: // 75 - Windows Embedded for Point of Service 1044 osTypeVBox = SchemaDefs_OSTypeId_WindowsXP; 1045 break; 1046 1047 case CIMOSType_CIMOS_MicrosoftWindowsServer2003: // 69 - Microsoft Windows Server 2003 1048 osTypeVBox = SchemaDefs_OSTypeId_Windows2003; 1049 break; 1050 1051 case CIMOSType_CIMOS_MicrosoftWindowsServer2003_64: // 70 - Microsoft Windows Server 2003 64-Bit 1052 osTypeVBox = SchemaDefs_OSTypeId_Windows2003_64; 1053 break; 1054 1055 case CIMOSType_CIMOS_WindowsXP_64: // 71 - Windows XP 64-Bit 1056 osTypeVBox = SchemaDefs_OSTypeId_WindowsXP_64; 1057 break; 1058 1059 case CIMOSType_CIMOS_WindowsVista: // 73 - Windows Vista 1060 osTypeVBox = SchemaDefs_OSTypeId_WindowsVista; 1061 break; 1062 1063 case CIMOSType_CIMOS_WindowsVista_64: // 74 - Windows Vista 64-Bit 1064 osTypeVBox = SchemaDefs_OSTypeId_WindowsVista_64; 1065 break; 1066 1067 case CIMOSType_CIMOS_MicrosoftWindowsServer2008: // 76 - Microsoft Windows Server 2008 1068 osTypeVBox = SchemaDefs_OSTypeId_Windows2008; 1069 break; 1070 1071 case CIMOSType_CIMOS_MicrosoftWindowsServer2008_64: // 77 - Microsoft Windows Server 2008 64-Bit 1072 osTypeVBox = SchemaDefs_OSTypeId_Windows2008_64; 1073 break; 1074 1075 case CIMOSType_CIMOS_FreeBSD_64: // 78 - FreeBSD 64-Bit 1076 osTypeVBox = SchemaDefs_OSTypeId_FreeBSD_64; 1077 break; 1078 1079 case CIMOSType_CIMOS_RedHatEnterpriseLinux: // 79 - RedHat Enterprise Linux 1080 osTypeVBox = SchemaDefs_OSTypeId_RedHat; 1081 break; 1082 1083 case CIMOSType_CIMOS_RedHatEnterpriseLinux_64: // 80 - RedHat Enterprise Linux 64-Bit 1084 osTypeVBox = SchemaDefs_OSTypeId_RedHat_64; 1085 break; 1086 1087 case CIMOSType_CIMOS_Solaris_64: // 81 - Solaris 64-Bit 1088 osTypeVBox = SchemaDefs_OSTypeId_Solaris_64; 1089 break; 1090 1091 case CIMOSType_CIMOS_SUSE: // 82 - SUSE 1092 case CIMOSType_CIMOS_SLES: // 84 - SLES 1093 case CIMOSType_CIMOS_NovellLinuxDesktop: // 87 - Novell Linux Desktop 1094 osTypeVBox = SchemaDefs_OSTypeId_OpenSUSE; 1095 break; 1096 1097 case CIMOSType_CIMOS_SUSE_64: // 83 - SUSE 64-Bit 1098 case CIMOSType_CIMOS_SLES_64: // 85 - SLES 64-Bit 1099 osTypeVBox = SchemaDefs_OSTypeId_OpenSUSE_64; 1100 break; 1101 1102 case CIMOSType_CIMOS_LINUX: // 36 - LINUX 1103 case CIMOSType_CIMOS_SunJavaDesktopSystem: // 88 - Sun Java Desktop System 1104 case CIMOSType_CIMOS_TurboLinux: // 91 - TurboLinux 1105 osTypeVBox = SchemaDefs_OSTypeId_Linux; 1106 break; 1107 1108 // case CIMOSType_CIMOS_TurboLinux_64: // 92 - TurboLinux 64-Bit 1109 // case CIMOSType_CIMOS_Linux_64: // 101 - Linux 64-Bit 1110 // osTypeVBox = VBOXOSTYPE_Linux_x64; 1111 // break; 1112 1113 case CIMOSType_CIMOS_Mandriva: // 89 - Mandriva 1114 osTypeVBox = SchemaDefs_OSTypeId_Mandriva; 1115 break; 1116 1117 case CIMOSType_CIMOS_Mandriva_64: // 90 - Mandriva 64-Bit 1118 osTypeVBox = SchemaDefs_OSTypeId_Mandriva_64; 1119 break; 1120 1121 case CIMOSType_CIMOS_Ubuntu: // 93 - Ubuntu 1122 osTypeVBox = SchemaDefs_OSTypeId_Ubuntu; 1123 break; 1124 1125 case CIMOSType_CIMOS_Ubuntu_64: // 94 - Ubuntu 64-Bit 1126 osTypeVBox = SchemaDefs_OSTypeId_Ubuntu_64; 1127 break; 1128 1129 case CIMOSType_CIMOS_Debian: // 95 - Debian 1130 osTypeVBox = SchemaDefs_OSTypeId_Debian; 1131 break; 1132 1133 case CIMOSType_CIMOS_Debian_64: // 96 - Debian 64-Bit 1134 osTypeVBox = SchemaDefs_OSTypeId_Debian_64; 1135 break; 1136 1137 case CIMOSType_CIMOS_Linux_2_4_x: // 97 - Linux 2.4.x 1138 osTypeVBox = SchemaDefs_OSTypeId_Linux24; 1139 break; 1140 1141 case CIMOSType_CIMOS_Linux_2_4_x_64: // 98 - Linux 2.4.x 64-Bit 1142 osTypeVBox = SchemaDefs_OSTypeId_Linux24_64; 1143 break; 1144 1145 case CIMOSType_CIMOS_Linux_2_6_x: // 99 - Linux 2.6.x 1146 osTypeVBox = SchemaDefs_OSTypeId_Linux26; 1147 break; 1148 1149 case CIMOSType_CIMOS_Linux_2_6_x_64: // 100 - Linux 2.6.x 64-Bit 1150 osTypeVBox = SchemaDefs_OSTypeId_Linux26_64; 1151 break; 1152 default: 1153 { 1154 /* If we are here we have no clue what OS this should be. Set to 1155 * other type as default. */ 1156 osTypeVBox = SchemaDefs_OSTypeId_Other; 1157 } 1158 } 1159 } 1160 974 1161 STDMETHODIMP Appliance::Interpret() 975 1162 { … … 992 1179 rc = mVirtualBox->COMGETTER(SystemProperties)(systemProps.asOutParam()); 993 1180 ComAssertComRCThrowRC(rc); 994 B STR defaultHardDiskLocation;995 rc = systemProps->COMGETTER(DefaultHardDiskFolder)( &defaultHardDiskLocation);1181 Bstr bstrDefaultHardDiskLocation; 1182 rc = systemProps->COMGETTER(DefaultHardDiskFolder)(bstrDefaultHardDiskLocation.asOutParam()); 996 1183 ComAssertComRCThrowRC(rc); 997 1184 … … 1002 1189 ++it) 1003 1190 { 1004 const VirtualSystem &vs = *it; 1005 ComObjPtr <VirtualSystemDescription> vsd; 1006 vsd.createObject(); 1007 rc = vsd->init(); 1191 const VirtualSystem &vsysThis = *it; 1192 1193 ComObjPtr<VirtualSystemDescription> pNewDesc; 1194 pNewDesc.createObject(); 1195 rc = pNewDesc->init(); 1008 1196 ComAssertComRCThrowRC(rc); 1009 1197 1010 Utf8Str osTypeVBox = SchemaDefs_OSTypeId_Other;1011 1198 /* Guest OS type */ 1012 switch (vs.cimos) 1013 { 1014 case CIMOSType_CIMOS_Unknown: // 0 - Unknown 1015 osTypeVBox = SchemaDefs_OSTypeId_Other; 1016 break; 1017 1018 case CIMOSType_CIMOS_OS2: // 12 - OS/2 1019 osTypeVBox = SchemaDefs_OSTypeId_OS2; 1020 break; 1021 1022 case CIMOSType_CIMOS_MSDOS: // 14 - MSDOS 1023 osTypeVBox = SchemaDefs_OSTypeId_DOS; 1024 break; 1025 1026 case CIMOSType_CIMOS_WIN3x: // 15 - WIN3x 1027 osTypeVBox = SchemaDefs_OSTypeId_Windows31; 1028 break; 1029 1030 case CIMOSType_CIMOS_WIN95: // 16 - WIN95 1031 osTypeVBox = SchemaDefs_OSTypeId_Windows95; 1032 break; 1033 1034 case CIMOSType_CIMOS_WIN98: // 17 - WIN98 1035 osTypeVBox = SchemaDefs_OSTypeId_Windows98; 1036 break; 1037 1038 case CIMOSType_CIMOS_WINNT: // 18 - WINNT 1039 osTypeVBox = SchemaDefs_OSTypeId_WindowsNT4; 1040 break; 1041 1042 case CIMOSType_CIMOS_NetWare: // 21 - NetWare 1043 case CIMOSType_CIMOS_NovellOES: // 86 - Novell OES 1044 osTypeVBox = SchemaDefs_OSTypeId_Netware; 1045 break; 1046 1047 case CIMOSType_CIMOS_Solaris: // 29 - Solaris 1048 case CIMOSType_CIMOS_SunOS: // 30 - SunOS 1049 osTypeVBox = SchemaDefs_OSTypeId_Solaris; 1050 break; 1051 1052 case CIMOSType_CIMOS_FreeBSD: // 42 - FreeBSD 1053 osTypeVBox = SchemaDefs_OSTypeId_FreeBSD; 1054 break; 1055 1056 case CIMOSType_CIMOS_NetBSD: // 43 - NetBSD 1057 osTypeVBox = SchemaDefs_OSTypeId_NetBSD; 1058 break; 1059 1060 case CIMOSType_CIMOS_QNX: // 48 - QNX 1061 osTypeVBox = SchemaDefs_OSTypeId_QNX; 1062 break; 1063 1064 case CIMOSType_CIMOS_Windows2000: // 58 - Windows 2000 1065 osTypeVBox = SchemaDefs_OSTypeId_Windows2000; 1066 break; 1067 1068 case CIMOSType_CIMOS_WindowsMe: // 63 - Windows (R) Me 1069 osTypeVBox = SchemaDefs_OSTypeId_WindowsMe; 1070 break; 1071 1072 case CIMOSType_CIMOS_OpenBSD: // 65 - OpenBSD 1073 osTypeVBox = SchemaDefs_OSTypeId_OpenBSD; 1074 break; 1075 1076 case CIMOSType_CIMOS_WindowsXP: // 67 - Windows XP 1077 case CIMOSType_CIMOS_WindowsXPEmbedded: // 72 - Windows XP Embedded 1078 case CIMOSType_CIMOS_WindowsEmbeddedforPointofService: // 75 - Windows Embedded for Point of Service 1079 osTypeVBox = SchemaDefs_OSTypeId_WindowsXP; 1080 break; 1081 1082 case CIMOSType_CIMOS_MicrosoftWindowsServer2003: // 69 - Microsoft Windows Server 2003 1083 osTypeVBox = SchemaDefs_OSTypeId_Windows2003; 1084 break; 1085 1086 case CIMOSType_CIMOS_MicrosoftWindowsServer2003_64: // 70 - Microsoft Windows Server 2003 64-Bit 1087 osTypeVBox = SchemaDefs_OSTypeId_Windows2003_64; 1088 break; 1089 1090 case CIMOSType_CIMOS_WindowsXP_64: // 71 - Windows XP 64-Bit 1091 osTypeVBox = SchemaDefs_OSTypeId_WindowsXP_64; 1092 break; 1093 1094 case CIMOSType_CIMOS_WindowsVista: // 73 - Windows Vista 1095 osTypeVBox = SchemaDefs_OSTypeId_WindowsVista; 1096 break; 1097 1098 case CIMOSType_CIMOS_WindowsVista_64: // 74 - Windows Vista 64-Bit 1099 osTypeVBox = SchemaDefs_OSTypeId_WindowsVista_64; 1100 break; 1101 1102 case CIMOSType_CIMOS_MicrosoftWindowsServer2008: // 76 - Microsoft Windows Server 2008 1103 osTypeVBox = SchemaDefs_OSTypeId_Windows2008; 1104 break; 1105 1106 case CIMOSType_CIMOS_MicrosoftWindowsServer2008_64: // 77 - Microsoft Windows Server 2008 64-Bit 1107 osTypeVBox = SchemaDefs_OSTypeId_Windows2008_64; 1108 break; 1109 1110 case CIMOSType_CIMOS_FreeBSD_64: // 78 - FreeBSD 64-Bit 1111 osTypeVBox = SchemaDefs_OSTypeId_FreeBSD_64; 1112 break; 1113 1114 case CIMOSType_CIMOS_RedHatEnterpriseLinux: // 79 - RedHat Enterprise Linux 1115 osTypeVBox = SchemaDefs_OSTypeId_RedHat; 1116 break; 1117 1118 case CIMOSType_CIMOS_RedHatEnterpriseLinux_64: // 80 - RedHat Enterprise Linux 64-Bit 1119 osTypeVBox = SchemaDefs_OSTypeId_RedHat_64; 1120 break; 1121 1122 case CIMOSType_CIMOS_Solaris_64: // 81 - Solaris 64-Bit 1123 osTypeVBox = SchemaDefs_OSTypeId_Solaris_64; 1124 break; 1125 1126 case CIMOSType_CIMOS_SUSE: // 82 - SUSE 1127 case CIMOSType_CIMOS_SLES: // 84 - SLES 1128 case CIMOSType_CIMOS_NovellLinuxDesktop: // 87 - Novell Linux Desktop 1129 osTypeVBox = SchemaDefs_OSTypeId_OpenSUSE; 1130 break; 1131 1132 case CIMOSType_CIMOS_SUSE_64: // 83 - SUSE 64-Bit 1133 case CIMOSType_CIMOS_SLES_64: // 85 - SLES 64-Bit 1134 osTypeVBox = SchemaDefs_OSTypeId_OpenSUSE_64; 1135 break; 1136 1137 case CIMOSType_CIMOS_LINUX: // 36 - LINUX 1138 case CIMOSType_CIMOS_SunJavaDesktopSystem: // 88 - Sun Java Desktop System 1139 case CIMOSType_CIMOS_TurboLinux: // 91 - TurboLinux 1140 osTypeVBox = SchemaDefs_OSTypeId_Linux; 1141 break; 1142 1143 // case CIMOSType_CIMOS_TurboLinux_64: // 92 - TurboLinux 64-Bit 1144 // case CIMOSType_CIMOS_Linux_64: // 101 - Linux 64-Bit 1145 // osTypeVBox = VBOXOSTYPE_Linux_x64; 1146 // break; 1147 1148 case CIMOSType_CIMOS_Mandriva: // 89 - Mandriva 1149 osTypeVBox = SchemaDefs_OSTypeId_Mandriva; 1150 break; 1151 1152 case CIMOSType_CIMOS_Mandriva_64: // 90 - Mandriva 64-Bit 1153 osTypeVBox = SchemaDefs_OSTypeId_Mandriva_64; 1154 break; 1155 1156 case CIMOSType_CIMOS_Ubuntu: // 93 - Ubuntu 1157 osTypeVBox = SchemaDefs_OSTypeId_Ubuntu; 1158 break; 1159 1160 case CIMOSType_CIMOS_Ubuntu_64: // 94 - Ubuntu 64-Bit 1161 osTypeVBox = SchemaDefs_OSTypeId_Ubuntu_64; 1162 break; 1163 1164 case CIMOSType_CIMOS_Debian: // 95 - Debian 1165 osTypeVBox = SchemaDefs_OSTypeId_Debian; 1166 break; 1167 1168 case CIMOSType_CIMOS_Debian_64: // 96 - Debian 64-Bit 1169 osTypeVBox = SchemaDefs_OSTypeId_Debian_64; 1170 break; 1171 1172 case CIMOSType_CIMOS_Linux_2_4_x: // 97 - Linux 2.4.x 1173 osTypeVBox = SchemaDefs_OSTypeId_Linux24; 1174 break; 1175 1176 case CIMOSType_CIMOS_Linux_2_4_x_64: // 98 - Linux 2.4.x 64-Bit 1177 osTypeVBox = SchemaDefs_OSTypeId_Linux24_64; 1178 break; 1179 1180 case CIMOSType_CIMOS_Linux_2_6_x: // 99 - Linux 2.6.x 1181 osTypeVBox = SchemaDefs_OSTypeId_Linux26; 1182 break; 1183 1184 case CIMOSType_CIMOS_Linux_2_6_x_64: // 100 - Linux 2.6.x 64-Bit 1185 osTypeVBox = SchemaDefs_OSTypeId_Linux26_64; 1186 break; 1187 default: 1188 { 1189 /* If we are here we have no clue what OS this should be. Set to 1190 * other type as default. */ 1191 osTypeVBox = SchemaDefs_OSTypeId_Other; 1192 } 1193 } 1194 vsd->addEntry(VirtualSystemDescriptionType_OS, "", toString<ULONG>(vs.cimos), osTypeVBox); 1199 Utf8Str strOsTypeVBox, 1200 strCIMOSType = toString<ULONG>(vsysThis.cimos); 1201 convertCIMOSType2VBoxOSType(strOsTypeVBox, vsysThis.cimos); 1202 pNewDesc->addEntry(VirtualSystemDescriptionType_OS, 1203 0, 1204 strCIMOSType, 1205 strOsTypeVBox); 1195 1206 1196 1207 /* VM name */ 1197 1208 /* If the there isn't any name specified create a default one out of 1198 1209 * the OS type */ 1199 Utf8Str nameVBox = vs .strName;1210 Utf8Str nameVBox = vsysThis.strName; 1200 1211 if (nameVBox == "") 1201 nameVBox = osTypeVBox;1212 nameVBox = strOsTypeVBox; 1202 1213 searchUniqueVMName(nameVBox); 1203 vsd->addEntry(VirtualSystemDescriptionType_Name, "", vs.strName, nameVBox); 1204 1205 /* Now that we know the base system get our internal defaults based on that. */ 1206 ComPtr<IGuestOSType> osType; 1207 rc = mVirtualBox->GetGuestOSType(Bstr(osTypeVBox), osType.asOutParam()); 1214 pNewDesc->addEntry(VirtualSystemDescriptionType_Name, 1215 0, 1216 vsysThis.strName, 1217 nameVBox); 1218 1219 /* Now that we know the OS type, get our internal defaults based on that. */ 1220 ComPtr<IGuestOSType> pGuestOSType; 1221 rc = mVirtualBox->GetGuestOSType(Bstr(strOsTypeVBox), pGuestOSType.asOutParam()); 1208 1222 ComAssertComRCThrowRC(rc); 1209 1223 1210 1224 /* CPU count */ 1211 1225 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxCPUCount) */ 1212 ULONG cpuCountVBox = vs .cCPUs;1213 if (vs .cCPUs == 0)1226 ULONG cpuCountVBox = vsysThis.cCPUs; 1227 if (vsysThis.cCPUs == 0) 1214 1228 cpuCountVBox = 1; 1215 vsd->addEntry(VirtualSystemDescriptionType_CPU, "", toString<ULONG>(vs.cCPUs), toString<ULONG>(cpuCountVBox)); 1229 pNewDesc->addEntry(VirtualSystemDescriptionType_CPU, 1230 0, 1231 toString<ULONG>(vsysThis.cCPUs), 1232 toString<ULONG>(cpuCountVBox)); 1216 1233 1217 1234 /* RAM */ 1218 1235 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */ 1219 uint64_t ullMemSizeVBox = vs .ullMemorySize;1220 if (vs .ullMemorySize == 0)1236 uint64_t ullMemSizeVBox = vsysThis.ullMemorySize; 1237 if (vsysThis.ullMemorySize == 0) 1221 1238 { 1222 1239 /* If the RAM of the OVF is zero, use our predefined values */ 1223 1240 ULONG memSizeVBox2; 1224 rc = osType->COMGETTER(RecommendedRAM)(&memSizeVBox2);1241 rc = pGuestOSType->COMGETTER(RecommendedRAM)(&memSizeVBox2); 1225 1242 ComAssertComRCThrowRC(rc); 1226 1243 /* VBox stores that in MByte */ 1227 1244 ullMemSizeVBox = (uint64_t)memSizeVBox2 * _1M; 1228 1245 } 1229 vsd->addEntry(VirtualSystemDescriptionType_Memory, "", toString<uint64_t>(vs.ullMemorySize), toString<uint64_t>(ullMemSizeVBox)); 1246 pNewDesc->addEntry(VirtualSystemDescriptionType_Memory, 1247 0, 1248 toString<uint64_t>(vsysThis.ullMemorySize), 1249 toString<uint64_t>(ullMemSizeVBox)); 1230 1250 1231 1251 /* Audio */ 1232 if (!vs .strSoundCardType.isNull())1252 if (!vsysThis.strSoundCardType.isNull()) 1233 1253 /* Currently we set the AC97 always. 1234 1254 @todo: figure out the hardware which could be possible */ 1235 vsd->addEntry(VirtualSystemDescriptionType_SoundCard, "", vs.strSoundCardType, toString<uint32_t>(AudioControllerType_AC97)); 1255 pNewDesc->addEntry(VirtualSystemDescriptionType_SoundCard, 1256 0, 1257 vsysThis.strSoundCardType, 1258 ""); 1236 1259 1237 1260 /* USB Controller */ 1238 if (vs .fHasUsbController)1239 vsd->addEntry(VirtualSystemDescriptionType_USBController, "", "", "1");1261 if (vsysThis.fHasUsbController) 1262 pNewDesc->addEntry(VirtualSystemDescriptionType_USBController, 0, "", ""); 1240 1263 1241 1264 /* Network Controller */ 1242 // @todo: is there no hardware specified in the OVF-Format? 1243 if (vs.llNetworkNames.size() > 0) 1265 // @todo: there is no hardware specification in the OVF file; supposedly the 1266 // hardware will then be determined by the VirtualSystemType element (e.g. "vmx-07") 1267 if (vsysThis.llNetworkNames.size() > 0) 1244 1268 { 1245 1269 /* Get the default network adapter type for the selected guest OS */ 1246 1270 NetworkAdapterType_T nwAdapterVBox = NetworkAdapterType_Am79C970A; 1247 rc = osType->COMGETTER(AdapterType)(&nwAdapterVBox);1271 rc = pGuestOSType->COMGETTER(AdapterType)(&nwAdapterVBox); 1248 1272 ComAssertComRCThrowRC(rc); 1249 1273 list<Utf8Str>::const_iterator nwIt; … … 1251 1275 * adapters at the maximum. (@todo: warn if it are more!) */ 1252 1276 size_t a = 0; 1253 for (nwIt = vs .llNetworkNames.begin();1254 nwIt != vs .llNetworkNames.end() && a < SchemaDefs::NetworkAdapterCount;1277 for (nwIt = vsysThis.llNetworkNames.begin(); 1278 nwIt != vsysThis.llNetworkNames.end() && a < SchemaDefs::NetworkAdapterCount; 1255 1279 ++nwIt, ++a) 1256 1280 { 1257 //Utf8Str nwController = *nwIt; // @todo: not used yet1258 vsd->addEntry(VirtualSystemDescriptionType_NetworkAdapter, "", "", toString<ULONG>(nwAdapterVBox));1281 Utf8Str nwController = *nwIt; // @todo: not used yet 1282 pNewDesc->addEntry(VirtualSystemDescriptionType_NetworkAdapter, 0, "", toString<ULONG>(nwAdapterVBox)); 1259 1283 } 1260 1284 } 1261 1285 1262 1286 /* Floppy Drive */ 1263 if (vs .fHasFloppyDrive)1264 vsd->addEntry(VirtualSystemDescriptionType_Floppy, "", "", "1");1287 if (vsysThis.fHasFloppyDrive) 1288 pNewDesc->addEntry(VirtualSystemDescriptionType_Floppy, 0, "", ""); 1265 1289 1266 1290 /* CD Drive */ 1267 /* @todo: I can't disable the CDROM. So nothing to do for now. */ 1268 //if (vs.fHasCdromDrive) 1269 // vsd->addEntry(VirtualSystemDescriptionType_CDROM, "", "", "1"); 1291 if (vsysThis.fHasCdromDrive) 1292 pNewDesc->addEntry(VirtualSystemDescriptionType_CDROM, 0, "", ""); 1270 1293 1271 1294 /* Hard disk Controller */ 1272 1295 ControllersMap::const_iterator hdcIt; 1273 1296 /* Iterate through all hard disk controllers */ 1274 for (hdcIt = vs .mapControllers.begin();1275 hdcIt != vs .mapControllers.end();1297 for (hdcIt = vsysThis.mapControllers.begin(); 1298 hdcIt != vsysThis.mapControllers.end(); 1276 1299 ++hdcIt) 1277 1300 { 1278 HardDiskControllerhdc = hdcIt->second;1279 switch (hdc. controllerSystem)1301 const HardDiskController &hdc = hdcIt->second; 1302 switch (hdc.system) 1280 1303 { 1281 case IDE: 1282 { 1283 // @todo: figure out the IDE types 1284 /* Use PIIX4 as default */ 1285 IDEControllerType_T hdcController = IDEControllerType_PIIX4; 1286 if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX3")) 1287 hdcController = IDEControllerType_PIIX3; 1288 else if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX4")) 1289 hdcController = IDEControllerType_PIIX4; 1290 vsd->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, toString<uint32_t>(hdc.idController), hdc.strControllerType, toString<ULONG>(hdcController)); 1291 break; 1292 } 1293 #ifdef VBOX_WITH_AHCI 1294 case SATA: 1295 { 1296 // @todo: figure out the SATA types 1297 /* We only support a plain AHCI controller, so use them always */ 1298 vsd->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, toString<uint32_t>(hdc.idController), hdc.strControllerType, "AHCI"); 1299 break; 1300 } 1301 #endif /* VBOX_WITH_AHCI */ 1302 #ifdef VBOX_WITH_SCSI 1303 case SCSI: 1304 { 1305 // @todo: figure out the SCSI types 1306 # ifdef VBOX_WITH_LSILOGIC 1307 Utf8Str hdcController = "LsiLogic"; 1308 # elif VBOX_WITH_BUSLOGIC 1309 Utf8Str hdcController = "BusLogic"; 1310 # else /* !VBOX_WITH_BUSLOGIC */ 1311 Utf8Str hdcController; 1312 # endif 1313 # ifdef VBOX_WITH_LSILOGIC 1314 if (!RTStrICmp(hdc.strControllerType.c_str(), "LsiLogic")) 1315 hdcController = "LsiLogic"; 1316 # endif /* VBOX_WITH_LSILOGIC */ 1317 # ifdef VBOX_WITH_BUSLOGIC 1318 if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic")) 1319 hdcController = "BusLogic"; 1320 # endif /* VBOX_WITH_BUSLOGIC */ 1321 vsd->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI, toString<uint32_t>(hdc.idController), hdc.strControllerType, hdcController); 1322 break; 1323 } 1324 #endif /* VBOX_WITH_SCSI */ 1325 default: 1326 { 1327 /* @todo: hmm, ok, this needs some explanation to the user, 1328 * so set an error! The other possibility is to set IDE 1329 * PIIX4 as default & redirect all hard disks to this 1330 * controller. */ 1304 case HardDiskController::IDE: 1305 { 1306 // @todo: figure out the IDE types 1307 /* Use PIIX4 as default */ 1308 IDEControllerType_T hdcController = IDEControllerType_PIIX4; 1309 if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX3")) 1310 hdcController = IDEControllerType_PIIX3; 1311 else if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX4")) 1312 hdcController = IDEControllerType_PIIX4; 1313 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, 1314 hdc.idController, 1315 hdc.strControllerType, 1316 toString<ULONG>(hdcController)); 1331 1317 break; 1332 } 1318 } 1319 1320 case HardDiskController::SATA: 1321 { 1322 // @todo: figure out the SATA types 1323 /* We only support a plain AHCI controller, so use them always */ 1324 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, 1325 hdc.idController, 1326 hdc.strControllerType, 1327 "AHCI"); 1328 break; 1329 } 1330 1331 case HardDiskController::SCSI: 1332 { 1333 // @todo: figure out the SCSI types 1334 Utf8Str hdcController = "LsiLogic"; 1335 if (!RTStrICmp(hdc.strControllerType.c_str(), "LsiLogic")) 1336 hdcController = "LsiLogic"; 1337 else if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic")) 1338 hdcController = "BusLogic"; 1339 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI, 1340 hdc.idController, 1341 hdc.strControllerType, 1342 hdcController); 1343 break; 1344 } 1333 1345 } 1334 1346 } 1335 1347 1336 1348 /* Hard disks */ 1337 if (vs .mapVirtualDisks.size() > 0)1349 if (vsysThis.mapVirtualDisks.size() > 0) 1338 1350 { 1339 1351 // @todo: … … 1342 1354 VirtualDisksMap::const_iterator hdIt; 1343 1355 /* Iterate through all hard disks ()*/ 1344 for (hdIt = vs .mapVirtualDisks.begin();1345 hdIt != vs .mapVirtualDisks.end();1356 for (hdIt = vsysThis.mapVirtualDisks.begin(); 1357 hdIt != vsysThis.mapVirtualDisks.end(); 1346 1358 ++hdIt) 1347 1359 { 1348 VirtualDiskhd = hdIt->second;1360 const VirtualDisk &hd = hdIt->second; 1349 1361 /* Get the associated disk image */ 1350 DiskImage di = m->mapDisks [hd.strDiskId]; 1351 /* We have to check if we support this format */ 1352 bool fSupported = false; 1362 const DiskImage &di = m->mapDisks[hd.strDiskId]; 1363 1353 1364 // @todo: 1354 1365 // - figure out all possible vmdk formats we also support 1355 1366 // - figure out if there is a url specifier for vhd already 1356 1367 // - we need a url specifier for the vdi format 1357 if (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse")) 1358 fSupported = true; 1359 /* enable compressed formats for the first tests also */ 1360 else if (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed")) 1361 fSupported = true; 1362 if (fSupported) 1368 if ( (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse")) 1369 || (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed")) 1370 ) 1363 1371 { 1364 1372 /* Construct the path */ 1365 Utf8Str path = Utf8StrFmt("%ls%c%s", defaultHardDiskLocation, RTPATH_DELIMITER, di.strHref.c_str());1373 Utf8StrFmt path("%ls%c%s", bstrDefaultHardDiskLocation.raw(), RTPATH_DELIMITER, di.strHref.c_str()); 1366 1374 /* Make the path unique to the VBox installation */ 1367 1375 searchUniqueDiskImageFilePath(path); 1368 vsd->addEntry(VirtualSystemDescriptionType_HardDiskImage, hd.strDiskId, di.strHref, path); 1376 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskImage, 1377 hd.idController, 1378 di.strHref, 1379 path); 1369 1380 } 1370 1381 } 1371 1382 } 1372 1383 1373 m->virtualSystemDescriptions.push_back( vsd);1384 m->virtualSystemDescriptions.push_back(pNewDesc); 1374 1385 } 1375 1386 … … 1390 1401 size_t i = 0; 1391 1402 for (it = m->llVirtualSystems.begin(), 1392 it1 = m->virtualSystemDescriptions.begin();1403 it1 = m->virtualSystemDescriptions.begin(); 1393 1404 it != m->llVirtualSystems.end(); 1394 1405 ++it, ++it1, ++i) 1395 1406 { 1396 const VirtualSystem &vs = *it;1397 ComObjPtr<VirtualSystemDescription> vsd = (*it1);1407 const VirtualSystem &vsysThis = *it; 1408 ComObjPtr<VirtualSystemDescription> vsdescThis = (*it1); 1398 1409 1399 1410 /* Guest OS type */ 1400 std::list<VirtualSystemDescriptionEntry*> vsdeOS = vsd ->findByType(VirtualSystemDescriptionType_OS);1411 std::list<VirtualSystemDescriptionEntry*> vsdeOS = vsdescThis->findByType(VirtualSystemDescriptionType_OS); 1401 1412 Assert(vsdeOS.size() == 1); 1402 const Utf8Str &osTypeVBox = vsdeOS.front()->str FinalValue;1413 const Utf8Str &osTypeVBox = vsdeOS.front()->strConfig; 1403 1414 1404 1415 /* Now that we know the base system get our internal defaults based on that. */ … … 1409 1420 /* Create the machine */ 1410 1421 /* First get the name */ 1411 std::list<VirtualSystemDescriptionEntry*> vsdeName = vsd ->findByType(VirtualSystemDescriptionType_Name);1422 std::list<VirtualSystemDescriptionEntry*> vsdeName = vsdescThis->findByType(VirtualSystemDescriptionType_Name); 1412 1423 Assert(vsdeName.size() == 1); 1413 const Utf8Str &nameVBox = vsdeName.front()->str FinalValue;1424 const Utf8Str &nameVBox = vsdeName.front()->strConfig; 1414 1425 ComPtr<IMachine> newMachine; 1415 rc = mVirtualBox->CreateMachine(Bstr(nameVBox .c_str()), Bstr(osTypeVBox.c_str()),1426 rc = mVirtualBox->CreateMachine(Bstr(nameVBox), Bstr(osTypeVBox), 1416 1427 Bstr(), Guid(), 1417 1428 newMachine.asOutParam()); … … 1424 1435 /* RAM */ 1425 1436 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */ 1426 std::list<VirtualSystemDescriptionEntry*> vsdeRAM = vsd ->findByType(VirtualSystemDescriptionType_Memory);1437 std::list<VirtualSystemDescriptionEntry*> vsdeRAM = vsdescThis->findByType(VirtualSystemDescriptionType_Memory); 1427 1438 Assert(vsdeRAM.size() == 1); 1428 const Utf8Str &memoryVBox = vsdeRAM.front()->str FinalValue;1439 const Utf8Str &memoryVBox = vsdeRAM.front()->strConfig; 1429 1440 uint64_t tt = RTStrToUInt64(memoryVBox.c_str()) / _1M; 1430 1441 … … 1444 1455 1445 1456 /* Audio Adapter */ 1446 std::list<VirtualSystemDescriptionEntry*> vsdeAudioAdapter = vsd ->findByType(VirtualSystemDescriptionType_SoundCard);1457 std::list<VirtualSystemDescriptionEntry*> vsdeAudioAdapter = vsdescThis->findByType(VirtualSystemDescriptionType_SoundCard); 1447 1458 /* @todo: we support one audio adapter only */ 1448 1459 if (vsdeAudioAdapter.size() > 0) 1449 1460 { 1450 const Utf8Str& audioAdapterVBox = vsdeAudioAdapter.front()->str FinalValue;1461 const Utf8Str& audioAdapterVBox = vsdeAudioAdapter.front()->strConfig; 1451 1462 if (RTStrICmp(audioAdapterVBox, "null") != 0) 1452 1463 { … … 1490 1501 1491 1502 /* USB Controller */ 1492 std::list<VirtualSystemDescriptionEntry*> vsdeUSBController = vsd ->findByType(VirtualSystemDescriptionType_USBController);1503 std::list<VirtualSystemDescriptionEntry*> vsdeUSBController = vsdescThis->findByType(VirtualSystemDescriptionType_USBController); 1493 1504 /* If there is no USB controller entry it will be disabled */ 1494 1505 bool fUSBEnabled = vsdeUSBController.size() > 0; … … 1496 1507 { 1497 1508 /* Check if the user has disabled the USB controller in the client */ 1498 const Utf8Str& usbVBox = vsdeUSBController.front()->str FinalValue;1509 const Utf8Str& usbVBox = vsdeUSBController.front()->strConfig; 1499 1510 fUSBEnabled = usbVBox == "1"; 1500 1511 } … … 1506 1517 1507 1518 /* Change the network adapters */ 1508 std::list<VirtualSystemDescriptionEntry*> vsdeNW = vsd ->findByType(VirtualSystemDescriptionType_NetworkAdapter);1519 std::list<VirtualSystemDescriptionEntry*> vsdeNW = vsdescThis->findByType(VirtualSystemDescriptionType_NetworkAdapter); 1509 1520 if (vsdeNW.size() == 0) 1510 1521 { … … 1526 1537 ++nwIt, ++a) 1527 1538 { 1528 const Utf8Str &nwTypeVBox = (*nwIt)->str FinalValue;1539 const Utf8Str &nwTypeVBox = (*nwIt)->strConfig; 1529 1540 uint32_t tt1 = RTStrToUInt32(nwTypeVBox.c_str()); 1530 1541 ComPtr<INetworkAdapter> nwVBox; … … 1541 1552 1542 1553 /* Floppy drive */ 1543 std::list<VirtualSystemDescriptionEntry*> vsdeFloppy = vsd ->findByType(VirtualSystemDescriptionType_Floppy);1554 std::list<VirtualSystemDescriptionEntry*> vsdeFloppy = vsdescThis->findByType(VirtualSystemDescriptionType_Floppy); 1544 1555 /* If there is no floppy drive entry it will be disabled */ 1545 1556 bool fFloppyEnabled = vsdeFloppy.size() > 0; … … 1547 1558 { 1548 1559 /* Check if the user has disabled the floppy drive in the client */ 1549 const Utf8Str& floppyVBox = vsdeFloppy.front()->str FinalValue;1560 const Utf8Str& floppyVBox = vsdeFloppy.front()->strConfig; 1550 1561 fFloppyEnabled = floppyVBox == "1"; 1551 1562 } … … 1561 1572 1562 1573 /* Hard disk controller IDE */ 1563 std::list<VirtualSystemDescriptionEntry*> vsdeHDCIDE = vsd ->findByType(VirtualSystemDescriptionType_HardDiskControllerIDE);1574 std::list<VirtualSystemDescriptionEntry*> vsdeHDCIDE = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerIDE); 1564 1575 /* @todo: we support one IDE controller only */ 1565 1576 if (vsdeHDCIDE.size() > 0) 1566 1577 { 1567 IDEControllerType_T hdcVBox = static_cast<IDEControllerType_T>(RTStrToUInt32(vsdeHDCIDE.front()->str FinalValue.c_str()));1578 IDEControllerType_T hdcVBox = static_cast<IDEControllerType_T>(RTStrToUInt32(vsdeHDCIDE.front()->strConfig.c_str())); 1568 1579 /* Set the appropriate IDE controller in the virtual BIOS of the 1569 1580 * VM. */ … … 1576 1587 #ifdef VBOX_WITH_AHCI 1577 1588 /* Hard disk controller SATA */ 1578 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsd ->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA);1589 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA); 1579 1590 /* @todo: we support one SATA controller only */ 1580 1591 if (vsdeHDCSATA.size() > 0) 1581 1592 { 1582 const Utf8Str &hdcVBox = vsdeHDCIDE.front()->str FinalValue;1593 const Utf8Str &hdcVBox = vsdeHDCIDE.front()->strConfig; 1583 1594 if (hdcVBox == "AHCI") 1584 1595 { … … 1598 1609 #ifdef VBOX_WITH_SCSI 1599 1610 /* Hard disk controller SCSI */ 1600 EntriesList vsdeHDCSCSI = vsd ->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI);1611 EntriesList vsdeHDCSCSI = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI); 1601 1612 /* @todo: do we support more than one SCSI controller? */ 1602 1613 if (vsdeHDCSCSI.size() > 0) … … 1612 1623 1613 1624 /* Create the hard disks & connect them to the appropriate controllers. */ 1614 std::list<VirtualSystemDescriptionEntry*> vsdeHD = vsd->findByType(VirtualSystemDescriptionType_HardDiskImage);1615 if ( vsdeHD.size() > 0)1625 std::list<VirtualSystemDescriptionEntry*> avsdeHDs = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskImage); 1626 if (avsdeHDs.size() > 0) 1616 1627 { 1617 1628 /* That we can attach hard disks we need to open a session for the … … 1629 1640 /* The disk image has to be on the same place as the OVF file. So 1630 1641 * strip the filename out of the full file path. */ 1631 char *srcDir = RTStrDup(Utf8Str(m->bstrPath).raw()); 1632 RTPathStripFilename(srcDir); 1642 char *pszSrcDir = RTStrDup(Utf8Str(m->bstrPath).raw()); 1643 RTPathStripFilename(pszSrcDir); 1644 Utf8Str strSrcDir(pszSrcDir); 1645 RTStrFree(pszSrcDir); 1646 1633 1647 /* Iterate over all given disk images */ 1634 1648 list<VirtualSystemDescriptionEntry*>::const_iterator hdIt; 1635 for (hdIt = vsdeHD.begin();1636 hdIt != vsdeHD.end();1649 for (hdIt = avsdeHDs.begin(); 1650 hdIt != avsdeHDs.end(); 1637 1651 ++hdIt) 1638 1652 { 1639 char *dstFilePath = RTStrDup((*hdIt)->strFinalValue.c_str()); 1653 const VirtualSystemDescriptionEntry &vsdeHD = (**hdIt); 1654 1655 const char *pcszDestFilePath = vsdeHD.strConfig.c_str(); 1640 1656 /* Check if the destination file exists already or the 1641 1657 * destination path is empty. */ 1642 if (RTPathExists( dstFilePath) ||1643 !RTStrCmp( dstFilePath, ""))1658 if (RTPathExists(pcszDestFilePath) || 1659 !RTStrCmp(pcszDestFilePath, "")) 1644 1660 { 1645 1661 /* @todo: what now? For now we override in no … … 1647 1663 continue; 1648 1664 } 1649 const Utf8Str &strRef = (*hdIt)->strRef; 1665 1666 uint32_t ulRef = (*hdIt)->ulRef; 1650 1667 /* Get the associated disk image */ 1651 if (m->mapDisks.find( strRef) == m->mapDisks.end() ||1652 vs .mapVirtualDisks.find(strRef) == vs.mapVirtualDisks.end())1668 if (m->mapDisks.find(ulRef) == m->mapDisks.end() || 1669 vsysThis.mapVirtualDisks.find(ulRef) == vsysThis.mapVirtualDisks.end()) 1653 1670 { 1654 1671 /* @todo: error: entry doesn't exists */ 1655 1672 } 1656 DiskImage di = m->mapDisks[ strRef];1657 VirtualDisk vd = (*vs .mapVirtualDisks.find(strRef)).second;1673 DiskImage di = m->mapDisks[ulRef]; 1674 VirtualDisk vd = (*vsysThis.mapVirtualDisks.find(ulRef)).second; 1658 1675 /* Construct the source file path */ 1659 char *srcFilePath; 1660 RTStrAPrintf(&srcFilePath, "%s/%s", srcDir, di.strHref.c_str()); 1676 Utf8StrFmt strSrcFilePath("%s/%s", strSrcDir.c_str(), di.strHref.c_str()); 1661 1677 /* Check if the source file exists */ 1662 if (!RTPathExists(s rcFilePath))1678 if (!RTPathExists(strSrcFilePath.c_str())) 1663 1679 { 1664 1680 /* @todo: we have to create a new one */ … … 1667 1683 { 1668 1684 /* Make sure all target directories exists */ 1669 rc = VirtualBox::ensureFilePathExists( dstFilePath);1685 rc = VirtualBox::ensureFilePathExists(pcszDestFilePath); 1670 1686 CheckComRCThrowRC(rc); 1671 1687 /* Clone the disk image (this is necessary cause the id has … … 1674 1690 /* First open the existing disk image */ 1675 1691 ComPtr<IHardDisk2> srcHdVBox; 1676 rc = mVirtualBox->OpenHardDisk2(Bstr(s rcFilePath), srcHdVBox.asOutParam());1692 rc = mVirtualBox->OpenHardDisk2(Bstr(strSrcFilePath), srcHdVBox.asOutParam()); 1677 1693 CheckComRCReturnRC(rc); 1678 1694 /* We need the format description of the source disk image */ … … 1682 1698 /* Create a new hard disk interface for the destination disk image */ 1683 1699 ComPtr<IHardDisk2> dstHdVBox; 1684 rc = mVirtualBox->CreateHardDisk2(srcFormat, Bstr( dstFilePath), dstHdVBox.asOutParam());1700 rc = mVirtualBox->CreateHardDisk2(srcFormat, Bstr(pcszDestFilePath), dstHdVBox.asOutParam()); 1685 1701 CheckComRCReturnRC(rc); 1686 1702 /* Clone the source disk image */ … … 1700 1716 CheckComRCReturnRC(rc); 1701 1717 /* For now we assume we have one controller of every type only */ 1702 HardDiskController hdc = (*vs .mapControllers.find(vd.idController)).second;1718 HardDiskController hdc = (*vsysThis.mapControllers.find(vd.idController)).second; 1703 1719 StorageBus_T sbt = StorageBus_IDE; 1704 switch (hdc. controllerSystem)1720 switch (hdc.system) 1705 1721 { 1706 case IDE: sbt = StorageBus_IDE; break;1707 case SATA: sbt = StorageBus_SATA; break;1722 case HardDiskController::IDE: sbt = StorageBus_IDE; break; 1723 case HardDiskController::SATA: sbt = StorageBus_SATA; break; 1708 1724 //case SCSI: sbt = StorageBus_SCSI; break; // @todo: not available yet 1709 1725 default: break; … … 1716 1732 CheckComRCReturnRC(rc); 1717 1733 } 1718 RTStrFree(srcFilePath);1719 RTStrFree(dstFilePath);1720 1734 } 1721 RTStrFree(srcDir);1722 1735 } 1723 1736 /* @todo: Unregister on failure */ … … 1812 1825 1813 1826 STDMETHODIMP VirtualSystemDescription::GetDescription(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes), 1827 ComSafeArrayOut(ULONG, aRefs), 1814 1828 ComSafeArrayOut(BSTR, aOrigValues), 1815 ComSafeArrayOut(BSTR, a AutoValues),1816 ComSafeArrayOut(BSTR, a Configurations))1829 ComSafeArrayOut(BSTR, aConfigValues), 1830 ComSafeArrayOut(BSTR, aExtraConfigValues)) 1817 1831 { 1818 1832 if (ComSafeArrayOutIsNull(aTypes) || 1833 ComSafeArrayOutIsNull(aRefs) || 1819 1834 ComSafeArrayOutIsNull(aOrigValues) || 1820 ComSafeArrayOutIsNull(a AutoValues) ||1821 ComSafeArrayOutIsNull(a Configurations))1835 ComSafeArrayOutIsNull(aConfigValues) || 1836 ComSafeArrayOutIsNull(aExtraConfigValues)) 1822 1837 return E_POINTER; 1823 1838 … … 1829 1844 ULONG c = (ULONG)m->descriptions.size(); 1830 1845 com::SafeArray<VirtualSystemDescriptionType_T> sfaTypes(c); 1846 com::SafeArray<ULONG> sfaRefs(c); 1831 1847 com::SafeArray<BSTR> sfaOrigValues(c); 1832 com::SafeArray<BSTR> sfa AutoValues(c);1833 com::SafeArray<BSTR> sfa Configurations(c);1848 com::SafeArray<BSTR> sfaConfigValues(c); 1849 com::SafeArray<BSTR> sfaExtraConfigValues(c); 1834 1850 1835 1851 list<VirtualSystemDescriptionEntry>::const_iterator it; … … 1840 1856 { 1841 1857 const VirtualSystemDescriptionEntry &vsde = (*it); 1842 /* Types */ 1843 sfaTypes [i] = vsde.type; 1844 /* Original value */ 1845 Bstr bstr = vsde.strOriginalValue; 1858 1859 sfaTypes[i] = vsde.type; 1860 1861 sfaRefs[i] = vsde.ulRef; 1862 1863 Bstr bstr = vsde.strOrig; 1846 1864 bstr.cloneTo(&sfaOrigValues[i]); 1847 /* Auto value */ 1848 bstr = vsde.str AutoValue;1849 bstr.cloneTo(&sfa AutoValues[i]);1850 /* Configuration */ 1851 bstr = vsde.str Configuration;1852 bstr.cloneTo(&sfa Configurations[i]);1865 1866 bstr = vsde.strConfig; 1867 bstr.cloneTo(&sfaConfigValues[i]); 1868 1869 bstr = vsde.strExtraConfig; 1870 bstr.cloneTo(&sfaExtraConfigValues[i]); 1853 1871 } 1854 1872 1855 1873 sfaTypes.detachTo(ComSafeArrayOutArg(aTypes)); 1874 sfaRefs.detachTo(ComSafeArrayOutArg(aRefs)); 1856 1875 sfaOrigValues.detachTo(ComSafeArrayOutArg(aOrigValues)); 1857 sfa AutoValues.detachTo(ComSafeArrayOutArg(aAutoValues));1858 sfa Configurations.detachTo(ComSafeArrayOutArg(aConfigurations));1876 sfaConfigValues.detachTo(ComSafeArrayOutArg(aConfigValues)); 1877 sfaExtraConfigValues.detachTo(ComSafeArrayOutArg(aExtraConfigValues)); 1859 1878 1860 1879 return S_OK; … … 1881 1900 { 1882 1901 VirtualSystemDescriptionEntry vsde = (*it); 1883 vsde.str FinalValue= values[i];1902 vsde.strConfig = values[i]; 1884 1903 } 1885 1904 … … 1888 1907 1889 1908 void VirtualSystemDescription::addEntry(VirtualSystemDescriptionType_T aType, 1890 const Utf8Str &aRef,1909 uint32_t ulRef, 1891 1910 const Utf8Str &aOrigValue, 1892 const Utf8Str &aAutoValue, 1893 const Utf8Str &aConfig /* = "" */) 1911 const Utf8Str &aAutoValue) 1894 1912 { 1895 1913 VirtualSystemDescriptionEntry vsde; 1896 1914 vsde.type = aType; 1897 vsde.strRef = aRef; 1898 vsde.strOriginalValue = aOrigValue; 1899 vsde.strAutoValue = aAutoValue; 1900 vsde.strConfiguration = aConfig; 1901 /* For now we add the auto value as final value also */ 1902 vsde.strFinalValue = aAutoValue; 1915 vsde.ulRef = ulRef; 1916 vsde.strOrig = aOrigValue; 1917 vsde.strConfig = aAutoValue; 1903 1918 1904 1919 m->descriptions.push_back(vsde); -
trunk/src/VBox/Main/glue/string.cpp
r16384 r16495 79 79 } 80 80 81 int Utf8Str::toInt(uint64_t &i) const 82 { 83 return RTStrToUInt64Ex(str, NULL, 0, &i); 84 } 85 86 int Utf8Str::toInt(uint32_t &i) const 87 { 88 return RTStrToUInt32Ex(str, NULL, 0, &i); 89 } 90 81 91 struct FormatData 82 92 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r16492 r16495 2990 2990 a configuration value.</desc> 2991 2991 2992 <const name="Name" value="1" /> 2993 <const name="OS" value="2" /> 2994 <const name="CPU" value="3" /> 2995 <const name="Memory" value="4" /> 2996 <const name="HardDiskControllerIDE" value="5" /> 2997 <const name="HardDiskControllerSATA" value="6" /> 2998 <const name="HardDiskControllerSCSI" value="7" /> 2999 <const name="HardDiskImage" value="8" /> 3000 <const name="CDROM" value="9" /> 3001 <const name="Floppy" value="10" /> 3002 <const name="NetworkAdapter" value="11" /> 3003 <const name="USBController" value="12" /> 3004 <const name="SoundCard" value="13" /> 2992 <const name="Ignore" value="1" /> 2993 <const name="Name" value="2" /> 2994 <const name="OS" value="3" /> 2995 <const name="CPU" value="4" /> 2996 <const name="Memory" value="5" /> 2997 <const name="HardDiskControllerIDE" value="6" /> 2998 <const name="HardDiskControllerSATA" value="7" /> 2999 <const name="HardDiskControllerSCSI" value="8" /> 3000 <const name="HardDiskImage" value="9" /> 3001 <const name="CDROM" value="10" /> 3002 <const name="Floppy" value="11" /> 3003 <const name="NetworkAdapter" value="12" /> 3004 <const name="USBController" value="13" /> 3005 <const name="SoundCard" value="14" /> 3005 3006 3006 3007 </enum> … … 3025 3026 The list below identifies the value sets that are possible depending on the 3026 3027 <link to="VirtualSystemDescriptionType" /> enum value in the array item in aTypes[]. In each case, 3027 the array item with the same index in aOrigValues[] will contain the original value as contained 3028 in the OVF file, and the corresponding item in aAutoValues[] will contain a suggested value to 3029 be used for VirtualBox. Items in the other arrays will be empty, unless specified otherwise below: 3028 the array item with the same index in aOrigValue[] will contain the original value as contained 3029 in the OVF file (just for informational purposes), and the corresponding item in aConfigValues[] 3030 will contain a suggested value to be used for VirtualBox. Depending on the description type, 3031 the aExtraConfigValues[] array item may also be used. 3030 3032 3031 3033 <ul> 3032 3034 <li> 3033 "OS": then the corresponding item in aAutoValues[] contains the suggested guest operating system 3034 for VirtualBox. The corresponding item in aOrigValues[] will contain a numerical value that 3035 described the operating system in the OVF (see <link to="CIMOSType" />). 3035 "OS": the guest operating system type. There must be exactly one such array item on import. The 3036 corresponding item in aConfigValues[] contains the suggested guest operating system for VirtualBox. 3037 This will be one of the values listed in <link to="IVirtualBox::guestOSTypes" />. The corresponding 3038 item in aOrigValues[] will contain a numerical value that described the operating system in the OVF 3039 (see <link to="CIMOSType" />). 3036 3040 </li> 3037 3041 <li> 3038 "Name": then the correponding item im aOrigValues[] will contain the suggested virtual machine name 3039 from the OVF file, and aAutoValues[] will contain a suggestion for a unique VirtualBox 3042 "Name": the name to give to the new virtual machine. There can be at most one such array item; 3043 if none is present on import, then an automatic name will be created from the operating system 3044 type. The correponding item im aOrigValues[] will contain the suggested virtual machine name 3045 from the OVF file, and aConfigValues[] will contain a suggestion for a unique VirtualBox 3040 3046 <link to="IMachine" /> name that does not exist yet. 3041 3047 </li> 3042 3048 <li> 3043 "CPU": number of CPUs.3049 "CPU": the number of CPUs. There can be at most one such item, which will presently be ignored. 3044 3050 </li> 3045 3051 <li> 3046 "Memory": amount of memory, in bytes. 3052 "Memory": the amount of guest RAM, in bytes. There can be at most one such array item; if none 3053 is present on import, then VirtualBox will set a meaningful default based on the operating system 3054 type. 3047 3055 </li> 3048 3056 <li> 3049 "HarddiskControllerSCSI": a SCSI hard disk controller. Here the items in aOrigValues[] and aAutoValues[] will either be3050 "LsiLogic" or "BusLogic". The matching item in the aRefValue[] array will contain a numerical3051 index that other items of the "Harddisk" type can use to specify which hard disk controller3052 a virtual disk should be connected to.3057 "HarddiskControllerSCSI": a SCSI hard disk controller. There can be at most one such item. 3058 The items in aOrigValues[] and aConfigValues[] will either be "LsiLogic" or "BusLogic". The 3059 matching item in the aRefs[] array will contain an integer that other items of the "Harddisk" 3060 type can use to specify which hard disk controller a virtual disk should be connected to. 3053 3061 </li> 3054 3062 <li> 3055 "HarddiskControllerIDE": an IDE hard disk controller. This has no value in aOrigValues[] or aAutoValues[]; 3056 as with SCSI controllers, the matching item in the aRefValues[] array will contain a numerical 3057 index that other items of the "Harddisk" type can use to specify which hard disk controller 3058 a virtual disk should be connected to. 3063 "HarddiskControllerIDE": an IDE hard disk controller. There can be at most one such item. This 3064 has no value in aOrigValues[] or aAutoValues[]. The matching item in the aRefs[] array will be 3065 used as with SCSI controllers (see above). 3059 3066 </li> 3060 3067 <li> 3061 "Harddisk": a virtual hard disk, most probably as a reference to an image file. The array item 3062 in aOrigValues[] will contain the file specification from the OVF file, whereas the item 3063 in aAutoValues[] will contain the fully qualified path to the image, which VirtualBox has verified 3064 to exist. 3065 The item in the aRefValues[] array specifies the hard disk controller to connect to and has the 3066 same value as another aRefValues[] array item of the types listed above. 3068 "Harddisk": a virtual hard disk, most probably as a reference to an image file. There can be an 3069 arbitrary number of these items, one for each virtual disk image that accompanies the OVF. The 3070 array item in aOrigValues[] will contain the file specification from the OVF file, whereas the item 3071 in aConfigValues[] will contain a qualified path specification where the hard disk image should 3072 be copied to; this target image will then be registered with VirtualBox. 3073 The matching item in the aRefs[] array must contain a integer specifying the hard disk controller 3074 to connect the image to. This number must be the same as the integer used by one of the hard disk 3075 controller items (SCSI, SATA or IDE; see above). 3067 3076 </li> 3068 3077 <li> 3069 3078 "NetworkAdapter": a network adapter. (todo document) 3070 3079 </li> 3080 <li> 3081 "SoundCard": a sound card. There can be at most one such item. If and only if such an item is 3082 present, sound support will be enabled for the new virtual machine. Note that the virtual 3083 machine in VirtualBox will always be presented with the standard VirtualBox soundcard, which 3084 may be different from the virtual soundcard expected by the appliance. 3085 </li> 3071 3086 </ul> 3072 3087 … … 3077 3092 </param> 3078 3093 3094 <param name="aRefs" type="unsigned long" dir="out" safearray="yes"> 3095 <desc></desc> 3096 </param> 3097 3079 3098 <param name="aOrigValues" type="wstring" dir="out" safearray="yes"> 3080 3099 <desc></desc> 3081 3100 </param> 3082 3101 3083 <param name="a AutoValues" type="wstring" dir="out" safearray="yes">3102 <param name="aConfigValues" type="wstring" dir="out" safearray="yes"> 3084 3103 <desc></desc> 3085 3104 </param> 3086 3105 3087 <param name="a Configuration" type="wstring" dir="out" safearray="yes">3106 <param name="aExtraConfigValues" type="wstring" dir="out" safearray="yes"> 3088 3107 <desc></desc> 3089 3108 </param> -
trunk/src/VBox/Main/include/ApplianceImpl.h
r16325 r16495 97 97 { 98 98 VirtualSystemDescriptionType_T type; /* Of which type is this value */ 99 Utf8Str strRef; /* Reference value to the internal implementation */ 100 Utf8Str strOriginalValue; /* The original OVF value */ 101 Utf8Str strAutoValue; /* The value which VBox suggest */ 102 Utf8Str strFinalValue; /* The value the user select */ 103 Utf8Str strConfiguration; /* Additional configuration data for this type */ 99 uint32_t ulRef; // reference number 100 Utf8Str strOrig; /* The original OVF value */ 101 Utf8Str strConfig; /* The value which VBox suggest */ 102 Utf8Str strExtraConfig; /* Additional configuration data for this type */ 104 103 }; 105 104 … … 141 140 /* IVirtualSystemDescription methods */ 142 141 STDMETHOD(GetDescription)(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes), 142 ComSafeArrayOut(ULONG, aRefs), 143 143 ComSafeArrayOut(BSTR, aOrigValues), 144 ComSafeArrayOut(BSTR, a AutoValues),145 ComSafeArrayOut(BSTR, a Configurations));144 ComSafeArrayOut(BSTR, aConfigValues), 145 ComSafeArrayOut(BSTR, aExtraConfigValues)); 146 146 STDMETHOD(SetFinalValues)(ComSafeArrayIn(IN_BSTR, aFinalValues)); 147 147 … … 151 151 private: 152 152 void addEntry(VirtualSystemDescriptionType_T aType, 153 const Utf8Str &aRef,153 uint32_t ulRef, 154 154 const Utf8Str &aOrigValue, 155 const Utf8Str &aAutoValue, 156 const Utf8Str &aConfig = ""); 155 const Utf8Str &aAutoValue); 157 156 158 157 std::list<VirtualSystemDescriptionEntry*> findByType(VirtualSystemDescriptionType_T aType);
Note:
See TracChangeset
for help on using the changeset viewer.

