Changeset 21713 in vbox
- Timestamp:
- Jul 17, 2009 9:48:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/linux/HostHardwareLinux.cpp
r21436 r21713 125 125 mDVDList.clear (); 126 126 #if defined(RT_OS_LINUX) 127 /* Always allow the user to override our auto-detection using an 128 * environment variable. */ 129 if (RT_SUCCESS (rc) && (!success || testing())) 130 rc = getDriveInfoFromEnv ("VBOX_CDROM", &mDVDList, true /* isDVD */, 131 &success); 127 132 #ifdef VBOX_WITH_DBUS 128 133 if (RT_SUCCESS (rc) && RT_SUCCESS(VBoxLoadDBusLib()) && (!success || testing())) 129 134 rc = getDriveInfoFromHal(&mDVDList, true /* isDVD */, &success); 130 135 #endif /* VBOX_WITH_DBUS defined */ 131 // On Linux without hal, the situation is much more complex. We will take a 132 // heuristical approach and also allow the user to specify a list of host 133 // CDROMs using an environment variable. 134 // The general strategy is to try some known device names and see of they 135 // exist. At last, we'll enumerate the /etc/fstab file (luckily there's an 136 // API to parse it) for CDROM devices. Ok, let's start! 137 if (RT_SUCCESS (rc) && (!success || testing())) 138 rc = getDriveInfoFromEnv ("VBOX_CDROM", &mDVDList, true /* isDVD */, 139 &success); 136 /* On Linux without hal, the situation is much more complex. We will 137 * take a heuristical approach. The general strategy is to try some 138 * known device names and see of they exist. Failing that, we 139 * enumerate the /etc/fstab file (luckily there's an API to parse it) 140 * for CDROM devices. Ok, let's start! */ 140 141 if (RT_SUCCESS (rc) && (!success || testing())) 141 142 { … … 170 171 mFloppyList.clear (); 171 172 #if defined(RT_OS_LINUX) 173 if (RT_SUCCESS (rc) && (!success || testing())) 174 rc = getDriveInfoFromEnv ("VBOX_FLOPPY", &mFloppyList, false /* isDVD */, 175 &success); 172 176 #ifdef VBOX_WITH_DBUS 173 177 if ( RT_SUCCESS (rc) … … 176 180 rc = getDriveInfoFromHal(&mFloppyList, false /* isDVD */, &success); 177 181 #endif /* VBOX_WITH_DBUS defined */ 178 // As with the CDROMs, on Linux we have to take a multi-level approach 179 // involving parsing the mount tables. As this is not bulletproof, we'll 180 // give the user the chance to override the detection by an environment 181 // variable and skip the detection. 182 if (RT_SUCCESS (rc) && (!success || testing())) 183 rc = getDriveInfoFromEnv ("VBOX_FLOPPY", &mFloppyList, false /* isDVD */, 184 &success); 182 /* As with the CDROMs, on Linux we have to take a multi-level approach 183 * involving parsing the mount tables. As this is not bulletproof, we 184 * give the user the chance to override the detection using an 185 * environment variable, skiping the detection. */ 185 186 186 187 if (RT_SUCCESS (rc) && (!success || testing())) … … 1120 1121 if (dbusError.HasName (DBUS_ERROR_NO_MEMORY)) 1121 1122 rc = VERR_NO_MEMORY; 1123 /* If we found nothing something may have gone wrong with hal, so 1124 * report failure to fall back to other methods. */ 1125 if (pList->size() == 0) 1126 halSuccess = false; 1122 1127 if (pfSuccess != NULL) 1123 1128 *pfSuccess = halSuccess;
Note:
See TracChangeset
for help on using the changeset viewer.