Changeset 57994 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Oct 1, 2015 7:56:39 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
r57990 r57994 455 455 { 456 456 alock.acquire(); 457 i_failTransition( );457 i_failTransition(kHostUSBDeviceState_Invalid); 458 458 mMachine.setNull(); 459 459 if (rc == VERR_SHARING_VIOLATION) … … 714 714 { 715 715 alock.acquire(); 716 i_failTransition( );716 i_failTransition(kHostUSBDeviceState_Invalid); 717 717 return E_FAIL; 718 718 } … … 767 767 { 768 768 alock.acquire(); 769 i_failTransition( );769 i_failTransition(kHostUSBDeviceState_Invalid); 770 770 return E_FAIL; 771 771 } … … 814 814 { 815 815 LogRel(("USB: Async operation timed out for device %s (state: %s)\n", mName, i_getStateName())); 816 i_failTransition( );816 i_failTransition(kHostUSBDeviceState_PhysDetached); 817 817 } 818 818 #endif … … 1196 1196 /* Can only mean that we've failed capturing it. */ 1197 1197 case kHostUSBDeviceState_Capturing: 1198 LogThisFunc(("{%s} capture failed! \n", mName));1198 LogThisFunc(("{%s} capture failed! (#1)\n", mName)); 1199 1199 mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */); 1200 *aRunFilters = i_failTransition( );1200 *aRunFilters = i_failTransition(kHostUSBDeviceState_UsedByHost); 1201 1201 mMachine.setNull(); 1202 1202 break; … … 1264 1264 /* Can only mean that we've failed capturing it. */ 1265 1265 case kHostUSBDeviceState_Capturing: 1266 LogThisFunc(("{%s} capture failed! \n", mName));1266 LogThisFunc(("{%s} capture failed! (#2)\n", mName)); 1267 1267 mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */); 1268 *aRunFilters = i_failTransition( );1268 *aRunFilters = i_failTransition(kHostUSBDeviceState_Capturable); 1269 1269 mMachine.setNull(); 1270 1270 break; … … 1332 1332 #endif 1333 1333 { 1334 LogThisFunc(("{%s} capture failed! \n", mName));1334 LogThisFunc(("{%s} capture failed! (#3)\n", mName)); 1335 1335 mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */); 1336 *aRunFilters = i_failTransition( );1336 *aRunFilters = i_failTransition(kHostUSBDeviceState_Unused); 1337 1337 mMachine.setNull(); 1338 1338 } … … 1469 1469 && i_hasAsyncOperationTimedOut()) 1470 1470 { 1471 LogRel(("USB: timeout in %s for {%RTuuid} / {%s}\n", 1472 i_getStateName(), mId.raw(), mName)); 1473 *aRunFilters = i_failTransition(); 1471 LogRel(("USB: timeout in %s for {%RTuuid} / {%s}\n", i_getStateName(), mId.raw(), mName)); 1472 *aRunFilters = i_failTransition(kHostUSBDeviceState_Invalid); 1474 1473 fIsImportant = true; 1475 1474 } … … 2019 2018 case kHostUSBDeviceState_Capturable: 2020 2019 case kHostUSBDeviceState_Unused: 2021 Assert(aNewState == mPrevUniState); 2020 Assert(aNewState == mPrevUniState); /** @todo This is kind of wrong, see i_failTransition. */ 2022 2021 Assert(aNewPendingState == kHostUSBDeviceState_Invalid); 2023 2022 Assert(aNewSubState == kHostUSBDeviceSubState_Default); … … 2412 2411 * 2413 2412 * @return true if filters should be applied to the device, false if not. 2413 * @param a_enmStateHint USB device state hint. kHostUSBDeviceState_Invalid 2414 * if the caller doesn't have a clue to give. 2414 2415 * 2415 2416 * @note The caller must own the write lock for this object. 2416 2417 */ 2417 bool HostUSBDevice::i_failTransition( )2418 bool HostUSBDevice::i_failTransition(HostUSBDeviceState a_enmStateHint) 2418 2419 { 2419 2420 AssertReturn(isWriteLockOnCurrentThread(), false); … … 2441 2442 case kHostUSBDeviceSubState_AwaitingReAttach: 2442 2443 enmSub = kHostUSBDeviceSubState_Default; 2443 enmState = kHostUSBDeviceState_PhysDetached; 2444 if (a_enmStateHint != kHostUSBDeviceState_Invalid) 2445 enmState = mPrevUniState; /** @todo enmState = a_enmStateHint is more correct, but i_setState doesn't like it. It will usually correct itself shortly. */ 2446 else 2447 enmState = kHostUSBDeviceState_PhysDetached; 2444 2448 break; 2445 2449 default:
Note:
See TracChangeset
for help on using the changeset viewer.