Changeset 16231 in vbox
- Timestamp:
- Jan 26, 2009 1:43:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r16228 r16231 944 944 945 945 /* CPU count (ignored for now) */ 946 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxCPUCount) */ 946 947 // list<VirtualSystemDescriptionEntry> vsdeCPU = vsd->findByType (VirtualSystemDescriptionType_CPU); 947 948 948 949 /* RAM */ 950 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */ 949 951 list<VirtualSystemDescriptionEntry> vsdeRAM = vsd->findByType (VirtualSystemDescriptionType_Memory); 950 952 Assert (vsdeRAM.size() == 1); 951 953 string memoryVBox = vsdeRAM.front().strFinalValue; 952 uint 32_t tt = RTStrToUInt32(memoryVBox.c_str()) / _1M;954 uint64_t tt = RTStrToUInt64 (memoryVBox.c_str()) / _1M; 953 955 954 956 rc = newMachine->COMSETTER(MemorySize)(tt); … … 956 958 957 959 /* VRAM */ 958 /* Get the recommended VRAM for this guest os type */ 960 /* Get the recommended VRAM for this guest OS type */ 961 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestVRAM) */ 959 962 ULONG vramVBox; 960 963 rc = osType->COMGETTER(RecommendedVRAM) (&vramVBox); … … 978 981 { 979 982 list<VirtualSystemDescriptionEntry>::const_iterator nwIt; 983 /* Iterate through all network cards. We support 8 network adapters 984 * at the maximum. (@todo: warn if it are more!) */ 980 985 size_t a = 0; 981 986 for (nwIt = vsdeNW.begin(); 982 (nwIt != vsdeNW.end() && a < 9);987 (nwIt != vsdeNW.end() && a < SchemaDefs::NetworkAdapterCount); 983 988 ++nwIt, ++a) 984 989 { … … 1238 1243 if (nameVBox == "") 1239 1244 nameVBox = osTypeVBox; 1240 /* @todo: make sure the name is unique (add some numbers if not) */1241 1245 searchUniqueVMName (nameVBox); 1242 vsd->addEntry (VirtualSystemDescriptionType_Name, 0, nameVBox, nameVBox);1246 vsd->addEntry (VirtualSystemDescriptionType_Name, 0, vs.strName, nameVBox); 1243 1247 1244 1248 /* Now that we know the base system get our internal defaults based on that. */ … … 1248 1252 1249 1253 /* CPU count */ 1254 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxCPUCount) */ 1250 1255 ULONG cpuCountVBox = vs.cCPUs; 1251 1256 if (vs.cCPUs == 0) … … 1254 1259 1255 1260 /* RAM */ 1261 /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */ 1256 1262 uint64_t ullMemSizeVBox = vs.ullMemorySize; /** @todo r=bird/MSC: this will overflow at 4GB, use 64-bit type. */ 1257 1263 if (vs.ullMemorySize == 0) … … 1281 1287 /* Use PIIX4 as default */ 1282 1288 IDEControllerType_T hdcController = IDEControllerType_PIIX4; 1283 if (!RTStrICmp (hdc.strControllerType.c_str(), "PIIX3"))1289 if (!RTStrICmp (hdc.strControllerType.c_str(), "PIIX3")) 1284 1290 hdcController = IDEControllerType_PIIX3; 1285 else if (!RTStrICmp (hdc.strControllerType.c_str(), "PIIX4"))1291 else if (!RTStrICmp (hdc.strControllerType.c_str(), "PIIX4")) 1286 1292 hdcController = IDEControllerType_PIIX4; 1287 1293 vsd->addEntry (VirtualSystemDescriptionType_HarddiskControllerIDE, hdc.idController, hdc.strControllerType, toString<ULONG> (hdcController)); … … 1299 1305 string hdcController = "LsiLogic"; 1300 1306 // @todo: figure out the SCSI types 1301 if (!RTStrICmp (hdc.strControllerType.c_str(), "LsiLogic"))1307 if (!RTStrICmp (hdc.strControllerType.c_str(), "LsiLogic")) 1302 1308 hdcController = "LsiLogic"; 1303 else if (!RTStrICmp (hdc.strControllerType.c_str(), "BusLogic"))1309 else if (!RTStrICmp (hdc.strControllerType.c_str(), "BusLogic")) 1304 1310 hdcController = "BusLogic"; 1305 1311 vsd->addEntry (VirtualSystemDescriptionType_HarddiskControllerSCSI, hdc.idController, hdc.strControllerType, hdcController); … … 1316 1322 // - check that the filename is unique to vbox in any case 1317 1323 list<VirtualDisk>::const_iterator hdIt; 1318 /* Iterate through all hard disks */1324 /* Iterate through all hard disks ()*/ 1319 1325 for (hdIt = vs.llVirtualDisks.begin(); 1320 1326 hdIt != vs.llVirtualDisks.end(); … … 1330 1336 // - figure out if there is a url specifier for vhd already 1331 1337 // - we need a url specifier for the vdi format 1332 if (!RTStrICmp (di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse"))1338 if (!RTStrICmp (di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse")) 1333 1339 fSupported = true; 1334 1340 /* enable compressed formats for the first tests also */ 1335 else if (!RTStrICmp (di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed"))1341 else if (!RTStrICmp (di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed")) 1336 1342 fSupported = true; 1337 1343 if (fSupported) … … 1348 1354 if (vs.llNetworkNames.size() > 0) 1349 1355 { 1350 /* Get the default network adapter type for the selected guest os*/1356 /* Get the default network adapter type for the selected guest OS */ 1351 1357 NetworkAdapterType_T nwAdapterVBox = NetworkAdapterType_Am79C970A; 1352 1358 rc = osType->COMGETTER(AdapterType) (&nwAdapterVBox); 1353 1359 ComAssertComRCThrowRC (rc); 1354 1360 list<string>::const_iterator nwIt; 1355 /* Iterate through all abstract networks */ 1361 /* Iterate through all abstract networks. We support 8 network 1362 * adapters at the maximum. (@todo: warn if it are more!) */ 1363 size_t a = 0; 1356 1364 for (nwIt = vs.llNetworkNames.begin(); 1357 nwIt != vs.llNetworkNames.end() ;1358 ++nwIt )1365 nwIt != vs.llNetworkNames.end() && a < SchemaDefs::NetworkAdapterCount; 1366 ++nwIt, ++a) 1359 1367 { 1360 1368 // string nwController = *nwIt; // @todo: not used yet
Note:
See TracChangeset
for help on using the changeset viewer.