Changeset 36994 in vbox
- Timestamp:
- May 6, 2011 10:20:05 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp
r36993 r36994 1499 1499 PUSBDEVICE pDevices; 1500 1500 1501 fOK = true; 1501 1502 pDevices = getDevicesFromUsbfs(pcszRoot, true); 1502 1503 if (pDevices) 1503 1504 { 1504 1505 PUSBDEVICE pDevice; 1505 1506 fOK = true; 1506 1507 1507 for (pDevice = pDevices; pDevice && fOK; pDevice = pDevice->pNext) 1508 1508 if (access(pDevice->pszAddress, R_OK | W_OK)) -
trunk/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp
r36993 r36994 115 115 * In the event of both failing, an appropriate error will be returned. 116 116 */ 117 bool fUs eSysfs;117 bool fUsbfsChosen = false, fSysfsChosen = false; 118 118 const char *pcszUsbFromEnv = RTEnvGet("VBOX_USB"); 119 119 const char *pcszUsbRoot = NULL; … … 126 126 { 127 127 LogRel(("Default USB access method set to \"usbfs\" from environment\n")); 128 fUs eSysfs = false;128 fUsbfsChosen = true; 129 129 } 130 130 else if (!RTStrICmp(pcszUsbFromEnv, "SYSFS")) 131 131 { 132 132 LogRel(("Default USB method set to \"sysfs\" from environment\n")); 133 f UseSysfs= true;133 fSysfsChosen = true; 134 134 } 135 135 else … … 144 144 if (!pcszUsbRoot) 145 145 { 146 if (USBProxyLinuxCheckDeviceRoot("/dev/vboxusb", true)) 147 { 148 fUseSysfs = true; 146 if ( !fUsbfsChosen 147 && USBProxyLinuxCheckDeviceRoot("/dev/vboxusb", true)) 148 { 149 fSysfsChosen = true; 149 150 pcszUsbRoot = "/dev/vboxusb"; 150 151 } 151 else if (USBProxyLinuxCheckDeviceRoot("/proc/bus/usb", false)) 152 { 153 fUseSysfs = false; 152 else if ( !fSysfsChosen 153 && USBProxyLinuxCheckDeviceRoot("/proc/bus/usb", false)) 154 { 155 fUsbfsChosen = true; 154 156 pcszUsbRoot = "/proc/bus/usb"; 155 157 } … … 157 159 if (pcszUsbRoot) 158 160 { 159 mUsingUsbfsDevices = !fUseSysfs;161 mUsingUsbfsDevices = fUsbfsChosen; 160 162 mDevicesRoot = pcszUsbRoot; 161 163 #ifndef UNIT_TEST /* Hack for now */ -
trunk/src/VBox/Main/testcase/tstUSBProxyLinux.cpp
r36993 r36994 91 91 { "sysfs", "/dev/bus/usb", "/dev/usbvbox", false, "/proc/usb/bus", false, VINF_SUCCESS, VINF_SUCCESS, "/dev/bus/usb", false }, 92 92 { "sysfs", "/dev/bus/usb", "/dev/usbvbox", false, "/proc/usb/bus", false, VERR_NO_MEMORY, VERR_NO_MEMORY, "/dev/bus/usb", false }, 93 { "sysfs", NULL, "/dev/ usbvbox", true, NULL, false, VINF_SUCCESS, VINF_SUCCESS, "/dev/vboxusb", false },93 { "sysfs", NULL, "/dev/vboxusb", true, NULL, false, VINF_SUCCESS, VINF_SUCCESS, "/dev/vboxusb", false }, 94 94 { "usbfs", "/dev/bus/usb", NULL, false, NULL, false, VINF_SUCCESS, VINF_SUCCESS, "/dev/bus/usb", true }, 95 95 { "usbfs", "/dev/bus/usb", NULL, false, NULL, false, VERR_NO_MEMORY, VERR_NO_MEMORY, "/dev/bus/usb", true },
Note:
See TracChangeset
for help on using the changeset viewer.