Changeset 36418 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Mar 24, 2011 10:53:13 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp
r35351 r36418 93 93 bool fUseSysfs = false; 94 94 #endif 95 const char *pszUsbFromEnv = RTEnvGet("VBOX_USB"); 96 if (pszUsbFromEnv) 97 { 98 if (!RTStrICmp(pszUsbFromEnv, "USBFS")) 95 const char *pcszUsbFromEnv = RTEnvGet("VBOX_USB"); 96 const char *pcszUsbRoot = NULL; 97 if (pcszUsbFromEnv) 98 { 99 bool fValidVBoxUSB = true; 100 101 pcszUsbRoot = RTEnvGet("VBOX_USB_ROOT"); 102 if (!RTStrICmp(pcszUsbFromEnv, "USBFS")) 99 103 { 100 104 LogRel(("Default USB access method set to \"usbfs\" from environment\n")); 101 105 fUseSysfs = false; 102 106 } 103 else if (!RTStrICmp(p szUsbFromEnv, "SYSFS"))107 else if (!RTStrICmp(pcszUsbFromEnv, "SYSFS")) 104 108 { 105 109 LogRel(("Default USB method set to \"sysfs\" from environment\n")); … … 107 111 } 108 112 else 113 { 109 114 LogRel(("Invalid VBOX_USB environment variable setting \"%s\"\n", 110 pszUsbFromEnv)); 111 } 112 PCUSBDEVTREELOCATION pcLocation = USBProxyLinuxGetDeviceRoot(fUseSysfs); 113 if (pcLocation) 114 { 115 mUsingUsbfsDevices = !pcLocation->fUseSysfs; 116 mDevicesRoot = pcLocation->szDevicesRoot; 115 pcszUsbFromEnv)); 116 fValidVBoxUSB = false; 117 } 118 if (!fValidVBoxUSB && pcszUsbRoot) 119 pcszUsbRoot = NULL; 120 } 121 if (!pcszUsbRoot) 122 { 123 PCUSBDEVTREELOCATION pcLocation; 124 pcLocation = USBProxyLinuxGetDeviceRoot(fUseSysfs); 125 pcszUsbRoot = pcLocation->szDevicesRoot; 126 fUseSysfs = pcLocation->fUseSysfs; 127 } 128 if (pcszUsbRoot) 129 { 130 mUsingUsbfsDevices = !fUseSysfs; 131 mDevicesRoot = pcszUsbRoot; 117 132 int rc = mUsingUsbfsDevices ? initUsbfs() : initSysfs(); 118 133 /* For the day when we have VBoxSVC release logging... */ 119 134 LogRel((RT_SUCCESS(rc) ? "Successfully initialised host USB using %s\n" 120 135 : "Failed to initialise host USB using %s\n", 121 mUsingUsbfsDevices ? "USBFS" : "sysfs /hal"));136 mUsingUsbfsDevices ? "USBFS" : "sysfs")); 122 137 mLastError = rc; 123 138 }
Note:
See TracChangeset
for help on using the changeset viewer.