Changeset 101464 in vbox
- Timestamp:
- Oct 17, 2023 9:37:49 AM (15 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r101462 r101464 840 840 int i_configVmmDev(ComPtr<IMachine> pMachine, BusAssignmentManager *pBusMgr, PCFGMNODE pDevices); 841 841 int i_configPdm(ComPtr<IMachine> pMachine, PCVMMR3VTABLE pVMM, PUVM pUVM, PCFGMNODE pRoot); 842 int i_configUsb(ComPtr<IMachine> pMachine, BusAssignmentManager *pBusMgr, PCFGMNODE pRoot, PCFGMNODE pDevices, 843 KeyboardHIDType_T enmKbdHid, PointingHIDType_T enmPointingHid, PCFGMNODE *ppUsbDevices); 844 int i_configGuestDbg(ComPtr<IVirtualBox> pVBox, ComPtr<IMachine> pMachine, PCFGMNODE pRoot); 842 845 843 846 static DECLCALLBACK(void) i_vmstateChangeCallback(PUVM pUVM, PCVMMR3VTABLE pVMM, VMSTATE enmState, -
trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp
r101462 r101464 4057 4057 } 4058 4058 4059 4060 int Console::i_configUsb(ComPtr<IMachine> pMachine, BusAssignmentManager *pBusMgr, PCFGMNODE pRoot, PCFGMNODE pDevices, 4061 KeyboardHIDType_T enmKbdHid, PointingHIDType_T enmPointingHid, PCFGMNODE *ppUsbDevices) 4062 { 4063 int vrc = VINF_SUCCESS; 4064 PCFGMNODE pDev = NULL; /* /Devices/Dev/ */ 4065 PCFGMNODE pInst = NULL; /* /Devices/Dev/0/ */ 4066 PCFGMNODE pCfg = NULL; /* /Devices/Dev/.../Config/ */ 4067 PCFGMNODE pLunL0 = NULL; /* /Devices/Dev/0/LUN#0/ */ 4068 PCFGMNODE pLunL1 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/ */ 4069 4070 com::SafeIfaceArray<IUSBController> usbCtrls; 4071 HRESULT hrc = pMachine->COMGETTER(USBControllers)(ComSafeArrayAsOutParam(usbCtrls)); 4072 bool fOhciPresent = false; /**< Flag whether at least one OHCI controller is present. */ 4073 bool fXhciPresent = false; /**< Flag whether at least one XHCI controller is present. */ 4074 4075 if (SUCCEEDED(hrc)) 4076 { 4077 for (size_t i = 0; i < usbCtrls.size(); ++i) 4078 { 4079 USBControllerType_T enmCtrlType; 4080 vrc = usbCtrls[i]->COMGETTER(Type)(&enmCtrlType); H(); 4081 if (enmCtrlType == USBControllerType_OHCI) 4082 { 4083 fOhciPresent = true; 4084 break; 4085 } 4086 else if (enmCtrlType == USBControllerType_XHCI) 4087 { 4088 fXhciPresent = true; 4089 break; 4090 } 4091 } 4092 } 4093 else if (hrc != E_NOTIMPL) 4094 { 4095 H(); 4096 } 4097 4098 /* 4099 * Currently EHCI is only enabled when an OHCI or XHCI controller is present as well. 4100 */ 4101 if (fOhciPresent || fXhciPresent) 4102 mfVMHasUsbController = true; 4103 4104 if (mfVMHasUsbController) 4105 { 4106 for (size_t i = 0; i < usbCtrls.size(); ++i) 4107 { 4108 USBControllerType_T enmCtrlType; 4109 vrc = usbCtrls[i]->COMGETTER(Type)(&enmCtrlType); H(); 4110 4111 if (enmCtrlType == USBControllerType_OHCI) 4112 { 4113 InsertConfigNode(pDevices, "usb-ohci", &pDev); 4114 InsertConfigNode(pDev, "0", &pInst); 4115 InsertConfigNode(pInst, "Config", &pCfg); 4116 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 4117 hrc = pBusMgr->assignPCIDevice("usb-ohci", pInst); H(); 4118 InsertConfigNode(pInst, "LUN#0", &pLunL0); 4119 InsertConfigString(pLunL0, "Driver", "VUSBRootHub"); 4120 InsertConfigNode(pLunL0, "Config", &pCfg); 4121 4122 /* 4123 * Attach the status driver. 4124 */ 4125 i_attachStatusDriver(pInst, DeviceType_USB); 4126 } 4127 #ifdef VBOX_WITH_EHCI 4128 else if (enmCtrlType == USBControllerType_EHCI) 4129 { 4130 InsertConfigNode(pDevices, "usb-ehci", &pDev); 4131 InsertConfigNode(pDev, "0", &pInst); 4132 InsertConfigNode(pInst, "Config", &pCfg); 4133 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 4134 hrc = pBusMgr->assignPCIDevice("usb-ehci", pInst); H(); 4135 4136 InsertConfigNode(pInst, "LUN#0", &pLunL0); 4137 InsertConfigString(pLunL0, "Driver", "VUSBRootHub"); 4138 InsertConfigNode(pLunL0, "Config", &pCfg); 4139 4140 /* 4141 * Attach the status driver. 4142 */ 4143 i_attachStatusDriver(pInst, DeviceType_USB); 4144 } 4145 #endif 4146 else if (enmCtrlType == USBControllerType_XHCI) 4147 { 4148 InsertConfigNode(pDevices, "usb-xhci", &pDev); 4149 InsertConfigNode(pDev, "0", &pInst); 4150 InsertConfigNode(pInst, "Config", &pCfg); 4151 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 4152 hrc = pBusMgr->assignPCIDevice("usb-xhci", pInst); H(); 4153 4154 InsertConfigNode(pInst, "LUN#0", &pLunL0); 4155 InsertConfigString(pLunL0, "Driver", "VUSBRootHub"); 4156 InsertConfigNode(pLunL0, "Config", &pCfg); 4157 4158 InsertConfigNode(pInst, "LUN#1", &pLunL1); 4159 InsertConfigString(pLunL1, "Driver", "VUSBRootHub"); 4160 InsertConfigNode(pLunL1, "Config", &pCfg); 4161 4162 /* 4163 * Attach the status driver. 4164 */ 4165 i_attachStatusDriver(pInst, DeviceType_USB, 2); 4166 } 4167 } /* for every USB controller. */ 4168 4169 4170 /* 4171 * Virtual USB Devices. 4172 */ 4173 PCFGMNODE pUsbDevices = NULL; 4174 InsertConfigNode(pRoot, "USB", &pUsbDevices); 4175 *ppUsbDevices = pUsbDevices; 4176 4177 #ifdef VBOX_WITH_USB 4178 { 4179 /* 4180 * Global USB options, currently unused as we'll apply the 2.0 -> 1.1 morphing 4181 * on a per device level now. 4182 */ 4183 InsertConfigNode(pUsbDevices, "USBProxy", &pCfg); 4184 InsertConfigNode(pCfg, "GlobalConfig", &pCfg); 4185 // This globally enables the 2.0 -> 1.1 device morphing of proxied devices to keep windows quiet. 4186 //InsertConfigInteger(pCfg, "Force11Device", true); 4187 // The following breaks stuff, but it makes MSDs work in vista. (I include it here so 4188 // that it's documented somewhere.) Users needing it can use: 4189 // VBoxManage setextradata "myvm" "VBoxInternal/USB/USBProxy/GlobalConfig/Force11PacketSize" 1 4190 //InsertConfigInteger(pCfg, "Force11PacketSize", true); 4191 } 4192 #endif 4193 4194 #ifdef VBOX_WITH_USB_CARDREADER 4195 BOOL aEmulatedUSBCardReaderEnabled = FALSE; 4196 hrc = pMachine->COMGETTER(EmulatedUSBCardReaderEnabled)(&aEmulatedUSBCardReaderEnabled); H(); 4197 if (aEmulatedUSBCardReaderEnabled) 4198 { 4199 InsertConfigNode(pUsbDevices, "CardReader", &pDev); 4200 InsertConfigNode(pDev, "0", &pInst); 4201 InsertConfigNode(pInst, "Config", &pCfg); 4202 4203 InsertConfigNode(pInst, "LUN#0", &pLunL0); 4204 # ifdef VBOX_WITH_USB_CARDREADER_TEST 4205 InsertConfigString(pLunL0, "Driver", "DrvDirectCardReader"); 4206 InsertConfigNode(pLunL0, "Config", &pCfg); 4207 # else 4208 InsertConfigString(pLunL0, "Driver", "UsbCardReader"); 4209 InsertConfigNode(pLunL0, "Config", &pCfg); 4210 # endif 4211 } 4212 #endif 4213 4214 /* Virtual USB Mouse/Tablet */ 4215 if ( enmPointingHid == PointingHIDType_USBMouse 4216 || enmPointingHid == PointingHIDType_USBTablet 4217 || enmPointingHid == PointingHIDType_USBMultiTouch 4218 || enmPointingHid == PointingHIDType_USBMultiTouchScreenPlusPad) 4219 { 4220 InsertConfigNode(pUsbDevices, "HidMouse", &pDev); 4221 InsertConfigNode(pDev, "0", &pInst); 4222 InsertConfigNode(pInst, "Config", &pCfg); 4223 4224 if (enmPointingHid == PointingHIDType_USBMouse) 4225 InsertConfigString(pCfg, "Mode", "relative"); 4226 else 4227 InsertConfigString(pCfg, "Mode", "absolute"); 4228 InsertConfigNode(pInst, "LUN#0", &pLunL0); 4229 InsertConfigString(pLunL0, "Driver", "MouseQueue"); 4230 InsertConfigNode(pLunL0, "Config", &pCfg); 4231 InsertConfigInteger(pCfg, "QueueSize", 128); 4232 4233 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 4234 InsertConfigString(pLunL1, "Driver", "MainMouse"); 4235 } 4236 if ( enmPointingHid == PointingHIDType_USBMultiTouch 4237 || enmPointingHid == PointingHIDType_USBMultiTouchScreenPlusPad) 4238 { 4239 InsertConfigNode(pDev, "1", &pInst); 4240 InsertConfigNode(pInst, "Config", &pCfg); 4241 4242 InsertConfigString(pCfg, "Mode", "multitouch"); 4243 InsertConfigNode(pInst, "LUN#0", &pLunL0); 4244 InsertConfigString(pLunL0, "Driver", "MouseQueue"); 4245 InsertConfigNode(pLunL0, "Config", &pCfg); 4246 InsertConfigInteger(pCfg, "QueueSize", 128); 4247 4248 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 4249 InsertConfigString(pLunL1, "Driver", "MainMouse"); 4250 } 4251 if (enmPointingHid == PointingHIDType_USBMultiTouchScreenPlusPad) 4252 { 4253 InsertConfigNode(pDev, "2", &pInst); 4254 InsertConfigNode(pInst, "Config", &pCfg); 4255 4256 InsertConfigString(pCfg, "Mode", "touchpad"); 4257 InsertConfigNode(pInst, "LUN#0", &pLunL0); 4258 InsertConfigString(pLunL0, "Driver", "MouseQueue"); 4259 InsertConfigNode(pLunL0, "Config", &pCfg); 4260 InsertConfigInteger(pCfg, "QueueSize", 128); 4261 4262 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 4263 InsertConfigString(pLunL1, "Driver", "MainMouse"); 4264 } 4265 4266 /* Virtual USB Keyboard */ 4267 if (enmKbdHid == KeyboardHIDType_USBKeyboard) 4268 { 4269 InsertConfigNode(pUsbDevices, "HidKeyboard", &pDev); 4270 InsertConfigNode(pDev, "0", &pInst); 4271 InsertConfigNode(pInst, "Config", &pCfg); 4272 4273 InsertConfigNode(pInst, "LUN#0", &pLunL0); 4274 InsertConfigString(pLunL0, "Driver", "KeyboardQueue"); 4275 InsertConfigNode(pLunL0, "Config", &pCfg); 4276 InsertConfigInteger(pCfg, "QueueSize", 64); 4277 4278 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 4279 InsertConfigString(pLunL1, "Driver", "MainKeyboard"); 4280 } 4281 } 4282 4283 return VINF_SUCCESS; 4284 } 4285 4286 4287 int Console::i_configGuestDbg(ComPtr<IVirtualBox> pVBox, ComPtr<IMachine> pMachine, PCFGMNODE pRoot) 4288 { 4289 PCFGMNODE pDbgf; 4290 InsertConfigNode(pRoot, "DBGF", &pDbgf); 4291 4292 /* Paths to search for debug info and such things. */ 4293 Bstr bstr; 4294 HRESULT hrc = pMachine->COMGETTER(SettingsFilePath)(bstr.asOutParam()); H(); 4295 Utf8Str strSettingsPath(bstr); 4296 bstr.setNull(); 4297 strSettingsPath.stripFilename(); 4298 strSettingsPath.append("/"); 4299 4300 char szHomeDir[RTPATH_MAX + 1]; 4301 int vrc2 = RTPathUserHome(szHomeDir, sizeof(szHomeDir) - 1); 4302 if (RT_FAILURE(vrc2)) 4303 szHomeDir[0] = '\0'; 4304 RTPathEnsureTrailingSeparator(szHomeDir, sizeof(szHomeDir)); 4305 4306 4307 Utf8Str strPath; 4308 strPath.append(strSettingsPath).append("debug/;"); 4309 strPath.append(strSettingsPath).append(";"); 4310 strPath.append("cache*").append(strSettingsPath).append("dbgcache/;"); /* handy for symlinking to actual cache */ 4311 strPath.append(szHomeDir); 4312 4313 InsertConfigString(pDbgf, "Path", strPath.c_str()); 4314 4315 /* Tracing configuration. */ 4316 BOOL fTracingEnabled; 4317 hrc = pMachine->COMGETTER(TracingEnabled)(&fTracingEnabled); H(); 4318 if (fTracingEnabled) 4319 InsertConfigInteger(pDbgf, "TracingEnabled", 1); 4320 4321 hrc = pMachine->COMGETTER(TracingConfig)(bstr.asOutParam()); H(); 4322 if (fTracingEnabled) 4323 InsertConfigString(pDbgf, "TracingConfig", bstr); 4324 4325 /* Debugger console config. */ 4326 PCFGMNODE pDbgc; 4327 InsertConfigNode(pRoot, "DBGC", &pDbgc); 4328 4329 hrc = pVBox->COMGETTER(HomeFolder)(bstr.asOutParam()); H(); 4330 Utf8Str strVBoxHome = bstr; 4331 bstr.setNull(); 4332 if (strVBoxHome.isNotEmpty()) 4333 strVBoxHome.append("/"); 4334 else 4335 { 4336 strVBoxHome = szHomeDir; 4337 strVBoxHome.append("/.vbox"); 4338 } 4339 4340 Utf8Str strFile(strVBoxHome); 4341 strFile.append("dbgc-history"); 4342 InsertConfigString(pDbgc, "HistoryFile", strFile); 4343 4344 strFile = strSettingsPath; 4345 strFile.append("dbgc-init"); 4346 InsertConfigString(pDbgc, "LocalInitScript", strFile); 4347 4348 strFile = strVBoxHome; 4349 strFile.append("dbgc-init"); 4350 InsertConfigString(pDbgc, "GlobalInitScript", strFile); 4351 4352 /* 4353 * Configure guest debug settings. 4354 */ 4355 ComObjPtr<IGuestDebugControl> ptrGstDbgCtrl; 4356 GuestDebugProvider_T enmGstDbgProvider = GuestDebugProvider_None; 4357 4358 hrc = pMachine->COMGETTER(GuestDebugControl)(ptrGstDbgCtrl.asOutParam()); H(); 4359 hrc = ptrGstDbgCtrl->COMGETTER(DebugProvider)(&enmGstDbgProvider); H(); 4360 if (enmGstDbgProvider != GuestDebugProvider_None) 4361 { 4362 GuestDebugIoProvider_T enmGstDbgIoProvider = GuestDebugIoProvider_None; 4363 hrc = ptrGstDbgCtrl->COMGETTER(DebugIoProvider)(&enmGstDbgIoProvider); H(); 4364 hrc = ptrGstDbgCtrl->COMGETTER(DebugAddress)(bstr.asOutParam()); H(); 4365 Utf8Str strAddress = bstr; 4366 bstr.setNull(); 4367 4368 ULONG ulPort = 0; 4369 hrc = ptrGstDbgCtrl->COMGETTER(DebugPort)(&ulPort); H(); 4370 4371 PCFGMNODE pDbgSettings; 4372 InsertConfigNode(pDbgc, "Dbg", &pDbgSettings); 4373 InsertConfigString(pDbgSettings, "Address", strAddress); 4374 InsertConfigInteger(pDbgSettings, "Port", ulPort); 4375 4376 switch (enmGstDbgProvider) 4377 { 4378 case GuestDebugProvider_Native: 4379 InsertConfigString(pDbgSettings, "StubType", "Native"); 4380 break; 4381 case GuestDebugProvider_GDB: 4382 InsertConfigString(pDbgSettings, "StubType", "Gdb"); 4383 break; 4384 case GuestDebugProvider_KD: 4385 InsertConfigString(pDbgSettings, "StubType", "Kd"); 4386 break; 4387 default: 4388 AssertFailed(); 4389 break; 4390 } 4391 4392 switch (enmGstDbgIoProvider) 4393 { 4394 case GuestDebugIoProvider_TCP: 4395 InsertConfigString(pDbgSettings, "Provider", "tcp"); 4396 break; 4397 case GuestDebugIoProvider_UDP: 4398 InsertConfigString(pDbgSettings, "Provider", "udp"); 4399 break; 4400 case GuestDebugIoProvider_IPC: 4401 InsertConfigString(pDbgSettings, "Provider", "ipc"); 4402 break; 4403 default: 4404 AssertFailed(); 4405 break; 4406 } 4407 } 4408 4409 return VINF_SUCCESS; 4410 } 4411 4412 4059 4413 #undef H 4060 4414 #undef VRC -
trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp
r101462 r101464 1689 1689 * The USB Controllers. 1690 1690 */ 1691 com::SafeIfaceArray<IUSBController> usbCtrls; 1692 hrc = pMachine->COMGETTER(USBControllers)(ComSafeArrayAsOutParam(usbCtrls)); 1693 bool fOhciPresent = false; /**< Flag whether at least one OHCI controller is present. */ 1694 bool fXhciPresent = false; /**< Flag whether at least one XHCI controller is present. */ 1695 1696 if (SUCCEEDED(hrc)) 1697 { 1698 for (size_t i = 0; i < usbCtrls.size(); ++i) 1699 { 1700 USBControllerType_T enmCtrlType; 1701 vrc = usbCtrls[i]->COMGETTER(Type)(&enmCtrlType); H(); 1702 if (enmCtrlType == USBControllerType_OHCI) 1703 { 1704 fOhciPresent = true; 1705 break; 1706 } 1707 else if (enmCtrlType == USBControllerType_XHCI) 1708 { 1709 fXhciPresent = true; 1710 break; 1711 } 1712 } 1713 } 1714 else if (hrc != E_NOTIMPL) 1715 { 1716 H(); 1717 } 1718 1719 /* 1720 * Currently EHCI is only enabled when an OHCI or XHCI controller is present as well. 1721 */ 1722 if (fOhciPresent || fXhciPresent) 1723 mfVMHasUsbController = true; 1724 1725 PCFGMNODE pUsbDevices = NULL; /**< Required for USB storage controller later. */ 1726 if (mfVMHasUsbController) 1727 { 1728 for (size_t i = 0; i < usbCtrls.size(); ++i) 1729 { 1730 USBControllerType_T enmCtrlType; 1731 vrc = usbCtrls[i]->COMGETTER(Type)(&enmCtrlType); H(); 1732 1733 if (enmCtrlType == USBControllerType_OHCI) 1734 { 1735 InsertConfigNode(pDevices, "usb-ohci", &pDev); 1736 InsertConfigNode(pDev, "0", &pInst); 1737 InsertConfigNode(pInst, "Config", &pCfg); 1738 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1739 hrc = pBusMgr->assignPCIDevice("usb-ohci", pInst); H(); 1740 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1741 InsertConfigString(pLunL0, "Driver", "VUSBRootHub"); 1742 InsertConfigNode(pLunL0, "Config", &pCfg); 1743 1744 /* 1745 * Attach the status driver. 1746 */ 1747 i_attachStatusDriver(pInst, DeviceType_USB); 1748 } 1749 #ifdef VBOX_WITH_EHCI 1750 else if (enmCtrlType == USBControllerType_EHCI) 1751 { 1752 InsertConfigNode(pDevices, "usb-ehci", &pDev); 1753 InsertConfigNode(pDev, "0", &pInst); 1754 InsertConfigNode(pInst, "Config", &pCfg); 1755 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1756 hrc = pBusMgr->assignPCIDevice("usb-ehci", pInst); H(); 1757 1758 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1759 InsertConfigString(pLunL0, "Driver", "VUSBRootHub"); 1760 InsertConfigNode(pLunL0, "Config", &pCfg); 1761 1762 /* 1763 * Attach the status driver. 1764 */ 1765 i_attachStatusDriver(pInst, DeviceType_USB); 1766 } 1767 #endif 1768 else if (enmCtrlType == USBControllerType_XHCI) 1769 { 1770 InsertConfigNode(pDevices, "usb-xhci", &pDev); 1771 InsertConfigNode(pDev, "0", &pInst); 1772 InsertConfigNode(pInst, "Config", &pCfg); 1773 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1774 hrc = pBusMgr->assignPCIDevice("usb-xhci", pInst); H(); 1775 1776 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1777 InsertConfigString(pLunL0, "Driver", "VUSBRootHub"); 1778 InsertConfigNode(pLunL0, "Config", &pCfg); 1779 1780 InsertConfigNode(pInst, "LUN#1", &pLunL1); 1781 InsertConfigString(pLunL1, "Driver", "VUSBRootHub"); 1782 InsertConfigNode(pLunL1, "Config", &pCfg); 1783 1784 /* 1785 * Attach the status driver. 1786 */ 1787 i_attachStatusDriver(pInst, DeviceType_USB, 2); 1788 } 1789 } /* for every USB controller. */ 1790 1791 1792 /* 1793 * Virtual USB Devices. 1794 */ 1795 InsertConfigNode(pRoot, "USB", &pUsbDevices); 1796 1797 #ifdef VBOX_WITH_USB 1798 { 1799 /* 1800 * Global USB options, currently unused as we'll apply the 2.0 -> 1.1 morphing 1801 * on a per device level now. 1802 */ 1803 InsertConfigNode(pUsbDevices, "USBProxy", &pCfg); 1804 InsertConfigNode(pCfg, "GlobalConfig", &pCfg); 1805 // This globally enables the 2.0 -> 1.1 device morphing of proxied devices to keep windows quiet. 1806 //InsertConfigInteger(pCfg, "Force11Device", true); 1807 // The following breaks stuff, but it makes MSDs work in vista. (I include it here so 1808 // that it's documented somewhere.) Users needing it can use: 1809 // VBoxManage setextradata "myvm" "VBoxInternal/USB/USBProxy/GlobalConfig/Force11PacketSize" 1 1810 //InsertConfigInteger(pCfg, "Force11PacketSize", true); 1811 } 1812 #endif 1813 1814 #ifdef VBOX_WITH_USB_CARDREADER 1815 BOOL aEmulatedUSBCardReaderEnabled = FALSE; 1816 hrc = pMachine->COMGETTER(EmulatedUSBCardReaderEnabled)(&aEmulatedUSBCardReaderEnabled); H(); 1817 if (aEmulatedUSBCardReaderEnabled) 1818 { 1819 InsertConfigNode(pUsbDevices, "CardReader", &pDev); 1820 InsertConfigNode(pDev, "0", &pInst); 1821 InsertConfigNode(pInst, "Config", &pCfg); 1822 1823 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1824 # ifdef VBOX_WITH_USB_CARDREADER_TEST 1825 InsertConfigString(pLunL0, "Driver", "DrvDirectCardReader"); 1826 InsertConfigNode(pLunL0, "Config", &pCfg); 1827 # else 1828 InsertConfigString(pLunL0, "Driver", "UsbCardReader"); 1829 InsertConfigNode(pLunL0, "Config", &pCfg); 1830 # endif 1831 } 1832 #endif 1833 1834 /* Virtual USB Mouse/Tablet */ 1835 if ( aPointingHID == PointingHIDType_USBMouse 1836 || aPointingHID == PointingHIDType_USBTablet 1837 || aPointingHID == PointingHIDType_USBMultiTouch 1838 || aPointingHID == PointingHIDType_USBMultiTouchScreenPlusPad) 1839 { 1840 InsertConfigNode(pUsbDevices, "HidMouse", &pDev); 1841 InsertConfigNode(pDev, "0", &pInst); 1842 InsertConfigNode(pInst, "Config", &pCfg); 1843 1844 if (aPointingHID == PointingHIDType_USBMouse) 1845 InsertConfigString(pCfg, "Mode", "relative"); 1846 else 1847 InsertConfigString(pCfg, "Mode", "absolute"); 1848 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1849 InsertConfigString(pLunL0, "Driver", "MouseQueue"); 1850 InsertConfigNode(pLunL0, "Config", &pCfg); 1851 InsertConfigInteger(pCfg, "QueueSize", 128); 1852 1853 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 1854 InsertConfigString(pLunL1, "Driver", "MainMouse"); 1855 } 1856 if ( aPointingHID == PointingHIDType_USBMultiTouch 1857 || aPointingHID == PointingHIDType_USBMultiTouchScreenPlusPad) 1858 { 1859 InsertConfigNode(pDev, "1", &pInst); 1860 InsertConfigNode(pInst, "Config", &pCfg); 1861 1862 InsertConfigString(pCfg, "Mode", "multitouch"); 1863 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1864 InsertConfigString(pLunL0, "Driver", "MouseQueue"); 1865 InsertConfigNode(pLunL0, "Config", &pCfg); 1866 InsertConfigInteger(pCfg, "QueueSize", 128); 1867 1868 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 1869 InsertConfigString(pLunL1, "Driver", "MainMouse"); 1870 } 1871 if (aPointingHID == PointingHIDType_USBMultiTouchScreenPlusPad) 1872 { 1873 InsertConfigNode(pDev, "2", &pInst); 1874 InsertConfigNode(pInst, "Config", &pCfg); 1875 1876 InsertConfigString(pCfg, "Mode", "touchpad"); 1877 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1878 InsertConfigString(pLunL0, "Driver", "MouseQueue"); 1879 InsertConfigNode(pLunL0, "Config", &pCfg); 1880 InsertConfigInteger(pCfg, "QueueSize", 128); 1881 1882 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 1883 InsertConfigString(pLunL1, "Driver", "MainMouse"); 1884 } 1885 1886 /* Virtual USB Keyboard */ 1887 if (aKbdHID == KeyboardHIDType_USBKeyboard) 1888 { 1889 InsertConfigNode(pUsbDevices, "HidKeyboard", &pDev); 1890 InsertConfigNode(pDev, "0", &pInst); 1891 InsertConfigNode(pInst, "Config", &pCfg); 1892 1893 InsertConfigNode(pInst, "LUN#0", &pLunL0); 1894 InsertConfigString(pLunL0, "Driver", "KeyboardQueue"); 1895 InsertConfigNode(pLunL0, "Config", &pCfg); 1896 InsertConfigInteger(pCfg, "QueueSize", 64); 1897 1898 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 1899 InsertConfigString(pLunL1, "Driver", "MainKeyboard"); 1900 } 1901 } 1691 PCFGMNODE pUsbDevices = NULL; 1692 vrc = i_configUsb(pMachine, pBusMgr, pRoot, pDevices, aKbdHID, aPointingHID, &pUsbDevices); 1902 1693 1903 1694 /* … … 2824 2615 * Configure DBGF (Debug(ger) Facility) and DBGC (Debugger Console). 2825 2616 */ 2826 { 2827 PCFGMNODE pDbgf; 2828 InsertConfigNode(pRoot, "DBGF", &pDbgf); 2829 2830 /* Paths to search for debug info and such things. */ 2831 hrc = pMachine->COMGETTER(SettingsFilePath)(bstr.asOutParam()); H(); 2832 Utf8Str strSettingsPath(bstr); 2833 bstr.setNull(); 2834 strSettingsPath.stripFilename(); 2835 strSettingsPath.append("/"); 2836 2837 char szHomeDir[RTPATH_MAX + 1]; 2838 int vrc2 = RTPathUserHome(szHomeDir, sizeof(szHomeDir) - 1); 2839 if (RT_FAILURE(vrc2)) 2840 szHomeDir[0] = '\0'; 2841 RTPathEnsureTrailingSeparator(szHomeDir, sizeof(szHomeDir)); 2842 2843 2844 Utf8Str strPath; 2845 strPath.append(strSettingsPath).append("debug/;"); 2846 strPath.append(strSettingsPath).append(";"); 2847 strPath.append("cache*").append(strSettingsPath).append("dbgcache/;"); /* handy for symlinking to actual cache */ 2848 strPath.append(szHomeDir); 2849 2850 InsertConfigString(pDbgf, "Path", strPath.c_str()); 2851 2852 /* Tracing configuration. */ 2853 BOOL fTracingEnabled; 2854 hrc = pMachine->COMGETTER(TracingEnabled)(&fTracingEnabled); H(); 2855 if (fTracingEnabled) 2856 InsertConfigInteger(pDbgf, "TracingEnabled", 1); 2857 2858 hrc = pMachine->COMGETTER(TracingConfig)(bstr.asOutParam()); H(); 2859 if (fTracingEnabled) 2860 InsertConfigString(pDbgf, "TracingConfig", bstr); 2861 2862 /* Debugger console config. */ 2863 PCFGMNODE pDbgc; 2864 InsertConfigNode(pRoot, "DBGC", &pDbgc); 2865 2866 hrc = virtualBox->COMGETTER(HomeFolder)(bstr.asOutParam()); H(); 2867 Utf8Str strVBoxHome = bstr; 2868 bstr.setNull(); 2869 if (strVBoxHome.isNotEmpty()) 2870 strVBoxHome.append("/"); 2871 else 2872 { 2873 strVBoxHome = szHomeDir; 2874 strVBoxHome.append("/.vbox"); 2875 } 2876 2877 Utf8Str strFile(strVBoxHome); 2878 strFile.append("dbgc-history"); 2879 InsertConfigString(pDbgc, "HistoryFile", strFile); 2880 2881 strFile = strSettingsPath; 2882 strFile.append("dbgc-init"); 2883 InsertConfigString(pDbgc, "LocalInitScript", strFile); 2884 2885 strFile = strVBoxHome; 2886 strFile.append("dbgc-init"); 2887 InsertConfigString(pDbgc, "GlobalInitScript", strFile); 2888 2889 /* 2890 * Configure guest debug settings. 2891 */ 2892 ComObjPtr<IGuestDebugControl> ptrGstDbgCtrl; 2893 GuestDebugProvider_T enmGstDbgProvider = GuestDebugProvider_None; 2894 2895 hrc = pMachine->COMGETTER(GuestDebugControl)(ptrGstDbgCtrl.asOutParam()); H(); 2896 hrc = ptrGstDbgCtrl->COMGETTER(DebugProvider)(&enmGstDbgProvider); H(); 2897 if (enmGstDbgProvider != GuestDebugProvider_None) 2898 { 2899 GuestDebugIoProvider_T enmGstDbgIoProvider = GuestDebugIoProvider_None; 2900 hrc = ptrGstDbgCtrl->COMGETTER(DebugIoProvider)(&enmGstDbgIoProvider); H(); 2901 hrc = ptrGstDbgCtrl->COMGETTER(DebugAddress)(bstr.asOutParam()); H(); 2902 Utf8Str strAddress = bstr; 2903 bstr.setNull(); 2904 2905 ULONG ulPort = 0; 2906 hrc = ptrGstDbgCtrl->COMGETTER(DebugPort)(&ulPort); H(); 2907 2908 PCFGMNODE pDbgSettings; 2909 InsertConfigNode(pDbgc, "Dbg", &pDbgSettings); 2910 InsertConfigString(pDbgSettings, "Address", strAddress); 2911 InsertConfigInteger(pDbgSettings, "Port", ulPort); 2912 2913 switch (enmGstDbgProvider) 2914 { 2915 case GuestDebugProvider_Native: 2916 InsertConfigString(pDbgSettings, "StubType", "Native"); 2917 break; 2918 case GuestDebugProvider_GDB: 2919 InsertConfigString(pDbgSettings, "StubType", "Gdb"); 2920 break; 2921 case GuestDebugProvider_KD: 2922 InsertConfigString(pDbgSettings, "StubType", "Kd"); 2923 break; 2924 default: 2925 AssertFailed(); 2926 break; 2927 } 2928 2929 switch (enmGstDbgIoProvider) 2930 { 2931 case GuestDebugIoProvider_TCP: 2932 InsertConfigString(pDbgSettings, "Provider", "tcp"); 2933 break; 2934 case GuestDebugIoProvider_UDP: 2935 InsertConfigString(pDbgSettings, "Provider", "udp"); 2936 break; 2937 case GuestDebugIoProvider_IPC: 2938 InsertConfigString(pDbgSettings, "Provider", "ipc"); 2939 break; 2940 default: 2941 AssertFailed(); 2942 break; 2943 } 2944 } 2945 } 2617 vrc = i_configGuestDbg(virtualBox, pMachine, pRoot); VRC(); 2946 2618 } 2947 2619 catch (ConfigError &x)
Note:
See TracChangeset
for help on using the changeset viewer.