Changeset 2902 in vbox
- Timestamp:
- May 29, 2007 9:58:40 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
r2899 r2902 166 166 #endif 167 167 //static bool fPacketSniffer = false; 168 static char * hdaFile = NULL;169 static char * cdromFile = NULL;170 static char * fdaFile = NULL;168 static char *g_pszHdaFile = NULL; 169 static char *g_pszCdromFile = NULL; 170 static char *g_pszFdaFile = NULL; 171 171 static const char *pszBootDevice = "IDE"; 172 static uint32_t memorySize= 128;173 static uint32_t vramSize= 4;172 static uint32_t g_u32MemorySizeMB = 128; 173 static uint32_t g_u32VRamSizeMB = 4; 174 174 #ifdef VBOXSDL_ADVANCED_OPTIONS 175 175 static bool g_fRawR0 = true; … … 179 179 #endif 180 180 static bool g_fPreAllocRam = false; 181 static int g_iBootMenu = 2; 181 182 static bool g_fReleaseLog = true; /**< Set if we should open the release. */ 182 183 … … 286 287 " -cdrom <file> Set CDROM to file/device ('none' to unmount)\n" 287 288 " -boot <a|c|d> Set boot device (a = floppy, c = first hard disk, d = DVD)\n" 289 " -boot menu <0|1|2> Boot menu (0 = disable, 1 = menu only, 2 = message + menu)\n" 288 290 " -m <size> Set memory size in megabytes (default 128MB)\n" 289 291 " -vram <size> Set size of video memory in megabytes\n" … … 409 411 } 410 412 } 413 else if (strcmp(pszArg, "-bootmenu") == 0) 414 { 415 if (++curArg >= argc) 416 return SyntaxError("missing argument for boot menu!\n"); 417 if (strlen(argv[curArg]) != 1 || *argv[curArg] < '0' || *argv[curArg] > '2') 418 return SyntaxError("invalid argument for boot menu! (%s)\n", argv[curArg]); 419 rc = VINF_SUCCESS; 420 g_iBootMenu = *argv[curArg] - 0; 421 } 411 422 else if (strcmp(pszArg, "-m") == 0) 412 423 { 413 424 if (++curArg >= argc) 414 425 return SyntaxError("missing argument for memory size!\n"); 415 rc = RTStrToUInt32Ex(argv[curArg], NULL, 0, & memorySize);426 rc = RTStrToUInt32Ex(argv[curArg], NULL, 0, &g_u32MemorySizeMB); 416 427 if (VBOX_FAILURE(rc)) 417 428 return SyntaxError("cannot grok the memory size: %s (%Vrc)\n", … … 422 433 if (++curArg >= argc) 423 434 return SyntaxError("missing argument for vram size!\n"); 424 rc = RTStrToUInt32Ex(argv[curArg], NULL, 0, & vramSize);435 rc = RTStrToUInt32Ex(argv[curArg], NULL, 0, &g_u32VRamSizeMB); 425 436 if (VBOX_FAILURE(rc)) 426 437 return SyntaxError("cannot grok the vram size: %s (%Vrc)\n", … … 457 468 /* resolve it. */ 458 469 if (RTPathExists(argv[curArg])) 459 hdaFile = RTPathRealDup(argv[curArg]);460 if (! hdaFile)470 g_pszHdaFile = RTPathRealDup(argv[curArg]); 471 if (!g_pszHdaFile) 461 472 return SyntaxError("The path to the specified harddisk, '%s', could not be resolved.\n", argv[curArg]); 462 473 } … … 468 479 /* resolve it. */ 469 480 if (RTPathExists(argv[curArg])) 470 fdaFile = RTPathRealDup(argv[curArg]);471 if (! fdaFile)481 g_pszFdaFile = RTPathRealDup(argv[curArg]); 482 if (!g_pszFdaFile) 472 483 return SyntaxError("The path to the specified floppy disk, '%s', could not be resolved.\n", argv[curArg]); 473 484 } … … 479 490 /* resolve it. */ 480 491 if (RTPathExists(argv[curArg])) 481 cdromFile = RTPathRealDup(argv[curArg]);482 if (! cdromFile)492 g_pszCdromFile = RTPathRealDup(argv[curArg]); 493 if (!g_pszCdromFile) 483 494 return SyntaxError("The path to the specified cdrom, '%s', could not be resolved.\n", argv[curArg]); 484 495 } … … 704 715 #ifdef __L4__ 705 716 /* The L4 console provides (currently) a fixed resolution. */ 706 if ( vramSize* _1M >= gFramebuffer->getHostXres()717 if (g_u32VRamSizeMB * _1M >= gFramebuffer->getHostXres() 707 718 * gFramebuffer->getHostYres() 708 719 * (gDisplay->getColorDepth() / 8)) … … 1043 1054 int rc; 1044 1055 1045 #define UPDATERC() do { if (VBOX_FAILURE(rc) && VBOX_SUCCESS(rcAll)) rcAll = rc; } while (0) 1046 #undef CHECK_RC /** @todo r=bird: clashes with VBox/com/Assert.h. */ 1047 #define CHECK_RC() UPDATERC() 1056 #define UPDATE_RC() do { if (VBOX_FAILURE(rc) && VBOX_SUCCESS(rcAll)) rcAll = rc; } while (0) 1048 1057 1049 1058 /* … … 1051 1060 */ 1052 1061 PCFGMNODE pRoot = CFGMR3GetRoot(pVM); 1053 rc = CFGMR3InsertString(pRoot, "Name", "Default VM"); 1054 UPDATERC(); 1055 rc = CFGMR3InsertInteger(pRoot, "RamSize", memorySize * _1M); 1056 UPDATERC(); 1062 rc = CFGMR3InsertString(pRoot, "Name", "Default VM"); UPDATE_RC(); 1063 rc = CFGMR3InsertInteger(pRoot, "RamSize", g_u32MemorySizeMB * _1M); UPDATE_RC(); 1057 1064 if (g_fPreAllocRam) 1058 1065 { 1059 rc = CFGMR3InsertInteger(pRoot, "PreAllocRam", 1); 1060 UPDATERC(); 1061 } 1062 rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); 1063 UPDATERC(); 1066 rc = CFGMR3InsertInteger(pRoot, "PreAllocRam", 1); UPDATE_RC(); 1067 } 1068 rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); UPDATE_RC(); 1064 1069 #ifdef VBOXSDL_ADVANCED_OPTIONS 1065 rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", g_fRawR3); 1066 UPDATERC(); 1067 rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", g_fRawR0); 1068 UPDATERC(); 1069 rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", g_fPATM); 1070 UPDATERC(); 1071 rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", g_fCSAM); 1070 rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", g_fRawR3); UPDATE_RC(); 1071 rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", g_fRawR0); UPDATE_RC(); 1072 rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", g_fPATM); UPDATE_RC(); 1073 rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", g_fCSAM); UPDATE_RC(); 1072 1074 #else 1073 rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", 1); 1074 UPDATERC(); 1075 rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", 1); 1076 UPDATERC(); 1077 rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", 1); 1078 UPDATERC(); 1079 rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); 1080 #endif 1081 UPDATERC(); 1075 rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", 1); UPDATE_RC(); 1076 rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", 1); UPDATE_RC(); 1077 rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", 1); UPDATE_RC(); 1078 rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); UPDATE_RC(); 1079 #endif 1082 1080 1083 1081 /* 1084 1082 * PDM. 1085 1083 */ 1086 rc = PDMR3RegisterDrivers(pVM, VBoxDriversRegister); 1087 UPDATERC(); 1084 rc = PDMR3RegisterDrivers(pVM, VBoxDriversRegister); UPDATE_RC(); 1088 1085 1089 1086 /* … … 1091 1088 */ 1092 1089 PCFGMNODE pDevices = NULL; 1093 rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); 1094 UPDATERC(); 1090 rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); UPDATE_RC(); 1095 1091 /* device */ 1096 1092 PCFGMNODE pDev = NULL; … … 1103 1099 * PC Arch. 1104 1100 */ 1105 rc = CFGMR3InsertNode(pDevices, "pcarch", &pDev); 1106 UPDATERC(); 1107 rc = CFGMR3InsertNode(pDev, "0", &pInst); 1108 UPDATERC(); 1109 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ 1110 UPDATERC(); 1111 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); 1112 UPDATERC(); 1101 rc = CFGMR3InsertNode(pDevices, "pcarch", &pDev); UPDATE_RC(); 1102 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1103 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1104 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1113 1105 1114 1106 /* 1115 1107 * PC Bios. 1116 1108 */ 1117 rc = CFGMR3InsertNode(pDevices, "pcbios", &pDev); 1118 UPDATERC(); 1119 rc = CFGMR3InsertNode(pDev, "0", &pInst); 1120 UPDATERC(); 1121 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ 1122 UPDATERC(); 1123 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); 1124 UPDATERC(); 1125 rc = CFGMR3InsertInteger(pCfg, "RamSize", memorySize * _1M); 1126 UPDATERC(); 1127 rc = CFGMR3InsertString(pCfg, "BootDevice0", pszBootDevice); 1128 UPDATERC(); 1129 rc = CFGMR3InsertString(pCfg, "BootDevice1", "NONE"); 1130 UPDATERC(); 1131 rc = CFGMR3InsertString(pCfg, "BootDevice2", "NONE"); 1132 UPDATERC(); 1133 rc = CFGMR3InsertString(pCfg, "BootDevice3", "NONE"); 1134 UPDATERC(); 1135 rc = CFGMR3InsertString(pCfg, "HardDiskDevice", "piix3ide"); 1136 UPDATERC(); 1137 rc = CFGMR3InsertString(pCfg, "FloppyDevice", "i82078"); 1138 UPDATERC(); 1139 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); 1140 UPDATERC(); 1109 rc = CFGMR3InsertNode(pDevices, "pcbios", &pDev); UPDATE_RC(); 1110 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1111 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1112 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1113 rc = CFGMR3InsertInteger(pCfg, "RamSize", g_u32MemorySizeMB * _1M); UPDATE_RC(); 1114 rc = CFGMR3InsertString(pCfg, "BootDevice0", pszBootDevice); UPDATE_RC(); 1115 rc = CFGMR3InsertString(pCfg, "BootDevice1", "NONE"); UPDATE_RC(); 1116 rc = CFGMR3InsertString(pCfg, "BootDevice2", "NONE"); UPDATE_RC(); 1117 rc = CFGMR3InsertString(pCfg, "BootDevice3", "NONE"); UPDATE_RC(); 1118 rc = CFGMR3InsertString(pCfg, "HardDiskDevice", "piix3ide"); UPDATE_RC(); 1119 rc = CFGMR3InsertString(pCfg, "FloppyDevice", "i82078"); UPDATE_RC(); 1120 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); UPDATE_RC(); 1141 1121 1142 1122 /* Default: no bios logo. */ 1143 rc = CFGMR3InsertInteger(pCfg, "FadeIn", 1); 1144 UPDATERC();1145 rc = CFGMR3InsertInteger(pCfg, " FadeOut", 0);1146 UPDATERC();1147 rc = CFGMR3InsertInteger(pCfg, "LogoTime", 0); 1148 UPDATERC();1149 rc = CFGMR3Insert String(pCfg, "LogoFile", "");1150 UPDATERC(); 1123 rc = CFGMR3InsertInteger(pCfg, "FadeIn", 1); UPDATE_RC(); 1124 rc = CFGMR3InsertInteger(pCfg, "FadeOut", 0); UPDATE_RC(); 1125 rc = CFGMR3InsertInteger(pCfg, "LogoTime", 0); UPDATE_RC(); 1126 rc = CFGMR3InsertString(pCfg, "LogoFile", ""); UPDATE_RC(); 1127 1128 /* Boot menu */ 1129 rc = CFGMR3InsertInteger(pCfg, "ShowBootMenu", g_iBootMenu); UPDATE_RC(); 1130 1151 1131 1152 1132 /* … … 1155 1135 if (g_fACPI) 1156 1136 { 1157 rc = CFGMR3InsertNode(pDevices, "acpi", &pDev); CHECK_RC();1158 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1159 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1160 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1161 rc = CFGMR3InsertInteger(pCfg, "RamSize", memorySize * _1M); CHECK_RC();1162 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); CHECK_RC();1163 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); CHECK_RC();1164 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); CHECK_RC();1165 1166 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1167 rc = CFGMR3InsertString(pLunL0, "Driver", "ACPIHost"); CHECK_RC();1168 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1137 rc = CFGMR3InsertNode(pDevices, "acpi", &pDev); UPDATE_RC(); 1138 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1139 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1140 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1141 rc = CFGMR3InsertInteger(pCfg, "RamSize", g_u32MemorySizeMB * _1M); UPDATE_RC(); 1142 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); UPDATE_RC(); 1143 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); UPDATE_RC(); 1144 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); UPDATE_RC(); 1145 1146 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1147 rc = CFGMR3InsertString(pLunL0, "Driver", "ACPIHost"); UPDATE_RC(); 1148 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1169 1149 } 1170 1150 … … 1172 1152 * PCI bus. 1173 1153 */ 1174 rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ 1175 UPDATERC(); 1176 rc = CFGMR3InsertNode(pDev, "0", &pInst); 1177 UPDATERC(); 1178 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ 1179 UPDATERC(); 1180 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); 1181 UPDATERC(); 1182 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); CHECK_RC(); 1154 rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ UPDATE_RC(); 1155 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1156 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1157 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1158 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); UPDATE_RC(); 1183 1159 1184 1160 /* 1185 1161 * DMA 1186 1162 */ 1187 rc = CFGMR3InsertNode(pDevices, "8237A", &pDev); CHECK_RC();1188 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1189 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1163 rc = CFGMR3InsertNode(pDevices, "8237A", &pDev); UPDATE_RC(); 1164 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1165 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1190 1166 1191 1167 /* 1192 1168 * PCI bus. 1193 1169 */ 1194 rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ CHECK_RC();1195 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1196 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1197 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1170 rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ UPDATE_RC(); 1171 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1172 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1173 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1198 1174 1199 1175 /* 1200 1176 * PS/2 keyboard & mouse. 1201 1177 */ 1202 rc = CFGMR3InsertNode(pDevices, "pckbd", &pDev); CHECK_RC();1203 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1204 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1205 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1206 1207 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1208 rc = CFGMR3InsertString(pLunL0, "Driver", "KeyboardQueue"); CHECK_RC();1209 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1210 rc = CFGMR3InsertInteger(pCfg, "QueueSize", 64); CHECK_RC();1211 1212 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); CHECK_RC();1213 rc = CFGMR3InsertString(pLunL1, "Driver", "MainKeyboard"); CHECK_RC();1214 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); CHECK_RC();1215 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)gKeyboard); CHECK_RC();1216 1217 rc = CFGMR3InsertNode(pInst, "LUN#1", &pLunL0); CHECK_RC();1218 rc = CFGMR3InsertString(pLunL0, "Driver", "MouseQueue"); CHECK_RC();1219 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1220 rc = CFGMR3InsertInteger(pCfg, "QueueSize", 128); CHECK_RC();1221 1222 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); CHECK_RC();1223 rc = CFGMR3InsertString(pLunL1, "Driver", "MainMouse"); CHECK_RC();1224 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); CHECK_RC();1225 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)gMouse); CHECK_RC();1178 rc = CFGMR3InsertNode(pDevices, "pckbd", &pDev); UPDATE_RC(); 1179 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1180 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1181 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1182 1183 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1184 rc = CFGMR3InsertString(pLunL0, "Driver", "KeyboardQueue"); UPDATE_RC(); 1185 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1186 rc = CFGMR3InsertInteger(pCfg, "QueueSize", 64); UPDATE_RC(); 1187 1188 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); UPDATE_RC(); 1189 rc = CFGMR3InsertString(pLunL1, "Driver", "MainKeyboard"); UPDATE_RC(); 1190 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); UPDATE_RC(); 1191 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)gKeyboard); UPDATE_RC(); 1192 1193 rc = CFGMR3InsertNode(pInst, "LUN#1", &pLunL0); UPDATE_RC(); 1194 rc = CFGMR3InsertString(pLunL0, "Driver", "MouseQueue"); UPDATE_RC(); 1195 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1196 rc = CFGMR3InsertInteger(pCfg, "QueueSize", 128); UPDATE_RC(); 1197 1198 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); UPDATE_RC(); 1199 rc = CFGMR3InsertString(pLunL1, "Driver", "MainMouse"); UPDATE_RC(); 1200 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); UPDATE_RC(); 1201 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)gMouse); UPDATE_RC(); 1226 1202 1227 1203 … … 1229 1205 * i82078 Floppy drive controller 1230 1206 */ 1231 rc = CFGMR3InsertNode(pDevices, "i82078", &pDev); CHECK_RC();1232 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1233 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); CHECK_RC();1234 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1235 rc = CFGMR3InsertInteger(pCfg, "IRQ", 6); CHECK_RC();1236 rc = CFGMR3InsertInteger(pCfg, "DMA", 2); CHECK_RC();1237 rc = CFGMR3InsertInteger(pCfg, "MemMapped", 0 ); CHECK_RC();1238 rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f0); CHECK_RC();1207 rc = CFGMR3InsertNode(pDevices, "i82078", &pDev); UPDATE_RC(); 1208 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1209 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); UPDATE_RC(); 1210 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1211 rc = CFGMR3InsertInteger(pCfg, "IRQ", 6); UPDATE_RC(); 1212 rc = CFGMR3InsertInteger(pCfg, "DMA", 2); UPDATE_RC(); 1213 rc = CFGMR3InsertInteger(pCfg, "MemMapped", 0 ); UPDATE_RC(); 1214 rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f0); UPDATE_RC(); 1239 1215 1240 1216 /* Attach the status driver */ 1241 rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); CHECK_RC();1242 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); CHECK_RC();1243 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1244 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&mapFDLeds[0]); CHECK_RC();1245 rc = CFGMR3InsertInteger(pCfg, "First", 0); CHECK_RC();1246 rc = CFGMR3InsertInteger(pCfg, "Last", 0); CHECK_RC();1247 1248 if ( fdaFile)1249 { 1250 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1251 rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); CHECK_RC();1252 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1253 rc = CFGMR3InsertString(pCfg, "Type", "Floppy 1.44"); CHECK_RC();1254 rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); CHECK_RC();1255 1256 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); CHECK_RC();1257 rc = CFGMR3InsertString(pLunL1, "Driver", "RawImage"); CHECK_RC();1258 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); CHECK_RC();1259 rc = CFGMR3InsertString(pCfg, "Path", fdaFile); CHECK_RC();1217 rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); UPDATE_RC(); 1218 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); UPDATE_RC(); 1219 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1220 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&mapFDLeds[0]); UPDATE_RC(); 1221 rc = CFGMR3InsertInteger(pCfg, "First", 0); UPDATE_RC(); 1222 rc = CFGMR3InsertInteger(pCfg, "Last", 0); UPDATE_RC(); 1223 1224 if (g_pszFdaFile) 1225 { 1226 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1227 rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); UPDATE_RC(); 1228 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1229 rc = CFGMR3InsertString(pCfg, "Type", "Floppy 1.44"); UPDATE_RC(); 1230 rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); UPDATE_RC(); 1231 1232 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); UPDATE_RC(); 1233 rc = CFGMR3InsertString(pLunL1, "Driver", "RawImage"); UPDATE_RC(); 1234 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); UPDATE_RC(); 1235 rc = CFGMR3InsertString(pCfg, "Path", g_pszFdaFile); UPDATE_RC(); 1260 1236 } 1261 1237 … … 1263 1239 * i8254 Programmable Interval Timer And Dummy Speaker 1264 1240 */ 1265 rc = CFGMR3InsertNode(pDevices, "i8254", &pDev); CHECK_RC();1266 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1267 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1241 rc = CFGMR3InsertNode(pDevices, "i8254", &pDev); UPDATE_RC(); 1242 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1243 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1268 1244 #ifdef DEBUG 1269 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1245 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1270 1246 #endif 1271 1247 … … 1273 1249 * i8259 Programmable Interrupt Controller. 1274 1250 */ 1275 rc = CFGMR3InsertNode(pDevices, "i8259", &pDev); CHECK_RC();1276 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1277 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1278 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1251 rc = CFGMR3InsertNode(pDevices, "i8259", &pDev); UPDATE_RC(); 1252 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1253 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1254 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1279 1255 1280 1256 /* 1281 1257 * Advanced Programmable Interrupt Controller. 1282 1258 */ 1283 rc = CFGMR3InsertNode(pDevices, "apic", &pDev); CHECK_RC();1284 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1285 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1286 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1287 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); CHECK_RC();1259 rc = CFGMR3InsertNode(pDevices, "apic", &pDev); UPDATE_RC(); 1260 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1261 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1262 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1263 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", g_fIOAPIC); UPDATE_RC(); 1288 1264 1289 1265 /* … … 1292 1268 if (g_fIOAPIC) 1293 1269 { 1294 rc = CFGMR3InsertNode(pDevices, "ioapic", &pDev); CHECK_RC();1295 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1296 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1297 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1270 rc = CFGMR3InsertNode(pDevices, "ioapic", &pDev); UPDATE_RC(); 1271 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1272 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1273 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1298 1274 } 1299 1275 … … 1301 1277 * RTC MC146818. 1302 1278 */ 1303 rc = CFGMR3InsertNode(pDevices, "mc146818", &pDev); CHECK_RC();1304 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1305 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1279 rc = CFGMR3InsertNode(pDevices, "mc146818", &pDev); UPDATE_RC(); 1280 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1281 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1306 1282 1307 1283 /* 1308 1284 * Serial ports 1309 1285 */ 1310 rc = CFGMR3InsertNode(pDevices, "serial", &pDev); CHECK_RC();1311 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1312 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1313 rc = CFGMR3InsertInteger(pCfg, "IRQ", 4); CHECK_RC();1314 rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f8); CHECK_RC();1315 1316 rc = CFGMR3InsertNode(pDev, "1", &pInst); CHECK_RC();1317 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1318 rc = CFGMR3InsertInteger(pCfg, "IRQ", 3); CHECK_RC();1319 rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x2f8); CHECK_RC();1286 rc = CFGMR3InsertNode(pDevices, "serial", &pDev); UPDATE_RC(); 1287 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1288 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1289 rc = CFGMR3InsertInteger(pCfg, "IRQ", 4); UPDATE_RC(); 1290 rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f8); UPDATE_RC(); 1291 1292 rc = CFGMR3InsertNode(pDev, "1", &pInst); UPDATE_RC(); 1293 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1294 rc = CFGMR3InsertInteger(pCfg, "IRQ", 3); UPDATE_RC(); 1295 rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x2f8); UPDATE_RC(); 1320 1296 1321 1297 /* 1322 1298 * VGA. 1323 1299 */ 1324 rc = CFGMR3InsertNode(pDevices, "vga", &pDev); CHECK_RC();1325 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1326 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1327 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 2); CHECK_RC();1328 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); CHECK_RC();1329 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1330 rc = CFGMR3InsertInteger(pCfg, "VRamSize", vramSize * _1M); CHECK_RC();1300 rc = CFGMR3InsertNode(pDevices, "vga", &pDev); UPDATE_RC(); 1301 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1302 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1303 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 2); UPDATE_RC(); 1304 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); UPDATE_RC(); 1305 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1306 rc = CFGMR3InsertInteger(pCfg, "VRamSize", g_u32VRamSizeMB * _1M); UPDATE_RC(); 1331 1307 1332 1308 #ifdef __L4ENV__ 1333 1309 /* XXX hard-coded */ 1334 rc = CFGMR3InsertInteger(pCfg, "HeightReduction", 18); CHECK_RC();1335 rc = CFGMR3InsertInteger(pCfg, "CustomVideoModes", 1); CHECK_RC();1310 rc = CFGMR3InsertInteger(pCfg, "HeightReduction", 18); UPDATE_RC(); 1311 rc = CFGMR3InsertInteger(pCfg, "CustomVideoModes", 1); UPDATE_RC(); 1336 1312 char szBuf[64]; 1337 1313 /* Tell the guest which is the ideal video mode to use */ … … 1340 1316 gFramebuffer->getHostYres(), 1341 1317 gFramebuffer->getHostBitsPerPixel()); 1342 rc = CFGMR3InsertString(pCfg, "CustomVideoMode1", szBuf); CHECK_RC();1343 #endif 1344 1345 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1346 rc = CFGMR3InsertString(pLunL0, "Driver", "MainDisplay"); CHECK_RC();1347 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1348 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)gDisplay); CHECK_RC();1318 rc = CFGMR3InsertString(pCfg, "CustomVideoMode1", szBuf); UPDATE_RC(); 1319 #endif 1320 1321 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1322 rc = CFGMR3InsertString(pLunL0, "Driver", "MainDisplay"); UPDATE_RC(); 1323 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1324 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)gDisplay); UPDATE_RC(); 1349 1325 1350 1326 /* 1351 1327 * IDE (update this when the main interface changes) 1352 1328 */ 1353 rc = CFGMR3InsertNode(pDevices, "piix3ide", &pDev); /* piix3 */ CHECK_RC();1354 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1355 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1356 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 1); CHECK_RC();1357 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 1); CHECK_RC();1358 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1359 1360 if ( hdaFile)1361 { 1362 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1363 rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); CHECK_RC();1364 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1365 rc = CFGMR3InsertString(pCfg, "Type", "HardDisk"); CHECK_RC();1366 rc = CFGMR3InsertInteger(pCfg, "Mountable", 0); CHECK_RC();1367 1368 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); CHECK_RC();1369 rc = CFGMR3InsertString(pLunL1, "Driver", "VBoxHDD"); CHECK_RC();1370 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); CHECK_RC();1371 rc = CFGMR3InsertString(pCfg, "Path", hdaFile); CHECK_RC();1372 } 1373 1374 if ( cdromFile)1329 rc = CFGMR3InsertNode(pDevices, "piix3ide", &pDev); /* piix3 */ UPDATE_RC(); 1330 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1331 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1332 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 1); UPDATE_RC(); 1333 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 1); UPDATE_RC(); 1334 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1335 1336 if (g_pszHdaFile) 1337 { 1338 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1339 rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); UPDATE_RC(); 1340 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1341 rc = CFGMR3InsertString(pCfg, "Type", "HardDisk"); UPDATE_RC(); 1342 rc = CFGMR3InsertInteger(pCfg, "Mountable", 0); UPDATE_RC(); 1343 1344 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); UPDATE_RC(); 1345 rc = CFGMR3InsertString(pLunL1, "Driver", "VBoxHDD"); UPDATE_RC(); 1346 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); UPDATE_RC(); 1347 rc = CFGMR3InsertString(pCfg, "Path", g_pszHdaFile); UPDATE_RC(); 1348 } 1349 1350 if (g_pszCdromFile) 1375 1351 { 1376 1352 // ASSUME: DVD drive is always attached to LUN#2 (i.e. secondary IDE master) 1377 rc = CFGMR3InsertNode(pInst, "LUN#2", &pLunL0); CHECK_RC();1378 rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); CHECK_RC();1379 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1380 rc = CFGMR3InsertString(pCfg, "Type", "DVD"); CHECK_RC();1381 rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); CHECK_RC();1382 1383 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); CHECK_RC();1384 rc = CFGMR3InsertString(pLunL1, "Driver", "MediaISO"); CHECK_RC();1385 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); CHECK_RC();1386 rc = CFGMR3InsertString(pCfg, "Path", cdromFile); CHECK_RC();1353 rc = CFGMR3InsertNode(pInst, "LUN#2", &pLunL0); UPDATE_RC(); 1354 rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); UPDATE_RC(); 1355 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1356 rc = CFGMR3InsertString(pCfg, "Type", "DVD"); UPDATE_RC(); 1357 rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); UPDATE_RC(); 1358 1359 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); UPDATE_RC(); 1360 rc = CFGMR3InsertString(pLunL1, "Driver", "MediaISO"); UPDATE_RC(); 1361 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); UPDATE_RC(); 1362 rc = CFGMR3InsertString(pCfg, "Path", g_pszCdromFile); UPDATE_RC(); 1387 1363 } 1388 1364 … … 1390 1366 * Network adapters 1391 1367 */ 1392 rc = CFGMR3InsertNode(pDevices, "pcnet", &pDev); CHECK_RC();1368 rc = CFGMR3InsertNode(pDevices, "pcnet", &pDev); UPDATE_RC(); 1393 1369 for (ULONG ulInstance = 0; ulInstance < NetworkAdapterCount; ulInstance++) 1394 1370 { … … 1397 1373 char szInstance[4]; 1398 1374 RTStrPrintf(szInstance, sizeof(szInstance), "%lu", ulInstance); 1399 rc = CFGMR3InsertNode(pDev, szInstance, &pInst); CHECK_RC();1400 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); CHECK_RC();1375 rc = CFGMR3InsertNode(pDev, szInstance, &pInst); UPDATE_RC(); 1376 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); UPDATE_RC(); 1401 1377 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 1402 !ulInstance ? 3 : ulInstance - 1 + 8); CHECK_RC();1403 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); CHECK_RC();1404 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1378 !ulInstance ? 3 : ulInstance - 1 + 8); UPDATE_RC(); 1379 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); UPDATE_RC(); 1380 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1405 1381 rc = CFGMR3InsertBytes(pCfg, "MAC", &g_aNetDevs[ulInstance].Mac, sizeof(PDMMAC)); 1406 CHECK_RC();1382 UPDATE_RC(); 1407 1383 1408 1384 /* … … 1412 1388 { 1413 1389 /* insert the sniffer filter driver. */ 1414 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1415 rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); CHECK_RC();1416 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1390 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1391 rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); UPDATE_RC(); 1392 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1417 1393 if (g_aNetDevs[ulInstance].pszSniff) 1418 1394 { 1419 rc = CFGMR3InsertString(pCfg, "File", g_aNetDevs[ulInstance].pszSniff); CHECK_RC(); 1395 rc = CFGMR3InsertString(pCfg, "File", g_aNetDevs[ulInstance].pszSniff); 1396 UPDATE_RC(); 1420 1397 } 1421 1398 } … … 1428 1405 if (g_aNetDevs[ulInstance].fSniff) 1429 1406 { 1430 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); CHECK_RC();1407 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); UPDATE_RC(); 1431 1408 } 1432 1409 else 1433 1410 { 1434 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1411 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1435 1412 } 1436 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1413 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1437 1414 } 1438 1415 … … 1442 1419 if (g_aNetDevs[ulInstance].enmType == BFENETDEV::NAT) 1443 1420 { 1444 rc = CFGMR3InsertString(pLunL0, "Driver", "NAT"); CHECK_RC();1445 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1421 rc = CFGMR3InsertString(pLunL0, "Driver", "NAT"); UPDATE_RC(); 1422 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1446 1423 /* (Port forwarding goes here.) */ 1447 1424 } 1448 1425 else if (g_aNetDevs[ulInstance].enmType == BFENETDEV::HIF) 1449 1426 { 1450 rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); CHECK_RC();1451 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1427 rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); UPDATE_RC(); 1428 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1452 1429 1453 1430 #if defined(__LINUX__) 1454 1431 if (g_aNetDevs[ulInstance].fHaveFd) 1455 1432 { 1456 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); CHECK_RC(); 1457 rc = CFGMR3InsertInteger(pCfg, "FileHandle", g_aNetDevs[ulInstance].fd); CHECK_RC(); 1433 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); 1434 UPDATE_RC(); 1435 rc = CFGMR3InsertInteger(pCfg, "FileHandle", g_aNetDevs[ulInstance].fd); 1436 UPDATE_RC(); 1458 1437 } 1459 1438 else … … 1508 1487 } 1509 1488 1510 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); CHECK_RC();1511 rc = CFGMR3InsertInteger(pCfg, "FileHandle", (RTFILE)tapFD); CHECK_RC();1489 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); UPDATE_RC(); 1490 rc = CFGMR3InsertInteger(pCfg, "FileHandle", (RTFILE)tapFD); UPDATE_RC(); 1512 1491 1513 1492 #elif defined(__WIN__) … … 1515 1494 * We need the GUID too here... 1516 1495 */ 1517 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); CHECK_RC();1518 rc = CFGMR3InsertString(pCfg, "HostInterfaceName", g_aNetDevs[ulInstance].pszName); CHECK_RC();1519 rc = CFGMR3InsertString(pCfg, "GUID", g_aNetDevs[ulInstance].pszName /*pszGUID*/); CHECK_RC();1496 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); UPDATE_RC(); 1497 rc = CFGMR3InsertString(pCfg, "HostInterfaceName", g_aNetDevs[ulInstance].pszName); UPDATE_RC(); 1498 rc = CFGMR3InsertString(pCfg, "GUID", g_aNetDevs[ulInstance].pszName /*pszGUID*/); UPDATE_RC(); 1520 1499 1521 1500 … … 1531 1510 * Internal networking. 1532 1511 */ 1533 rc = CFGMR3InsertString(pCfg, "Network", g_aNetDevs[ulInstance].pszName); CHECK_RC();1512 rc = CFGMR3InsertString(pCfg, "Network", g_aNetDevs[ulInstance].pszName); UPDATE_RC(); 1534 1513 } 1535 1514 } … … 1539 1518 * VMM Device 1540 1519 */ 1541 rc = CFGMR3InsertNode(pDevices, "VMMDev", &pDev); CHECK_RC();1542 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1543 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1544 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1545 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 4); CHECK_RC();1546 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); CHECK_RC();1520 rc = CFGMR3InsertNode(pDevices, "VMMDev", &pDev); UPDATE_RC(); 1521 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1522 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1523 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1524 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 4); UPDATE_RC(); 1525 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); UPDATE_RC(); 1547 1526 1548 1527 /* the VMM device's Main driver */ 1549 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1550 rc = CFGMR3InsertString(pLunL0, "Driver", "MainVMMDev"); CHECK_RC();1551 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1552 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)gVMMDev); CHECK_RC();1528 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1529 rc = CFGMR3InsertString(pLunL0, "Driver", "MainVMMDev"); UPDATE_RC(); 1530 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1531 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)gVMMDev); UPDATE_RC(); 1553 1532 1554 1533 /* … … 1559 1538 rc = CFGMR3InsertNode(pDevices, "ichac97", &pDev); 1560 1539 rc = CFGMR3InsertNode(pDev, "0", &pInst); 1561 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1562 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 5); CHECK_RC();1563 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); CHECK_RC();1540 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1541 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 5); UPDATE_RC(); 1542 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); UPDATE_RC(); 1564 1543 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); 1565 1544 1566 1545 /* the Audio driver */ 1567 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1568 rc = CFGMR3InsertString(pLunL0, "Driver", "AUDIO"); CHECK_RC();1569 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1546 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1547 rc = CFGMR3InsertString(pLunL0, "Driver", "AUDIO"); UPDATE_RC(); 1548 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1570 1549 #ifdef __WIN__ 1571 rc = CFGMR3InsertString(pCfg, "AudioDriver", "winmm"); CHECK_RC();1550 rc = CFGMR3InsertString(pCfg, "AudioDriver", "winmm"); UPDATE_RC(); 1572 1551 #elif defined(__DARWIN__) 1573 rc = CFGMR3InsertString(pCfg, "AudioDriver", "coreaudio"); CHECK_RC();1552 rc = CFGMR3InsertString(pCfg, "AudioDriver", "coreaudio"); UPDATE_RC(); 1574 1553 #elif defined(__LINUX__) 1575 rc = CFGMR3InsertString(pCfg, "AudioDriver", "oss"); CHECK_RC();1554 rc = CFGMR3InsertString(pCfg, "AudioDriver", "oss"); UPDATE_RC(); 1576 1555 #else /* portme */ 1577 rc = CFGMR3InsertString(pCfg, "AudioDriver", "none"); CHECK_RC();1556 rc = CFGMR3InsertString(pCfg, "AudioDriver", "none"); UPDATE_RC(); 1578 1557 #endif /* !__WIN__ */ 1579 1558 } … … 1585 1564 if (g_fUSB) 1586 1565 { 1587 rc = CFGMR3InsertNode(pDevices, "usb-ohci", &pDev); CHECK_RC();1588 rc = CFGMR3InsertNode(pDev, "0", &pInst); CHECK_RC();1589 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); CHECK_RC();1590 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ CHECK_RC();1591 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 6); CHECK_RC();1592 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); CHECK_RC();1593 1594 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); CHECK_RC();1595 rc = CFGMR3InsertString(pLunL0, "Driver", "VUSBRootHub"); CHECK_RC();1596 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); CHECK_RC();1566 rc = CFGMR3InsertNode(pDevices, "usb-ohci", &pDev); UPDATE_RC(); 1567 rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC(); 1568 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC(); 1569 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ UPDATE_RC(); 1570 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 6); UPDATE_RC(); 1571 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); UPDATE_RC(); 1572 1573 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC(); 1574 rc = CFGMR3InsertString(pLunL0, "Driver", "VUSBRootHub"); UPDATE_RC(); 1575 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC(); 1597 1576 } 1598 1577 #endif /* VBOXBFE_WITH_USB */ 1599 1578 1600 #undef UPDATE RC1601 #undef CHECK_RC1579 #undef UPDATE_RC 1580 #undef UPDATE_RC 1602 1581 1603 1582 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.