VirtualBox

Ignore:
Timestamp:
Apr 28, 2016 1:55:03 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106933
Message:

Main/USBProxy{Service|Backend}: Rework interaction between thos two to be more sane than it currently is (calling into each other back and forth)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/linux/USBProxyBackendLinux.cpp

    r60107 r60742  
    269269
    270270
    271 bool USBProxyBackendLinux::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters,
    272                                              SessionMachine **aIgnoreMachine)
    273 {
    274     AssertReturn(aDevice, false);
    275     AssertReturn(!aDevice->isWriteLockOnCurrentThread(), false);
    276     AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS);
    277     if (    aUSBDevice->enmState == USBDEVICESTATE_USED_BY_HOST_CAPTURABLE
    278         &&  aDevice->i_getUsbData()->enmState == USBDEVICESTATE_USED_BY_HOST)
    279         LogRel(("USBProxy: Device %04x:%04x (%s) has become accessible.\n",
    280                 aUSBDevice->idVendor, aUSBDevice->idProduct, aUSBDevice->pszAddress));
    281     devLock.release();
    282     return updateDeviceStateFake(aDevice, aUSBDevice, aRunFilters, aIgnoreMachine);
    283 }
    284 
    285 
    286271/**
    287272 * A device was added, we need to adjust mUdevPolls.
    288  *
    289  * See USBProxyService::deviceAdded for details.
    290  */
    291 void USBProxyBackendLinux::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines,
    292                                        PUSBDEVICE aUSBDevice)
     273 */
     274void USBProxyBackendLinux::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, PUSBDEVICE pDev)
    293275{
    294276    AssertReturnVoid(aDevice);
    295277    AssertReturnVoid(!aDevice->isWriteLockOnCurrentThread());
    296278    AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS);
    297     if (aUSBDevice->enmState == USBDEVICESTATE_USED_BY_HOST)
    298     {
    299         LogRel(("USBProxy: Device %04x:%04x (%s) isn't accessible. giving udev a few seconds to fix this...\n",
    300                 aUSBDevice->idVendor, aUSBDevice->idProduct, aUSBDevice->pszAddress));
     279    if (pDev->enmState == USBDEVICESTATE_USED_BY_HOST)
     280    {
     281        LogRel(("USBProxyBackendLinux: Device %04x:%04x (%s) isn't accessible. giving udev a few seconds to fix this...\n",
     282                pDev->idVendor, pDev->idProduct, pDev->pszAddress));
    301283        mUdevPolls = 10; /* (10 * 500ms = 5s) */
    302284    }
    303285
    304286    devLock.release();
    305     USBProxyBackend::deviceAdded(aDevice, llOpenedMachines, aUSBDevice);
    306287}
    307288
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette