Changeset 22171 in vbox
- Timestamp:
- Aug 11, 2009 3:10:12 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 50947
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl2.cpp
r22166 r22171 667 667 * intelppm driver refuses to register an idle state handler. 668 668 */ 669 if ( (cCpus > 1) ||fIOAPIC)669 if (cCpus > 1 || fIOAPIC) 670 670 fShowCpu = true; 671 671 … … 761 761 hrc = pMachine->COMGETTER(VRAMSize)(&cVRamMBs); H(); 762 762 rc = CFGMR3InsertInteger(pCfg, "VRamSize", cVRamMBs * _1M); RC_CHECK(); 763 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /* not safe here yet. */ 763 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /* not safe here yet. */ /** @todo this needs fixing !!! No wonder VGA is slooooooooow on 32-bit darwin! */ 764 764 rc = CFGMR3InsertInteger(pCfg, "R0Enabled", fHWVirtExEnabled); RC_CHECK(); 765 765 #endif … … 784 784 * Boot menu 785 785 */ 786 BIOSBootMenuMode_T bootMenuMode; 787 int value; 788 biosSettings->COMGETTER(BootMenuMode)(&bootMenuMode); 789 switch (bootMenuMode) 790 { 791 case BIOSBootMenuMode_Disabled: 792 value = 0; 793 break; 794 case BIOSBootMenuMode_MenuOnly: 795 value = 1; 796 break; 797 default: 798 value = 2; 799 } 800 rc = CFGMR3InsertInteger(pCfg, "ShowBootMenu", value); RC_CHECK(); 786 BIOSBootMenuMode_T eBootMenuMode; 787 int iShowBootMenu; 788 biosSettings->COMGETTER(BootMenuMode)(&eBootMenuMode); 789 switch (eBootMenuMode) 790 { 791 case BIOSBootMenuMode_Disabled: iShowBootMenu = 0; break; 792 case BIOSBootMenuMode_MenuOnly: iShowBootMenu = 1; break; 793 default: iShowBootMenu = 2; break; 794 } 795 rc = CFGMR3InsertInteger(pCfg, "ShowBootMenu", iShowBootMenu); RC_CHECK(); 801 796 802 797 /* Custom VESA mode list */ … … 844 839 for (size_t i = 0; i < ctrls.size(); ++ i) 845 840 { 846 PCFGMNODE pCtlInst = NULL;/* /Devices/<name>/0/ */841 PCFGMNODE pCtlInst = NULL; /* /Devices/<name>/0/ */ 847 842 StorageControllerType_T enmCtrlType; 848 StorageBus_T enmBus;849 bool fSCSI = false;850 BSTR controllerName;843 StorageBus_T enmBus; 844 bool fSCSI = false; 845 BSTR controllerName; 851 846 852 847 rc = ctrls[i]->COMGETTER(ControllerType)(&enmCtrlType); H(); … … 877 872 break; 878 873 } 874 879 875 case StorageControllerType_BusLogic: 880 876 { … … 898 894 break; 899 895 } 896 900 897 case StorageControllerType_IntelAhci: 901 898 { … … 945 942 break; 946 943 } 944 947 945 case StorageControllerType_PIIX3: 948 946 case StorageControllerType_PIIX4: … … 1017 1015 break; 1018 1016 } 1017 1019 1018 default: 1020 AssertMsgFailed (("invalid storage controller type: " 1021 "%d\n", enmCtrlType)); 1022 return VERR_GENERAL_FAILURE; 1019 AssertMsgFailedReturn(("invalid storage controller type: %d\n", enmCtrlType), VERR_GENERAL_FAILURE); 1023 1020 } 1024 1021 … … 1046 1043 case StorageBus_IDE: 1047 1044 { 1048 if (lPort >= 2 || lPort < 0) 1049 { 1050 AssertMsgFailed (("invalid controller channel number: " 1051 "%d\n", lPort)); 1052 return VERR_GENERAL_FAILURE; 1053 } 1054 1055 if (lDev >= 2 || lDev < 0) 1056 { 1057 AssertMsgFailed (("invalid controller device number: " 1058 "%d\n", lDev)); 1059 return VERR_GENERAL_FAILURE; 1060 } 1061 1045 AssertMsgReturn(lPort < 2 && lPort >= 0, ("%d\n", lPort), VERR_GENERAL_FAILURE); 1046 AssertMsgReturn(lDev < 2 && lDev >= 0, ("%d\n", lDev), VERR_GENERAL_FAILURE); 1062 1047 iLUN = 2 * lPort + lDev; 1063 1048 break; … … 1070 1055 } 1071 1056 default: 1072 { 1073 AssertMsgFailed (("invalid storage bus type: " 1074 "%d\n", enmBus)); 1075 return VERR_GENERAL_FAILURE; 1076 } 1057 AssertMsgFailedReturn(("%d\n", enmBus), VERR_GENERAL_FAILURE); 1077 1058 } 1078 1059 … … 1115 1096 PCFGMNODE pVDC; 1116 1097 rc = CFGMR3InsertNode(pCfg, "VDConfig", &pVDC); RC_CHECK(); 1117 for (size_t ii = 0; ii < names.size(); ++ 1098 for (size_t ii = 0; ii < names.size(); ++ii) 1118 1099 { 1119 1100 if (values[ii] && *values[ii]) … … 1122 1103 Utf8Str value = values[ii]; 1123 1104 rc = CFGMR3InsertString(pVDC, name, value); 1124 if ( !(name.compare("HostIPStack"))1125 && !(value.compare("0")))1105 if ( name.compare("HostIPStack") == 0 1106 && value.compare("0") == 0) 1126 1107 fHostIP = false; 1127 1108 } … … 1164 1145 Utf8Str name = names[ii]; 1165 1146 Utf8Str value = values[ii]; 1166 rc = CFGMR3InsertString 1147 rc = CFGMR3InsertString(pVDC, name, value); 1167 1148 if ( name.compare("HostIPStack") == 0 1168 1149 && value.compare("0") == 0) … … 1345 1326 * Configure the network card now 1346 1327 */ 1347 1348 1328 rc = configNetwork(pConsole, pszAdapterName, ulInstance, 0, networkAdapter, 1349 pCfg, pLunL0, pInst, false /*fAttachDetach*/); 1350 RC_CHECK(); 1329 pCfg, pLunL0, pInst, false /*fAttachDetach*/); RC_CHECK(); 1351 1330 } 1352 1331 … … 1368 1347 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1369 1348 1370 ULONG ulIRQ, ulIOBase; 1371 PortMode_T HostMode; 1372 Bstr path; 1349 ULONG ulIRQ; 1350 hrc = serialPort->COMGETTER(IRQ)(&ulIRQ); H(); 1351 rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK(); 1352 ULONG ulIOBase; 1353 hrc = serialPort->COMGETTER(IOBase)(&ulIOBase); H(); 1354 rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK(); 1373 1355 BOOL fServer; 1374 hrc = serialPort->COMGETTER(HostMode)(&HostMode); H();1375 hrc = serialPort->COMGETTER(IRQ)(&ulIRQ); H();1376 hrc = serialPort->COMGETTER(IOBase)(&ulIOBase); H();1377 hrc = serialPort->COMGETTER(Path)(path.asOutParam()); H();1378 1356 hrc = serialPort->COMGETTER(Server)(&fServer); H(); 1379 rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK(); 1380 rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK(); 1381 if (HostMode != PortMode_Disconnected) 1357 hrc = serialPort->COMGETTER(Path)(&str); H(); 1358 PortMode_T eHostMode; 1359 hrc = serialPort->COMGETTER(HostMode)(&eHostMode); H(); 1360 if (eHostMode != PortMode_Disconnected) 1382 1361 { 1383 1362 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 1384 if ( HostMode == PortMode_HostPipe)1363 if (eHostMode == PortMode_HostPipe) 1385 1364 { 1386 1365 rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK(); … … 1388 1367 rc = CFGMR3InsertString(pLunL1, "Driver", "NamedPipe"); RC_CHECK(); 1389 1368 rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK(); 1390 rc = CFGMR3InsertString (pLunL2, "Location", Utf8Str(path));RC_CHECK();1369 rc = CFGMR3InsertStringW(pLunL2, "Location", str); RC_CHECK(); 1391 1370 rc = CFGMR3InsertInteger(pLunL2, "IsServer", fServer); RC_CHECK(); 1392 1371 } 1393 else if ( HostMode == PortMode_HostDevice)1372 else if (eHostMode == PortMode_HostDevice) 1394 1373 { 1395 1374 rc = CFGMR3InsertString(pLunL0, "Driver", "Host Serial"); RC_CHECK(); 1396 1375 rc = CFGMR3InsertNode(pLunL0, "Config", &pLunL1); RC_CHECK(); 1397 rc = CFGMR3InsertString (pLunL1, "DevicePath", Utf8Str(path));RC_CHECK();1398 } 1399 else if ( HostMode == PortMode_RawFile)1376 rc = CFGMR3InsertStringW(pLunL1, "DevicePath", str); RC_CHECK(); 1377 } 1378 else if (eHostMode == PortMode_RawFile) 1400 1379 { 1401 1380 rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK(); … … 1403 1382 rc = CFGMR3InsertString(pLunL1, "Driver", "RawFile"); RC_CHECK(); 1404 1383 rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK(); 1405 rc = CFGMR3InsertString(pLunL2, "Location", Utf8Str(path)); RC_CHECK(); 1406 } 1407 } 1384 rc = CFGMR3InsertStringW(pLunL2, "Location", str); RC_CHECK(); 1385 } 1386 } 1387 STR_FREE(); 1408 1388 } 1409 1389 … … 1415 1395 { 1416 1396 ComPtr<IParallelPort> parallelPort; 1417 hrc = pMachine->GetParallelPort (ulInstance, parallelPort.asOutParam());H();1397 hrc = pMachine->GetParallelPort(ulInstance, parallelPort.asOutParam()); H(); 1418 1398 BOOL fEnabled = FALSE; 1419 1399 if (parallelPort) 1400 { 1420 1401 hrc = parallelPort->COMGETTER(Enabled)(&fEnabled); H(); 1402 } 1421 1403 if (!fEnabled) 1422 1404 continue; … … 1425 1407 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1426 1408 1427 ULONG ulIRQ, ulIOBase; 1428 Bstr DevicePath; 1409 ULONG ulIRQ; 1429 1410 hrc = parallelPort->COMGETTER(IRQ)(&ulIRQ); H(); 1411 rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK(); 1412 ULONG ulIOBase; 1430 1413 hrc = parallelPort->COMGETTER(IOBase)(&ulIOBase); H(); 1431 hrc = parallelPort->COMGETTER(Path)(DevicePath.asOutParam()); H();1432 rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK();1433 1414 rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK(); 1434 1415 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 1435 1416 rc = CFGMR3InsertString(pLunL0, "Driver", "HostParallel"); RC_CHECK(); 1436 1417 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK(); 1437 rc = CFGMR3InsertString(pLunL1, "DevicePath", Utf8Str(DevicePath)); RC_CHECK(); 1418 hrc = parallelPort->COMGETTER(Path)(&str); H(); 1419 rc = CFGMR3InsertStringW(pLunL1, "DevicePath", str); RC_CHECK(); 1420 STR_FREE(); 1438 1421 } 1439 1422
Note:
See TracChangeset
for help on using the changeset viewer.