summaryrefslogtreecommitdiff
path: root/src/VBox/Main/src-server/HostImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Main/src-server/HostImpl.cpp')
-rw-r--r--src/VBox/Main/src-server/HostImpl.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/VBox/Main/src-server/HostImpl.cpp b/src/VBox/Main/src-server/HostImpl.cpp
index f0793b095..6bba2ac66 100644
--- a/src/VBox/Main/src-server/HostImpl.cpp
+++ b/src/VBox/Main/src-server/HostImpl.cpp
@@ -1647,9 +1647,8 @@ HRESULT Host::getDrives(DeviceType_T mediumType,
// list was built, and this was a subsequent call: then compare the old and the new lists
// remove drives from the cached list which are no longer present
- for (MediaList::iterator itCached = pllCached->begin();
- itCached != pllCached->end();
- ++itCached)
+ MediaList::iterator itCached = pllCached->begin();
+ while (itCached != pllCached->end())
{
Medium *pCached = *itCached;
const Utf8Str strLocationCached = pCached->getLocationFull();
@@ -1668,6 +1667,8 @@ HRESULT Host::getDrives(DeviceType_T mediumType,
}
if (!fFound)
itCached = pllCached->erase(itCached);
+ else
+ ++itCached;
}
// add drives to the cached list that are not on there yet
@@ -2724,26 +2725,25 @@ HRESULT Host::checkUSBProxyService()
/* disable the USB controller completely to avoid assertions if the
* USB proxy service could not start. */
- if (m->pUSBProxyService->getLastError() == VERR_FILE_NOT_FOUND)
- return setWarning(E_FAIL,
- tr("Could not load the Host USB Proxy Service (%Rrc). The service might not be installed on the host computer"),
- m->pUSBProxyService->getLastError());
- if (m->pUSBProxyService->getLastError() == VINF_SUCCESS)
-#ifdef RT_OS_LINUX
- return setWarning (VBOX_E_HOST_ERROR,
-# ifdef VBOX_WITH_DBUS
- tr ("The USB Proxy Service could not be started, because neither the USB file system (usbfs) nor the hardware information service (hal) is available")
-# else
- tr ("The USB Proxy Service could not be started, because the USB file system (usbfs) is not available")
-# endif
- );
-#else /* !RT_OS_LINUX */
- return setWarning (E_FAIL,
- tr ("The USB Proxy Service has not yet been ported to this host"));
-#endif /* !RT_OS_LINUX */
- return setWarning (E_FAIL,
- tr ("Could not load the Host USB Proxy service (%Rrc)"),
- m->pUSBProxyService->getLastError());
+ switch (m->pUSBProxyService->getLastError())
+ {
+ case VERR_FILE_NOT_FOUND: /** @todo what does this mean? */
+ return setWarning(E_FAIL,
+ tr("Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might not be installed on the host computer"));
+ case VERR_VUSB_USB_DEVICE_PERMISSION:
+ return setWarning(E_FAIL,
+ tr("VirtualBox is not currently allowed to access USB devices. You can change this by adding your user to the 'vboxusers' group. Please see the user manual for a more detailed explanation"));
+ case VERR_VUSB_USBFS_PERMISSION:
+ return setWarning(E_FAIL,
+ tr("VirtualBox is not currently allowed to access USB devices. You can change this by allowing your user to access the 'usbfs' folder and files. Please see the user manual for a more detailed explanation"));
+ case VINF_SUCCESS:
+ return setWarning(E_FAIL,
+ tr("The USB Proxy Service has not yet been ported to this host"));
+ default:
+ return setWarning (E_FAIL, "%s: %Rrc",
+ tr ("Could not load the Host USB Proxy service"),
+ m->pUSBProxyService->getLastError());
+ }
}
return S_OK;