Changeset 49960 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Dec 17, 2013 5:24:57 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 91379
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
r41813 r49960 5 5 6 6 /* 7 * Copyright (C) 2005-201 2Oracle Corporation7 * Copyright (C) 2005-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 15 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 */ 17 17 18 18 19 #include <iprt/types.h> /* for UINT64_C */ … … 92 93 93 94 /* Set the name. */ 94 mNameObj = getName();95 mNameObj = i_getName(); 95 96 mName = mNameObj.c_str(); 96 97 … … 122 123 } 123 124 124 // IUSBDevice properties125 // Wrapped IUSBDevice properties 125 126 ///////////////////////////////////////////////////////////////////////////// 126 127 STDMETHODIMP HostUSBDevice::COMGETTER(Id)(BSTR *aId) 128 { 129 CheckComArgOutPointerValid(aId); 130 131 AutoCaller autoCaller(this); 132 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 133 127 HRESULT HostUSBDevice::getId(com::Guid &aId) 128 { 134 129 /* mId is constant during life time, no need to lock */ 135 mId.toUtf16().cloneTo(aId);130 aId = mId; 136 131 137 132 return S_OK; 138 133 } 139 134 140 STDMETHODIMP HostUSBDevice::COMGETTER(VendorId)(USHORT *aVendorId) 141 { 142 CheckComArgOutPointerValid(aVendorId); 143 144 AutoCaller autoCaller(this); 145 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 146 135 136 HRESULT HostUSBDevice::getVendorId(USHORT *aVendorId) 137 { 147 138 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 148 139 … … 152 143 } 153 144 154 STDMETHODIMP HostUSBDevice::COMGETTER(ProductId)(USHORT *aProductId) 155 { 156 CheckComArgOutPointerValid(aProductId); 157 158 AutoCaller autoCaller(this); 159 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 160 145 HRESULT HostUSBDevice::getProductId(USHORT *aProductId) 146 { 161 147 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 162 148 … … 166 152 } 167 153 168 STDMETHODIMP HostUSBDevice::COMGETTER(Revision)(USHORT *aRevision) 169 { 170 CheckComArgOutPointerValid(aRevision); 171 172 AutoCaller autoCaller(this); 173 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 174 154 155 HRESULT HostUSBDevice::getRevision(USHORT *aRevision) 156 { 175 157 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 176 158 … … 180 162 } 181 163 182 STDMETHODIMP HostUSBDevice::COMGETTER(Manufacturer)(BSTR *aManufacturer) 183 { 184 CheckComArgOutPointerValid(aManufacturer); 185 186 AutoCaller autoCaller(this); 187 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 188 164 HRESULT HostUSBDevice::getManufacturer(com::Utf8Str &aManufacturer) 165 { 189 166 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 190 167 191 Bstr(mUsb->pszManufacturer).cloneTo(aManufacturer);168 aManufacturer = mUsb->pszManufacturer; 192 169 193 170 return S_OK; 194 171 } 195 172 196 STDMETHODIMP HostUSBDevice::COMGETTER(Product)(BSTR *aProduct) 197 { 198 CheckComArgOutPointerValid(aProduct); 199 200 AutoCaller autoCaller(this); 201 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 202 173 174 HRESULT HostUSBDevice::getProduct(com::Utf8Str &aProduct) 175 { 203 176 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 204 177 205 Bstr(mUsb->pszProduct).cloneTo(aProduct);178 aProduct = mUsb->pszProduct; 206 179 207 180 return S_OK; 208 181 } 209 182 210 STDMETHODIMP HostUSBDevice::COMGETTER(SerialNumber)(BSTR *aSerialNumber) 211 { 212 CheckComArgOutPointerValid(aSerialNumber); 213 214 AutoCaller autoCaller(this); 215 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 216 183 184 HRESULT HostUSBDevice::getSerialNumber(com::Utf8Str &aSerialNumber) 185 { 217 186 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 218 187 219 Bstr(mUsb->pszSerialNumber).cloneTo(aSerialNumber);188 aSerialNumber = mUsb->pszSerialNumber; 220 189 221 190 return S_OK; 222 191 } 223 192 224 STDMETHODIMP HostUSBDevice::COMGETTER(Address)(BSTR *aAddress) 225 { 226 CheckComArgOutPointerValid(aAddress); 227 228 AutoCaller autoCaller(this); 229 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 230 193 HRESULT HostUSBDevice::getAddress(com::Utf8Str &aAddress) 194 { 231 195 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 232 233 Bstr(mUsb->pszAddress).cloneTo(aAddress); 234 196 aAddress = mUsb->pszAddress; 235 197 return S_OK; 236 198 } 237 199 238 STDMETHODIMP HostUSBDevice::COMGETTER(Port)(USHORT *aPort) 239 { 240 CheckComArgOutPointerValid(aPort); 241 242 AutoCaller autoCaller(this); 243 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 244 200 201 HRESULT HostUSBDevice::getPort(USHORT *aPort) 202 { 245 203 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 246 204 … … 254 212 } 255 213 256 STDMETHODIMP HostUSBDevice::COMGETTER(Version)(USHORT *aVersion) 257 { 258 CheckComArgOutPointerValid(aVersion); 259 260 AutoCaller autoCaller(this); 261 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 262 214 215 HRESULT HostUSBDevice::getVersion(USHORT *aVersion) 216 { 263 217 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 264 218 … … 268 222 } 269 223 270 STDMETHODIMP HostUSBDevice::COMGETTER(PortVersion)(USHORT *aPortVersion) 271 { 272 CheckComArgOutPointerValid(aPortVersion); 273 274 AutoCaller autoCaller(this); 275 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 276 224 HRESULT HostUSBDevice::getPortVersion(USHORT *aPortVersion) 225 { 277 226 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 278 279 227 /* Port version is 2 (EHCI) if and only if the device runs at high speed; 280 228 * if speed is unknown, fall back to the old and inaccurate method. … … 288 236 } 289 237 290 STDMETHODIMP HostUSBDevice::COMGETTER(Remote)(BOOL *aRemote) 291 { 292 CheckComArgOutPointerValid(aRemote); 293 294 AutoCaller autoCaller(this); 295 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 296 238 239 HRESULT HostUSBDevice::getRemote(BOOL *aRemote) 240 { 297 241 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 298 242 … … 302 246 } 303 247 304 // IHostUSBDevice properties 305 ///////////////////////////////////////////////////////////////////////////// 306 307 STDMETHODIMP HostUSBDevice::COMGETTER(State)(USBDeviceState_T *aState) 308 { 309 CheckComArgOutPointerValid(aState); 310 311 AutoCaller autoCaller(this); 312 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 313 248 249 HRESULT HostUSBDevice::getState(USBDeviceState_T *aState) 250 { 314 251 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 315 252 316 *aState = canonicalState();253 *aState = i_canonicalState(); 317 254 318 255 return S_OK; … … 326 263 * @note Locks this object for reading. 327 264 */ 328 Utf8Str HostUSBDevice::getName()265 com::Utf8Str HostUSBDevice::i_getName() 329 266 { 330 267 Utf8Str name; … … 366 303 * @retval E_* as appropriate. 367 304 */ 368 HRESULT HostUSBDevice:: requestCaptureForVM(SessionMachine *aMachine, bool aSetError, ULONG aMaskedIfs /* = 0*/)305 HRESULT HostUSBDevice::i_requestCaptureForVM(SessionMachine *aMachine, bool aSetError, ULONG aMaskedIfs /* = 0*/) 369 306 { 370 307 /* … … 406 343 return setError(E_INVALIDARG, 407 344 tr("USB device '%s' with UUID {%RTuuid} is not in the right state for capturing (%s)"), 408 mName, mId.raw(), getStateName());345 mName, mId.raw(), i_getStateName()); 409 346 } 410 347 … … 422 359 { 423 360 alock.release(); 424 HRESULT hrc = attachToVM(aMachine, aMaskedIfs);361 HRESULT hrc = i_attachToVM(aMachine, aMaskedIfs); 425 362 return SUCCEEDED(hrc); 426 363 } … … 435 372 #if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \ 436 373 || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) 437 setState(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_UsedByVM, kHostUSBDeviceSubState_AwaitingDetach);374 i_setState(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_UsedByVM, kHostUSBDeviceSubState_AwaitingDetach); 438 375 #else 439 setState(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_UsedByVM);376 i_setState(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_UsedByVM); 440 377 #endif 441 378 mMachine = aMachine; … … 446 383 { 447 384 alock.acquire(); 448 failTransition();385 i_failTransition(); 449 386 mMachine.setNull(); 450 387 if (rc == VERR_SHARING_VIOLATION) … … 475 412 * @param aMaskedIfs The interfaces to hide from the guest. 476 413 */ 477 HRESULT HostUSBDevice:: attachToVM(SessionMachine *aMachine, ULONG aMaskedIfs /* = 0*/)414 HRESULT HostUSBDevice::i_attachToVM(SessionMachine *aMachine, ULONG aMaskedIfs /* = 0*/) 478 415 { 479 416 AssertReturn(!isWriteLockOnCurrentThread(), E_FAIL); … … 486 423 || mUniState == kHostUSBDeviceState_AttachingToVM, 487 424 E_UNEXPECTED); 488 setState(kHostUSBDeviceState_AttachingToVM, kHostUSBDeviceState_UsedByVM);425 i_setState(kHostUSBDeviceState_AttachingToVM, kHostUSBDeviceState_UsedByVM); 489 426 490 427 /* … … 515 452 mMachine = aMachine; 516 453 if (!mIsPhysicallyDetached) 517 setState(kHostUSBDeviceState_UsedByVM);454 i_setState(kHostUSBDeviceState_UsedByVM); 518 455 else 519 456 { 520 457 alock.release(); 521 detachFromVM(kHostUSBDeviceState_PhysDetached);458 i_detachFromVM(kHostUSBDeviceState_PhysDetached); 522 459 hrc = E_UNEXPECTED; 523 460 } … … 528 465 if (!mIsPhysicallyDetached) 529 466 { 530 setState(kHostUSBDeviceState_HeldByProxy);467 i_setState(kHostUSBDeviceState_HeldByProxy); 531 468 if (hrc == E_UNEXPECTED) 532 469 hrc = E_FAIL; /* No confusion. */ … … 535 472 { 536 473 alock.release(); 537 onPhysicalDetachedInternal();474 i_onPhysicalDetachedInternal(); 538 475 hrc = E_UNEXPECTED; 539 476 } … … 551 488 * @param aFinalState The final state (PhysDetached). 552 489 */ 553 void HostUSBDevice:: detachFromVM(HostUSBDeviceState aFinalState)490 void HostUSBDevice::i_detachFromVM(HostUSBDeviceState aFinalState) 554 491 { 555 492 NOREF(aFinalState); … … 570 507 * so, it's not a bit issue here. 571 508 */ 572 setState(kHostUSBDeviceState_PhysDetachingFromVM, kHostUSBDeviceState_PhysDetached);509 i_setState(kHostUSBDeviceState_PhysDetachingFromVM, kHostUSBDeviceState_PhysDetached); 573 510 574 511 /* … … 589 526 */ 590 527 alock.acquire(); 591 advanceTransition();528 i_advanceTransition(); 592 529 } 593 530 … … 612 549 * @note Must be called from under the object write lock. 613 550 */ 614 HRESULT HostUSBDevice:: onDetachFromVM(SessionMachine *aMachine, bool aDone, bool *aRunFilters, bool aAbnormal /*= true*/)615 { 616 LogFlowThisFunc(("{%s} state=%s aDone=%RTbool aAbnormal=%RTbool\n", mName, getStateName(), aDone, aAbnormal));551 HRESULT HostUSBDevice::i_onDetachFromVM(SessionMachine *aMachine, bool aDone, bool *aRunFilters, bool aAbnormal /*= true*/) 552 { 553 LogFlowThisFunc(("{%s} state=%s aDone=%RTbool aAbnormal=%RTbool\n", mName, i_getStateName(), aDone, aAbnormal)); 617 554 618 555 /* … … 626 563 return setError(E_INVALIDARG, 627 564 tr("USB device '%s' with UUID {%RTuuid} is busy (state '%s'). Please try again later"), 628 mName, mId.raw(), getStateName());565 mName, mId.raw(), i_getStateName()); 629 566 } 630 567 else 631 568 AssertMsgReturn( mUniState == kHostUSBDeviceState_DetachingFromVM /** @todo capturing for VM ends up here on termination. */ 632 569 || (mUniState == kHostUSBDeviceState_UsedByVM && aAbnormal), 633 ("{%s} %s\n", mName, getStateName()), E_UNEXPECTED);570 ("{%s} %s\n", mName, i_getStateName()), E_UNEXPECTED); 634 571 AssertMsgReturn((mMachine == aMachine), ("%p != %p\n", (void *)mMachine, aMachine), E_FAIL); 635 572 … … 639 576 if (!aDone) 640 577 { 641 *aRunFilters = startTransition(kHostUSBDeviceState_DetachingFromVM, kHostUSBDeviceState_HeldByProxy);578 *aRunFilters = i_startTransition(kHostUSBDeviceState_DetachingFromVM, kHostUSBDeviceState_HeldByProxy); 642 579 /* PORTME: This might require host specific changes if you re-enumerate the device. */ 643 580 } … … 646 583 /* Fast forward thru the DetachingFromVM state and on to HeldByProxy. */ 647 584 /** @todo need to update the state machine to handle crashed VMs. */ 648 startTransition(kHostUSBDeviceState_DetachingFromVM, kHostUSBDeviceState_HeldByProxy);649 *aRunFilters = advanceTransition();585 i_startTransition(kHostUSBDeviceState_DetachingFromVM, kHostUSBDeviceState_HeldByProxy); 586 *aRunFilters = i_advanceTransition(); 650 587 mMachine.setNull(); 651 588 /* PORTME: ditto / trouble if you depend on the VM process to do anything. */ … … 655 592 /* normal completion. */ 656 593 Assert(mUniSubState == kHostUSBDeviceSubState_Default); /* PORTME: ditto */ 657 *aRunFilters = advanceTransition();594 *aRunFilters = i_advanceTransition(); 658 595 mMachine.setNull(); 659 596 } … … 675 612 * @note Must be called without holding the object lock. 676 613 */ 677 HRESULT HostUSBDevice:: requestReleaseToHost()614 HRESULT HostUSBDevice::i_requestReleaseToHost() 678 615 { 679 616 /* … … 688 625 || mUniState == kHostUSBDeviceState_Capturable) 689 626 return S_OK; 690 AssertMsgReturn(mUniState == kHostUSBDeviceState_HeldByProxy, ("{%s} %s\n", mName, getStateName()), E_UNEXPECTED);627 AssertMsgReturn(mUniState == kHostUSBDeviceState_HeldByProxy, ("{%s} %s\n", mName, i_getStateName()), E_UNEXPECTED); 691 628 692 629 /* … … 695 632 #if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \ 696 633 || defined(RT_OS_WINDOWS) 697 startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused, kHostUSBDeviceSubState_AwaitingDetach);634 i_startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused, kHostUSBDeviceSubState_AwaitingDetach); 698 635 #else 699 startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused);636 i_startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused); 700 637 #endif 701 638 alock.release(); … … 704 641 { 705 642 alock.acquire(); 706 failTransition();643 i_failTransition(); 707 644 return E_FAIL; 708 645 } … … 724 661 * @note Must be called without holding the object lock. 725 662 */ 726 HRESULT HostUSBDevice:: requestHold()663 HRESULT HostUSBDevice::i_requestHold() 727 664 { 728 665 /* … … 735 672 || mUniState == kHostUSBDeviceState_Capturable 736 673 || mUniState == kHostUSBDeviceState_HeldByProxy, 737 ("{%s} %s\n", mName, getStateName()),674 ("{%s} %s\n", mName, i_getStateName()), 738 675 E_UNEXPECTED); 739 676 … … 749 686 #if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \ 750 687 || defined(RT_OS_WINDOWS) 751 startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy, kHostUSBDeviceSubState_AwaitingDetach);688 i_startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy, kHostUSBDeviceSubState_AwaitingDetach); 752 689 #else 753 startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy);690 i_startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy); 754 691 #endif 755 692 alock.release(); … … 758 695 { 759 696 alock.acquire(); 760 failTransition();697 i_failTransition(); 761 698 return E_FAIL; 762 699 } … … 774 711 * @returns true if it was actually detached, false if it's just a re-enumeration. 775 712 */ 776 bool HostUSBDevice:: wasActuallyDetached()713 bool HostUSBDevice::i_wasActuallyDetached() 777 714 { 778 715 /* … … 792 729 */ 793 730 case kHostUSBDeviceSubState_AwaitingDetach: 794 advanceTransition();731 i_advanceTransition(); 795 732 return false; /* not physically detached. */ 796 733 … … 804 741 if (elapsedNanoseconds > UINT64_C(60000000000)) /* 60 seconds */ 805 742 { 806 LogRel(("USB: Async operation timed out for device %s (state: %s)\n", mName, getStateName()));807 failTransition();743 LogRel(("USB: Async operation timed out for device %s (state: %s)\n", mName, i_getStateName())); 744 i_failTransition(); 808 745 } 809 746 #endif … … 829 766 830 767 default: 831 AssertLogRelMsgFailed(("this=%p %s\n", this, getStateName()));768 AssertLogRelMsgFailed(("this=%p %s\n", this, i_getStateName())); 832 769 break; 833 770 } … … 847 784 * reset. 848 785 */ 849 void HostUSBDevice:: onPhysicalDetached()786 void HostUSBDevice::i_onPhysicalDetached() 850 787 { 851 788 AssertReturnVoid(!isWriteLockOnCurrentThread()); … … 857 794 { 858 795 alock.release(); 859 onPhysicalDetachedInternal();796 i_onPhysicalDetachedInternal(); 860 797 } 861 798 } … … 868 805 * See onPhysicalDetach() for details. 869 806 */ 870 void HostUSBDevice:: onPhysicalDetachedInternal()807 void HostUSBDevice::i_onPhysicalDetachedInternal() 871 808 { 872 809 AssertReturnVoid(!isWriteLockOnCurrentThread()); … … 883 820 { 884 821 alock.release(); 885 detachFromVM(kHostUSBDeviceState_PhysDetached);822 i_detachFromVM(kHostUSBDeviceState_PhysDetached); 886 823 alock.acquire(); 887 824 } 888 825 else 889 AssertMsg(mMachine.isNull(), ("%s\n", getStateName()));826 AssertMsg(mMachine.isNull(), ("%s\n", i_getStateName())); 890 827 891 828 /* … … 893 830 */ 894 831 mMachine.setNull(); 895 setState(kHostUSBDeviceState_PhysDetached);832 i_setState(kHostUSBDeviceState_PhysDetached); 896 833 } 897 834 … … 910 847 * @note Locks this object for reading. 911 848 */ 912 bool HostUSBDevice::i sMatch(const USBDeviceFilter::Data &aData)849 bool HostUSBDevice::i_isMatch(const USBDeviceFilter::Data &aData) 913 850 { 914 851 AutoCaller autoCaller(this); … … 950 887 * @note Must be called from under the object write lock. 951 888 */ 952 int HostUSBDevice:: compare(PCUSBDEVICE aDev2)889 int HostUSBDevice::i_compare(PCUSBDEVICE aDev2) 953 890 { 954 891 AssertReturn(isWriteLockOnCurrentThread(), -1); 955 892 //Log3(("%Rfn: %p {%s}\n", __PRETTY_FUNCTION__, this, mName)); 956 return compare(mUsb, aDev2,957 mUniSubState == kHostUSBDeviceSubState_AwaitingDetach /* (In case we don't get the detach notice.) */958 || mUniSubState == kHostUSBDeviceSubState_AwaitingReAttach);893 return i_compare(mUsb, aDev2, 894 mUniSubState == kHostUSBDeviceSubState_AwaitingDetach /* (In case we don't get the detach notice.) */ 895 || mUniSubState == kHostUSBDeviceSubState_AwaitingReAttach); 959 896 } 960 897 … … 972 909 */ 973 910 /*static*/ 974 int HostUSBDevice:: compare(PCUSBDEVICE aDev1, PCUSBDEVICE aDev2, bool aIsAwaitingReAttach /*= false */)911 int HostUSBDevice::i_compare(PCUSBDEVICE aDev1, PCUSBDEVICE aDev2, bool aIsAwaitingReAttach /*= false */) 975 912 { 976 913 /* … … 1075 1012 * works by state change. Using 3 return codes/parameters is just plain ugly. 1076 1013 */ 1077 bool HostUSBDevice:: updateState(PCUSBDEVICE aDev, bool *aRunFilters, SessionMachine **aIgnoreMachine)1014 bool HostUSBDevice::i_updateState(PCUSBDEVICE aDev, bool *aRunFilters, SessionMachine **aIgnoreMachine) 1078 1015 { 1079 1016 *aRunFilters = false; … … 1167 1104 if (enmOldState != mUsb->enmState) 1168 1105 { 1169 LogFlowThisFunc(("%p {%s} %s\n", this, mName, getStateName()));1106 LogFlowThisFunc(("%p {%s} %s\n", this, mName, i_getStateName())); 1170 1107 switch (mUsb->enmState) 1171 1108 { … … 1179 1116 case kHostUSBDeviceState_Capturable: 1180 1117 case kHostUSBDeviceState_Unused: 1181 LogThisFunc(("{%s} %s -> %s\n", mName, getStateName(),stateName(kHostUSBDeviceState_UsedByHost)));1182 *aRunFilters = setState(kHostUSBDeviceState_UsedByHost);1118 LogThisFunc(("{%s} %s -> %s\n", mName, i_getStateName(), i_stateName(kHostUSBDeviceState_UsedByHost))); 1119 *aRunFilters = i_setState(kHostUSBDeviceState_UsedByHost); 1183 1120 break; 1184 1121 case kHostUSBDeviceState_UsedByHost: … … 1189 1126 LogThisFunc(("{%s} capture failed!\n", mName)); 1190 1127 mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */); 1191 *aRunFilters = failTransition();1128 *aRunFilters = i_failTransition(); 1192 1129 mMachine.setNull(); 1193 1130 break; … … 1195 1132 /* Guess we've successfully released it. */ 1196 1133 case kHostUSBDeviceState_ReleasingToHost: 1197 LogThisFunc(("{%s} %s -> %s\n", mName, getStateName(),stateName(kHostUSBDeviceState_UsedByHost)));1134 LogThisFunc(("{%s} %s -> %s\n", mName, i_getStateName(), i_stateName(kHostUSBDeviceState_UsedByHost))); 1198 1135 mUSBProxyService->releaseDeviceCompleted(this, true /* aSuccess */); 1199 *aRunFilters = setState(kHostUSBDeviceState_UsedByHost);1136 *aRunFilters = i_setState(kHostUSBDeviceState_UsedByHost); 1200 1137 break; 1201 1138 … … 1204 1141 case kHostUSBDeviceState_DetachingFromVM: 1205 1142 case kHostUSBDeviceState_PhysDetachingFromVM: 1206 LogThisFunc(("{%s} %s - changed to USED_BY_HOST...\n", mName, getStateName()));1143 LogThisFunc(("{%s} %s - changed to USED_BY_HOST...\n", mName, i_getStateName())); 1207 1144 break; 1208 1145 … … 1210 1147 /* Fake: We can't prevent anyone from grabbing it. */ 1211 1148 case kHostUSBDeviceState_HeldByProxy: 1212 LogThisFunc(("{%s} %s -> %s!\n", mName, getStateName(),stateName(kHostUSBDeviceState_UsedByHost)));1213 *aRunFilters = setState(kHostUSBDeviceState_UsedByHost);1149 LogThisFunc(("{%s} %s -> %s!\n", mName, i_getStateName(), i_stateName(kHostUSBDeviceState_UsedByHost))); 1150 *aRunFilters = i_setState(kHostUSBDeviceState_UsedByHost); 1214 1151 break; 1215 1152 //case kHostUSBDeviceState_UsedByVM: … … 1225 1162 case kHostUSBDeviceState_Unsupported: 1226 1163 default: 1227 AssertMsgFailed(("{%s} %s\n", mName, getStateName()));1164 AssertMsgFailed(("{%s} %s\n", mName, i_getStateName())); 1228 1165 break; 1229 1166 } … … 1249 1186 fIsImportant = true; 1250 1187 case kHostUSBDeviceState_Unused: 1251 LogThisFunc(("{%s} %s -> %s\n", mName, getStateName(),stateName(kHostUSBDeviceState_Capturable)));1252 *aRunFilters = setState(kHostUSBDeviceState_Capturable);1188 LogThisFunc(("{%s} %s -> %s\n", mName, i_getStateName(), i_stateName(kHostUSBDeviceState_Capturable))); 1189 *aRunFilters = i_setState(kHostUSBDeviceState_Capturable); 1253 1190 break; 1254 1191 … … 1257 1194 LogThisFunc(("{%s} capture failed!\n", mName)); 1258 1195 mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */); 1259 *aRunFilters = failTransition();1196 *aRunFilters = i_failTransition(); 1260 1197 mMachine.setNull(); 1261 1198 break; … … 1263 1200 /* Guess we've successfully released it. */ 1264 1201 case kHostUSBDeviceState_ReleasingToHost: 1265 LogThisFunc(("{%s} %s -> %s\n", mName, getStateName(),stateName(kHostUSBDeviceState_Capturable)));1202 LogThisFunc(("{%s} %s -> %s\n", mName, i_getStateName(), i_stateName(kHostUSBDeviceState_Capturable))); 1266 1203 mUSBProxyService->releaseDeviceCompleted(this, true /* aSuccess */); 1267 *aRunFilters = setState(kHostUSBDeviceState_Capturable);1204 *aRunFilters = i_setState(kHostUSBDeviceState_Capturable); 1268 1205 break; 1269 1206 … … 1272 1209 case kHostUSBDeviceState_DetachingFromVM: 1273 1210 case kHostUSBDeviceState_PhysDetachingFromVM: 1274 LogThisFunc(("{%s} %s - changed to USED_BY_HOST_CAPTURABLE...\n", mName, getStateName()));1211 LogThisFunc(("{%s} %s - changed to USED_BY_HOST_CAPTURABLE...\n", mName, i_getStateName())); 1275 1212 break; 1276 1213 … … 1283 1220 case kHostUSBDeviceState_PhysDetached: 1284 1221 default: 1285 AssertMsgFailed(("{%s} %s\n", mName, getStateName()));1222 AssertMsgFailed(("{%s} %s\n", mName, i_getStateName())); 1286 1223 break; 1287 1224 } … … 1308 1245 case kHostUSBDeviceState_Capturable: 1309 1246 fIsImportant = true; 1310 LogThisFunc(("{%s} %s -> %s\n", mName, getStateName(),stateName(kHostUSBDeviceState_Unused)));1311 *aRunFilters = setState(kHostUSBDeviceState_Unused);1247 LogThisFunc(("{%s} %s -> %s\n", mName, i_getStateName(), i_stateName(kHostUSBDeviceState_Unused))); 1248 *aRunFilters = i_setState(kHostUSBDeviceState_Unused); 1312 1249 break; 1313 1250 … … 1318 1255 { 1319 1256 LogThisFunc(("{%s} capture advancing thru UNUSED...\n", mName)); 1320 *aRunFilters = advanceTransition();1257 *aRunFilters = i_advanceTransition(); 1321 1258 } 1322 1259 else … … 1325 1262 LogThisFunc(("{%s} capture failed!\n", mName)); 1326 1263 mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */); 1327 *aRunFilters = failTransition();1264 *aRunFilters = i_failTransition(); 1328 1265 mMachine.setNull(); 1329 1266 } … … 1332 1269 /* Guess we've successfully released it. */ 1333 1270 case kHostUSBDeviceState_ReleasingToHost: 1334 LogThisFunc(("{%s} %s -> %s\n", mName, getStateName(),stateName(kHostUSBDeviceState_Unused)));1271 LogThisFunc(("{%s} %s -> %s\n", mName, i_getStateName(), i_stateName(kHostUSBDeviceState_Unused))); 1335 1272 mUSBProxyService->releaseDeviceCompleted(this, true /* aSuccess */); 1336 *aRunFilters = setState(kHostUSBDeviceState_Unused);1273 *aRunFilters = i_setState(kHostUSBDeviceState_Unused); 1337 1274 break; 1338 1275 … … 1341 1278 case kHostUSBDeviceState_DetachingFromVM: 1342 1279 case kHostUSBDeviceState_PhysDetachingFromVM: 1343 LogThisFunc(("{%s} %s - changed to UNUSED...\n", mName, getStateName()));1280 LogThisFunc(("{%s} %s - changed to UNUSED...\n", mName, i_getStateName())); 1344 1281 break; 1345 1282 … … 1352 1289 case kHostUSBDeviceState_PhysDetached: 1353 1290 default: 1354 AssertMsgFailed(("{%s} %s\n", mName, getStateName()));1291 AssertMsgFailed(("{%s} %s\n", mName, i_getStateName())); 1355 1292 break; 1356 1293 } … … 1368 1305 break; 1369 1306 case kHostUSBDeviceState_UsedByVM: 1370 LogThisFunc(("{%s} %s - changed to HELD_BY_PROXY...\n", mName, getStateName()));1307 LogThisFunc(("{%s} %s - changed to HELD_BY_PROXY...\n", mName, i_getStateName())); 1371 1308 break; 1372 1309 … … 1375 1312 LogThisFunc(("{%s} capture succeeded!\n", mName)); 1376 1313 mUSBProxyService->captureDeviceCompleted(this, true /* aSuccess */); 1377 *aRunFilters = advanceTransition(true /* fast forward thru re-attach */);1314 *aRunFilters = i_advanceTransition(true /* fast forward thru re-attach */); 1378 1315 1379 1316 /* Take action if we're supposed to attach it to a VM. */ … … 1381 1318 { 1382 1319 alock.release(); 1383 attachToVM(mMachine, mMaskedIfs);1320 i_attachToVM(mMachine, mMaskedIfs); 1384 1321 alock.acquire(); 1385 1322 } … … 1388 1325 /* Can only mean that we've failed capturing it. */ 1389 1326 case kHostUSBDeviceState_ReleasingToHost: 1390 LogThisFunc(("{%s} %s failed!\n", mName, getStateName()));1327 LogThisFunc(("{%s} %s failed!\n", mName, i_getStateName())); 1391 1328 mUSBProxyService->releaseDeviceCompleted(this, false /* aSuccess */); 1392 *aRunFilters = setState(kHostUSBDeviceState_HeldByProxy);1329 *aRunFilters = i_setState(kHostUSBDeviceState_HeldByProxy); 1393 1330 break; 1394 1331 … … 1397 1334 case kHostUSBDeviceState_DetachingFromVM: 1398 1335 case kHostUSBDeviceState_PhysDetachingFromVM: 1399 LogThisFunc(("{%s} %s - changed to HELD_BY_PROXY...\n", mName, getStateName()));1336 LogThisFunc(("{%s} %s - changed to HELD_BY_PROXY...\n", mName, i_getStateName())); 1400 1337 break; 1401 1338 … … 1407 1344 case kHostUSBDeviceState_PhysDetached: 1408 1345 default: 1409 AssertMsgFailed(("{%s} %s\n", mName, getStateName()));1346 AssertMsgFailed(("{%s} %s\n", mName, i_getStateName())); 1410 1347 break; 1411 1348 } … … 1420 1357 /* No change. */ 1421 1358 case kHostUSBDeviceState_HeldByProxy: 1422 LogThisFunc(("{%s} %s - changed to USED_BY_GUEST...\n", mName, getStateName()));1359 LogThisFunc(("{%s} %s - changed to USED_BY_GUEST...\n", mName, i_getStateName())); 1423 1360 break; 1424 1361 case kHostUSBDeviceState_UsedByVM: … … 1429 1366 case kHostUSBDeviceState_DetachingFromVM: 1430 1367 case kHostUSBDeviceState_PhysDetachingFromVM: 1431 LogThisFunc(("{%s} %s - changed to USED_BY_GUEST...\n", mName, getStateName()));1368 LogThisFunc(("{%s} %s - changed to USED_BY_GUEST...\n", mName, i_getStateName())); 1432 1369 break; 1433 1370 … … 1441 1378 case kHostUSBDeviceState_Capturing: 1442 1379 default: 1443 AssertMsgFailed(("{%s} %s\n", mName, getStateName()));1380 AssertMsgFailed(("{%s} %s\n", mName, i_getStateName())); 1444 1381 break; 1445 1382 } … … 1450 1387 */ 1451 1388 case USBDEVICESTATE_UNSUPPORTED: 1452 AssertMsgFailed(("enmOldState=%d {%s} %s\n", enmOldState, mName, getStateName()));1389 AssertMsgFailed(("enmOldState=%d {%s} %s\n", enmOldState, mName, i_getStateName())); 1453 1390 break; 1454 1391 default: 1455 AssertMsgFailed(("enmState=%d {%s} %s\n", mUsb->enmState, mName, getStateName()));1392 AssertMsgFailed(("enmState=%d {%s} %s\n", mUsb->enmState, mName, i_getStateName())); 1456 1393 break; 1457 1394 } 1458 1395 } 1459 1396 else if ( mUniSubState == kHostUSBDeviceSubState_AwaitingDetach 1460 && hasAsyncOperationTimedOut())1397 && i_hasAsyncOperationTimedOut()) 1461 1398 { 1462 1399 LogRel(("USB: timeout in %s for {%RTuuid} / {%s}\n", 1463 getStateName(), mId.raw(), mName));1464 *aRunFilters = failTransition();1400 i_getStateName(), mId.raw(), mName)); 1401 *aRunFilters = i_failTransition(); 1465 1402 fIsImportant = true; 1466 1403 } 1467 1404 else 1468 1405 { 1469 LogFlowThisFunc(("%p {%s} %s - no change %d\n", this, mName, getStateName(), enmOldState));1406 LogFlowThisFunc(("%p {%s} %s - no change %d\n", this, mName, i_getStateName(), enmOldState)); 1470 1407 /** @todo might have to handle some stuff here too if we cannot make the release/capture handling deal with that above ... */ 1471 1408 } … … 1486 1423 * @returns See HostUSBDevice::updateState() 1487 1424 */ 1488 bool HostUSBDevice:: updateStateFake(PCUSBDEVICE aDev, bool *aRunFilters, SessionMachine **aIgnoreMachine)1425 bool HostUSBDevice::i_updateStateFake(PCUSBDEVICE aDev, bool *aRunFilters, SessionMachine **aIgnoreMachine) 1489 1426 { 1490 1427 Assert(!isWriteLockOnCurrentThread()); … … 1497 1434 { 1498 1435 *aIgnoreMachine = mUniState == kHostUSBDeviceState_ReleasingToHost ? mMachine : NULL; 1499 *aRunFilters = advanceTransition();1500 LogThisFunc(("{%s} %s\n", mName, getStateName()));1436 *aRunFilters = i_advanceTransition(); 1437 LogThisFunc(("{%s} %s\n", mName, i_getStateName())); 1501 1438 1502 1439 if (mUsb != aDev) … … 1518 1455 { 1519 1456 alock.release(); 1520 attachToVM(mMachine, mMaskedIfs);1457 i_attachToVM(mMachine, mMaskedIfs); 1521 1458 } 1522 1459 return true; … … 1525 1462 default: 1526 1463 alock.release(); 1527 return updateState(aDev, aRunFilters, aIgnoreMachine);1464 return i_updateState(aDev, aRunFilters, aIgnoreMachine); 1528 1465 } 1529 1466 } … … 1538 1475 * @note Caller must have read or write locked the object before calling. 1539 1476 */ 1540 bool HostUSBDevice:: hasAsyncOperationTimedOut() const1477 bool HostUSBDevice::i_hasAsyncOperationTimedOut() const 1541 1478 { 1542 1479 switch (mUniSubState) … … 1564 1501 * @param aPendingState 1565 1502 */ 1566 /*static*/ const char *HostUSBDevice:: stateName(HostUSBDeviceState aState,1567 HostUSBDeviceState aPendingState /*= kHostUSBDeviceState_Invalid*/,1568 HostUSBDeviceSubState aSubState /*= kHostUSBDeviceSubState_Default*/)1503 /*static*/ const char *HostUSBDevice::i_stateName(HostUSBDeviceState aState, 1504 HostUSBDeviceState aPendingState /*= kHostUSBDeviceState_Invalid*/, 1505 HostUSBDeviceSubState aSubState /*= kHostUSBDeviceSubState_Default*/) 1569 1506 { 1570 1507 switch (aState) … … 1762 1699 * @note The caller must own the write lock for this object. 1763 1700 */ 1764 bool HostUSBDevice:: setState(HostUSBDeviceState aNewState, HostUSBDeviceState aNewPendingState /*= kHostUSBDeviceState_Invalid*/,1701 bool HostUSBDevice::i_setState(HostUSBDeviceState aNewState, HostUSBDeviceState aNewPendingState /*= kHostUSBDeviceState_Invalid*/, 1765 1702 HostUSBDeviceSubState aNewSubState /*= kHostUSBDeviceSubState_Default*/) 1766 1703 { … … 1782 1719 * Welcome to the switch orgies! 1783 1720 * You're welcome to check out the ones in startTransition(), 1784 * advanceTransition(), failTransition() and getStateName() too. Enjoy!1721 * advanceTransition(), failTransition() and i_getStateName() too. Enjoy! 1785 1722 */ 1786 1723 … … 1800 1737 break; 1801 1738 default: 1802 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1803 stateName(aNewState, aNewPendingState, aNewSubState)), false);1739 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1740 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1804 1741 } 1805 1742 break; … … 1820 1757 break; 1821 1758 default: 1822 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1823 stateName(aNewState, aNewPendingState, aNewSubState)), false);1759 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1760 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1824 1761 } 1825 1762 break; … … 1848 1785 break; 1849 1786 default: 1850 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1851 stateName(aNewState, aNewPendingState, aNewSubState)), false);1787 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1788 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1852 1789 } 1853 1790 break; 1854 1791 default: 1855 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1856 stateName(aNewState, aNewPendingState, aNewSubState)), false);1792 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1793 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1857 1794 } 1858 1795 break; … … 1877 1814 break; 1878 1815 default: 1879 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1880 stateName(aNewState, aNewPendingState, aNewSubState)), false);1816 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1817 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1881 1818 } 1882 1819 break; 1883 1820 default: 1884 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1885 stateName(aNewState, aNewPendingState, aNewSubState)), false);1821 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1822 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1886 1823 } 1887 1824 break; … … 1906 1843 break; 1907 1844 default: 1908 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1909 stateName(aNewState, aNewPendingState, aNewSubState)), false);1845 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1846 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1910 1847 } 1911 1848 break; … … 1916 1853 break; 1917 1854 default: 1918 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1919 stateName(aNewState, aNewPendingState, aNewSubState)), false);1855 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1856 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1920 1857 } 1921 1858 break; 1922 1859 default: 1923 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1924 stateName(aNewState, aNewPendingState, aNewSubState)), false);1860 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1861 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1925 1862 } 1926 1863 break; … … 1944 1881 break; 1945 1882 default: 1946 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1947 stateName(aNewState, aNewPendingState, aNewSubState)), false);1883 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1884 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1948 1885 } 1949 1886 break; 1950 1887 default: 1951 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1952 stateName(aNewState, aNewPendingState, aNewSubState)), false);1888 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1889 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1953 1890 } 1954 1891 break; … … 1974 1911 case kHostUSBDeviceState_UsedByVM: 1975 1912 default: 1976 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),1977 stateName(aNewState, aNewPendingState, aNewSubState)), false);1913 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1914 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 1978 1915 } 1979 1916 break; … … 2026 1963 2027 1964 default: 2028 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),2029 stateName(aNewState, aNewPendingState, aNewSubState)), false);1965 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 1966 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 2030 1967 } 2031 1968 break; … … 2070 2007 2071 2008 default: 2072 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),2073 stateName(aNewState, aNewPendingState, aNewSubState)), false);2009 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 2010 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 2074 2011 } 2075 2012 break; … … 2099 2036 2100 2037 default: 2101 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),2102 stateName(aNewState, aNewPendingState, aNewSubState)), false);2038 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 2039 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 2103 2040 } 2104 2041 break; … … 2135 2072 2136 2073 default: 2137 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),2138 stateName(aNewState, aNewPendingState, aNewSubState)), false);2074 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 2075 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 2139 2076 } 2140 2077 break; … … 2152 2089 break; 2153 2090 default: 2154 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, getStateName(),2155 stateName(aNewState, aNewPendingState, aNewSubState)), false);2091 AssertLogRelMsgFailedReturn(("this=%p %s -X-> %s\n", this, i_getStateName(), 2092 i_stateName(aNewState, aNewPendingState, aNewSubState)), false); 2156 2093 } 2157 2094 break; … … 2166 2103 if (NewPrevState != mPrevUniState) 2167 2104 LogFlowThisFunc(("%s -> %s (prev: %s -> %s) [%s]\n", 2168 getStateName(),stateName(aNewState, aNewPendingState, aNewSubState),2169 stateName(mPrevUniState),stateName(NewPrevState), mName));2105 i_getStateName(), i_stateName(aNewState, aNewPendingState, aNewSubState), 2106 i_stateName(mPrevUniState), i_stateName(NewPrevState), mName)); 2170 2107 else 2171 2108 LogFlowThisFunc(("%s -> %s (prev: %s) [%s]\n", 2172 getStateName(), stateName(aNewState, aNewPendingState, aNewSubState),stateName(NewPrevState), mName));2109 i_getStateName(), i_stateName(aNewState, aNewPendingState, aNewSubState), i_stateName(NewPrevState), mName)); 2173 2110 mPrevUniState = NewPrevState; 2174 2111 mUniState = aNewState; … … 2192 2129 * @note The caller must own the write lock for this object. 2193 2130 */ 2194 bool HostUSBDevice:: startTransition(HostUSBDeviceState aNewState, HostUSBDeviceState aFinalState,2195 HostUSBDeviceSubState aNewSubState /*= kHostUSBDeviceSubState_Default*/)2131 bool HostUSBDevice::i_startTransition(HostUSBDeviceState aNewState, HostUSBDeviceState aFinalState, 2132 HostUSBDeviceSubState aNewSubState /*= kHostUSBDeviceSubState_Default*/) 2196 2133 { 2197 2134 AssertReturn(isWriteLockOnCurrentThread(), false); … … 2215 2152 case kHostUSBDeviceState_AttachingToVM: 2216 2153 case kHostUSBDeviceState_PhysDetachingFromVM: 2217 AssertMsgFailedReturn(("this=%p %s is a transitional state.\n", this, getStateName()), false);2154 AssertMsgFailedReturn(("this=%p %s is a transitional state.\n", this, i_getStateName()), false); 2218 2155 2219 2156 case kHostUSBDeviceState_PhysDetached: … … 2222 2159 } 2223 2160 2224 return setState(aNewState, aFinalState, aNewSubState);2161 return i_setState(aNewState, aFinalState, aNewSubState); 2225 2162 } 2226 2163 … … 2236 2173 * @note The caller must own the write lock for this object. 2237 2174 */ 2238 bool HostUSBDevice:: advanceTransition(bool aSkipReAttach /* = false */)2175 bool HostUSBDevice::i_advanceTransition(bool aSkipReAttach /* = false */) 2239 2176 { 2240 2177 AssertReturn(isWriteLockOnCurrentThread(), false); … … 2264 2201 break; 2265 2202 default: 2266 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, getStateName()), false);2203 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2267 2204 } 2268 2205 break; … … 2292 2229 break; 2293 2230 default: 2294 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, getStateName()), false);2231 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2295 2232 } 2296 2233 break; … … 2317 2254 break; 2318 2255 default: 2319 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, getStateName()), false);2256 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2320 2257 } 2321 2258 break; … … 2345 2282 break; 2346 2283 default: 2347 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, getStateName()), false);2284 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2348 2285 } 2349 2286 break; … … 2364 2301 break; 2365 2302 default: 2366 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, getStateName()), false);2303 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2367 2304 } 2368 2305 break; … … 2378 2315 case kHostUSBDeviceState_HeldByProxy: 2379 2316 case kHostUSBDeviceState_UsedByVM: 2380 AssertMsgFailedReturn(("this=%p %s is not transitional\n", this, getStateName()), false);2317 AssertMsgFailedReturn(("this=%p %s is not transitional\n", this, i_getStateName()), false); 2381 2318 case kHostUSBDeviceState_PhysDetached: 2382 2319 default: … … 2385 2322 } 2386 2323 2387 bool fRc = setState(enmState, enmPending, enmSub);2324 bool fRc = i_setState(enmState, enmPending, enmSub); 2388 2325 if (aSkipReAttach && mUniSubState == kHostUSBDeviceSubState_AwaitingReAttach) 2389 fRc |= advanceTransition(false /* don't fast forward re-attach */);2326 fRc |= i_advanceTransition(false /* don't fast forward re-attach */); 2390 2327 return fRc; 2391 2328 } … … 2398 2335 * @note The caller must own the write lock for this object. 2399 2336 */ 2400 bool HostUSBDevice:: failTransition()2337 bool HostUSBDevice::i_failTransition() 2401 2338 { 2402 2339 AssertReturn(isWriteLockOnCurrentThread(), false); … … 2432 2369 2433 2370 case kHostUSBDeviceState_PhysDetachingFromVM: 2434 AssertMsgFailedReturn(("this=%p %s shall not fail\n", this, getStateName()), false);2371 AssertMsgFailedReturn(("this=%p %s shall not fail\n", this, i_getStateName()), false); 2435 2372 2436 2373 case kHostUSBDeviceState_Unsupported: … … 2440 2377 case kHostUSBDeviceState_HeldByProxy: 2441 2378 case kHostUSBDeviceState_UsedByVM: 2442 AssertMsgFailedReturn(("this=%p %s is not transitional\n", this, getStateName()), false);2379 AssertMsgFailedReturn(("this=%p %s is not transitional\n", this, i_getStateName()), false); 2443 2380 case kHostUSBDeviceState_PhysDetached: 2444 2381 default: … … 2447 2384 } 2448 2385 2449 return setState(enmState, kHostUSBDeviceState_Invalid, enmSub);2386 return i_setState(enmState, kHostUSBDeviceState_Invalid, enmSub); 2450 2387 } 2451 2388 … … 2458 2395 * @note The caller must own the read (or write) lock for this object. 2459 2396 */ 2460 USBDeviceState_T HostUSBDevice:: canonicalState() const2397 USBDeviceState_T HostUSBDevice::i_canonicalState() const 2461 2398 { 2462 2399 switch (mUniState) -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r49951 r49960 2911 2911 *aSnapshotCount = mData->mFirstSnapshot.isNull() 2912 2912 ? 0 2913 : mData->mFirstSnapshot-> getAllChildrenCount() + 1;2913 : mData->mFirstSnapshot->i_getAllChildrenCount() + 1; 2914 2914 2915 2915 return S_OK; … … 4348 4348 AutoReadLock snapLock(snap COMMA_LOCKVAL_SRC_POS); 4349 4349 4350 const MediaData::AttachmentList &snapAtts = snap-> getSnapshotMachine()->mMediaData->mAttachments;4350 const MediaData::AttachmentList &snapAtts = snap->i_getSnapshotMachine()->mMediaData->mAttachments; 4351 4351 4352 4352 MediumAttachment *pAttachFound = NULL; … … 4395 4395 } 4396 4396 4397 snap = snap-> getParent();4397 snap = snap->i_getParent(); 4398 4398 } 4399 4399 … … 5475 5475 size_t cSnapshots = 0; 5476 5476 if (mData->mFirstSnapshot) 5477 cSnapshots = mData->mFirstSnapshot-> getAllChildrenCount() + 1;5477 cSnapshots = mData->mFirstSnapshot->i_getAllChildrenCount() + 1; 5478 5478 if (cSnapshots && cleanupMode == CleanupMode_UnregisterOnly) 5479 5479 // fail now before we start detaching media … … 5525 5525 5526 5526 // GO! 5527 pFirstSnapshot-> uninitRecursively(alock, cleanupMode, llMedia, mData->llFilesToDelete);5527 pFirstSnapshot->i_uninitRecursively(alock, cleanupMode, llMedia, mData->llFilesToDelete); 5528 5528 5529 5529 mData->mMachineState = oldState; … … 9201 9201 /* memorize the current snapshot when appropriate */ 9202 9202 if ( !mData->mCurrentSnapshot 9203 && pSnapshot-> getId() == aCurSnapshotId9203 && pSnapshot->i_getId() == aCurSnapshotId 9204 9204 ) 9205 9205 mData->mCurrentSnapshot = pSnapshot; … … 9865 9865 aSnapshot = mData->mFirstSnapshot; 9866 9866 else 9867 aSnapshot = mData->mFirstSnapshot-> findChildOrSelf(aId.ref());9867 aSnapshot = mData->mFirstSnapshot->i_findChildOrSelf(aId.ref()); 9868 9868 9869 9869 if (!aSnapshot) … … 9902 9902 } 9903 9903 9904 aSnapshot = mData->mFirstSnapshot-> findChildOrSelf(strName);9904 aSnapshot = mData->mFirstSnapshot->i_findChildOrSelf(strName); 9905 9905 9906 9906 if (!aSnapshot) … … 10192 10192 // and do the same thing for the saved state file paths of all the online snapshots 10193 10193 if (mData->mFirstSnapshot) 10194 mData->mFirstSnapshot-> updateSavedStatePaths(configDir.c_str(),10195 newConfigDir.c_str());10194 mData->mFirstSnapshot->i_updateSavedStatePaths(configDir.c_str(), 10195 newConfigDir.c_str()); 10196 10196 } 10197 10197 while (0); … … 10461 10461 10462 10462 if (mData->mCurrentSnapshot) 10463 config.uuidCurrentSnapshot = mData->mCurrentSnapshot-> getId();10463 config.uuidCurrentSnapshot = mData->mCurrentSnapshot->i_getId(); 10464 10464 else 10465 10465 config.uuidCurrentSnapshot.clear(); … … 10517 10517 settings::Snapshot &snap = config.llFirstSnapshot.front(); 10518 10518 10519 rc = mData->mFirstSnapshot-> saveSnapshot(snap, false /*aAttrsOnly*/);10519 rc = mData->mFirstSnapshot->i_saveSnapshot(snap, false /*aAttrsOnly*/); 10520 10520 if (FAILED(rc)) throw rc; 10521 10521 } … … 11638 11638 // if this is from a snapshot, do not defer detachment to commitMedia() 11639 11639 if (pSnapshot) 11640 oldmedium->i_removeBackReference(mData->mUuid, pSnapshot-> getId());11640 oldmedium->i_removeBackReference(mData->mUuid, pSnapshot->i_getId()); 11641 11641 // else if non-hard disk media, do not defer detachment to commitMedia() either 11642 11642 else if (mediumType != DeviceType_HardDisk) … … 13042 13042 // AFTER killing the snapshot so that releaseSavedStateFile() won't 13043 13043 // think it's still in use 13044 Utf8Str strStateFile = mConsoleTaskData.mSnapshot-> getStateFilePath();13044 Utf8Str strStateFile = mConsoleTaskData.mSnapshot->i_getStateFilePath(); 13045 13045 mConsoleTaskData.mSnapshot->uninit(); 13046 13046 releaseSavedStateFile(strStateFile, NULL /* pSnapshotToIgnore */ ); … … 14671 14671 // ... and it must also not be shared with other snapshots 14672 14672 if ( !mData->mFirstSnapshot 14673 || !mData->mFirstSnapshot-> sharesSavedStateFile(strStateFile, pSnapshotToIgnore)14673 || !mData->mFirstSnapshot->i_sharesSavedStateFile(strStateFile, pSnapshotToIgnore) 14674 14674 // this checks the SnapshotMachine's state file paths 14675 14675 ) … … 14937 14937 // it is safe to delete the saved state file if ... 14938 14938 if ( !mData->mFirstSnapshot // ... we have no snapshots or 14939 || !mData->mFirstSnapshot-> sharesSavedStateFile(mSSData->strStateFilePath, NULL /* pSnapshotToIgnore */)14939 || !mData->mFirstSnapshot->i_sharesSavedStateFile(mSSData->strStateFilePath, NULL /* pSnapshotToIgnore */) 14940 14940 // ... none of the snapshots share the saved state file 14941 14941 ) -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r49871 r49960 43 43 #include <VBox/settings.h> 44 44 45 46 45 //////////////////////////////////////////////////////////////////////////////// 47 46 // … … 82 81 // 83 82 //////////////////////////////////////////////////////////////////////////////// 83 DEFINE_EMPTY_CTOR_DTOR(Snapshot) 84 84 85 85 HRESULT Snapshot::FinalConstruct() … … 176 176 177 177 if (m->pParent) 178 deparent();178 i_deparent(); 179 179 180 180 if (m->pMachine) … … 200 200 * lock in write mode AND the machine state must be DeletingSnapshot. 201 201 */ 202 void Snapshot:: beginSnapshotDelete()202 void Snapshot::i_beginSnapshotDelete() 203 203 { 204 204 AutoCaller autoCaller(this); … … 266 266 * The caller must hold the machine lock in write mode (which protects the snapshots tree)! 267 267 */ 268 void Snapshot:: deparent()268 void Snapshot::i_deparent() 269 269 { 270 270 Assert(m->pMachine->isWriteLockOnCurrentThread()); … … 292 292 //////////////////////////////////////////////////////////////////////////////// 293 293 294 STDMETHODIMP Snapshot::COMGETTER(Id)(BSTR *aId) 295 { 296 CheckComArgOutPointerValid(aId); 297 298 AutoCaller autoCaller(this); 299 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 300 294 HRESULT Snapshot::getId(com::Guid &aId) 295 { 301 296 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 302 297 303 m->uuid.toUtf16().cloneTo(aId); 298 aId = m->uuid; 299 304 300 return S_OK; 305 301 } 306 302 307 STDMETHODIMP Snapshot::COMGETTER(Name)(BSTR *aName) 308 { 309 CheckComArgOutPointerValid(aName); 310 311 AutoCaller autoCaller(this); 312 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 313 303 HRESULT Snapshot::getName(com::Utf8Str &aName) 304 { 314 305 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 315 316 m->strName.cloneTo(aName); 306 aName = m->strName; 317 307 return S_OK; 318 308 } … … 322 312 * (see its lock requirements). 323 313 */ 324 STDMETHODIMP Snapshot::COMSETTER(Name)(IN_BSTRaName)314 HRESULT Snapshot::setName(const com::Utf8Str &aName) 325 315 { 326 316 HRESULT rc = S_OK; 327 CheckComArgStrNotEmptyOrNull(aName);328 317 329 318 // prohibit setting a UUID only as the machine name, or else it can … … 334 323 return setError(E_INVALIDARG, tr("A machine cannot have a UUID as its name")); 335 324 336 AutoCaller autoCaller(this);337 if (FAILED(autoCaller.rc())) return autoCaller.rc();338 339 Utf8Str strName(aName);340 341 325 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 342 326 343 if (m->strName != strName)344 { 345 m->strName = strName;327 if (m->strName != aName) 328 { 329 m->strName = aName; 346 330 alock.release(); /* Important! (child->parent locks are forbidden) */ 347 331 rc = m->pMachine->onSnapshotChange(this); … … 351 335 } 352 336 353 STDMETHODIMP Snapshot::COMGETTER(Description)(BSTR *aDescription) 354 { 355 CheckComArgOutPointerValid(aDescription); 356 357 AutoCaller autoCaller(this); 358 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 359 337 HRESULT Snapshot::getDescription(com::Utf8Str &aDescription) 338 { 360 339 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 361 362 m->strDescription.cloneTo(aDescription); 340 aDescription = m->strDescription; 363 341 return S_OK; 364 342 } 365 343 366 STDMETHODIMP Snapshot::COMSETTER(Description)(IN_BSTRaDescription)344 HRESULT Snapshot::setDescription(const com::Utf8Str &aDescription) 367 345 { 368 346 HRESULT rc = S_OK; 369 AutoCaller autoCaller(this);370 if (FAILED(autoCaller.rc())) return autoCaller.rc();371 372 Utf8Str strDescription(aDescription);373 347 374 348 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 375 376 if (m->strDescription != strDescription) 377 { 378 m->strDescription = strDescription; 349 if (m->strDescription != aDescription) 350 { 351 m->strDescription = aDescription; 379 352 alock.release(); /* Important! (child->parent locks are forbidden) */ 380 353 rc = m->pMachine->onSnapshotChange(this); … … 384 357 } 385 358 386 STDMETHODIMP Snapshot::COMGETTER(TimeStamp)(LONG64 *aTimeStamp) 387 { 388 CheckComArgOutPointerValid(aTimeStamp); 389 390 AutoCaller autoCaller(this); 391 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 392 359 HRESULT Snapshot::getTimeStamp(LONG64 *aTimeStamp) 360 { 393 361 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 394 362 … … 397 365 } 398 366 399 STDMETHODIMP Snapshot::COMGETTER(Online)(BOOL *aOnline) 400 { 401 CheckComArgOutPointerValid(aOnline); 402 403 AutoCaller autoCaller(this); 404 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 405 367 HRESULT Snapshot::getOnline(BOOL *aOnline) 368 { 406 369 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 407 370 408 *aOnline = getStateFilePath().isNotEmpty();371 *aOnline = i_getStateFilePath().isNotEmpty(); 409 372 return S_OK; 410 373 } 411 374 412 STDMETHODIMP Snapshot::COMGETTER(Machine)(IMachine **aMachine) 413 { 414 CheckComArgOutPointerValid(aMachine); 415 416 AutoCaller autoCaller(this); 417 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 418 375 HRESULT Snapshot::getMachine(ComPtr<IMachine> &aMachine) 376 { 419 377 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 420 378 421 m->pMachine.queryInterfaceTo(aMachine); 379 m->pMachine.queryInterfaceTo(aMachine.asOutParam()); 380 422 381 return S_OK; 423 382 } 424 383 425 STDMETHODIMP Snapshot::COMGETTER(Parent)(ISnapshot **aParent) 426 { 427 CheckComArgOutPointerValid(aParent); 428 429 AutoCaller autoCaller(this); 430 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 431 384 385 HRESULT Snapshot::getParent(ComPtr<ISnapshot> &aParent) 386 { 432 387 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 433 388 434 m->pParent.queryInterfaceTo(aParent );389 m->pParent.queryInterfaceTo(aParent.asOutParam()); 435 390 return S_OK; 436 391 } 437 392 438 STDMETHODIMP Snapshot::COMGETTER(Children)(ComSafeArrayOut(ISnapshot *, aChildren)) 439 { 440 CheckComArgOutSafeArrayPointerValid(aChildren); 441 442 AutoCaller autoCaller(this); 443 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 444 393 HRESULT Snapshot::getChildren(std::vector<ComPtr<ISnapshot> > &aChildren) 394 { 445 395 // snapshots tree is protected by machine lock 446 396 AutoReadLock alock(m->pMachine COMMA_LOCKVAL_SRC_POS); 447 448 SafeIfaceArray<ISnapshot> collection(m->llChildren); 449 collection.detachTo(ComSafeArrayOutArg(aChildren)); 450 397 aChildren.resize(0); 398 for (SnapshotsList::const_iterator it = m->llChildren.begin(); 399 it != m->llChildren.end(); 400 ++it) 401 aChildren.push_back(*it); 451 402 return S_OK; 452 403 } 453 404 454 STDMETHODIMP Snapshot::GetChildrenCount(ULONG* count) 455 { 456 CheckComArgOutPointerValid(count); 457 458 *count = getChildrenCount(); 405 HRESULT Snapshot::getChildrenCount(ULONG* count) 406 { 407 *count = i_getChildrenCount(); 459 408 460 409 return S_OK; … … 471 420 * @return 472 421 */ 473 const ComObjPtr<Snapshot>& Snapshot:: getParent() const422 const ComObjPtr<Snapshot>& Snapshot::i_getParent() const 474 423 { 475 424 return m->pParent; … … 480 429 * @return 481 430 */ 482 const ComObjPtr<Snapshot> Snapshot:: getFirstChild() const431 const ComObjPtr<Snapshot> Snapshot::i_getFirstChild() const 483 432 { 484 433 if (!m->llChildren.size()) … … 491 440 * Must be called from under the object's lock! 492 441 */ 493 const Utf8Str& Snapshot:: getStateFilePath() const442 const Utf8Str& Snapshot::i_getStateFilePath() const 494 443 { 495 444 return m->pMachine->mSSData->strStateFilePath; … … 502 451 */ 503 452 504 uint32_t Snapshot:: getDepth()453 uint32_t Snapshot::i_getDepth() 505 454 { 506 455 AutoCaller autoCaller(this); … … 526 475 * @return 527 476 */ 528 ULONG Snapshot:: getChildrenCount()477 ULONG Snapshot::i_getChildrenCount() 529 478 { 530 479 AutoCaller autoCaller(this); … … 542 491 * @return 543 492 */ 544 ULONG Snapshot:: getAllChildrenCountImpl()493 ULONG Snapshot::i_getAllChildrenCountImpl() 545 494 { 546 495 AutoCaller autoCaller(this); … … 552 501 ++it) 553 502 { 554 count += (*it)-> getAllChildrenCountImpl();503 count += (*it)->i_getAllChildrenCountImpl(); 555 504 } 556 505 … … 563 512 * @return 564 513 */ 565 ULONG Snapshot:: getAllChildrenCount()514 ULONG Snapshot::i_getAllChildrenCount() 566 515 { 567 516 AutoCaller autoCaller(this); … … 571 520 AutoReadLock alock(m->pMachine COMMA_LOCKVAL_SRC_POS); 572 521 573 return getAllChildrenCountImpl();522 return i_getAllChildrenCountImpl(); 574 523 } 575 524 … … 579 528 * @return 580 529 */ 581 const ComObjPtr<SnapshotMachine>& Snapshot:: getSnapshotMachine() const530 const ComObjPtr<SnapshotMachine>& Snapshot::i_getSnapshotMachine() const 582 531 { 583 532 return m->pMachine; … … 589 538 * @return 590 539 */ 591 Guid Snapshot:: getId() const540 Guid Snapshot::i_getId() const 592 541 { 593 542 return m->uuid; … … 599 548 * @return 600 549 */ 601 const Utf8Str& Snapshot:: getName() const550 const Utf8Str& Snapshot::i_getName() const 602 551 { 603 552 return m->strName; … … 609 558 * @return 610 559 */ 611 RTTIMESPEC Snapshot:: getTimeStamp() const560 RTTIMESPEC Snapshot::i_getTimeStamp() const 612 561 { 613 562 return m->timeStamp; … … 620 569 * Caller must hold the machine lock (which protects the snapshots tree!) 621 570 */ 622 ComObjPtr<Snapshot> Snapshot:: findChildOrSelf(IN_GUID aId)571 ComObjPtr<Snapshot> Snapshot::i_findChildOrSelf(IN_GUID aId) 623 572 { 624 573 ComObjPtr<Snapshot> child; … … 636 585 ++it) 637 586 { 638 if ((child = (*it)-> findChildOrSelf(aId)))587 if ((child = (*it)->i_findChildOrSelf(aId))) 639 588 break; 640 589 } … … 651 600 * Caller must hold the machine lock (which protects the snapshots tree!) 652 601 */ 653 ComObjPtr<Snapshot> Snapshot:: findChildOrSelf(const Utf8Str &aName)602 ComObjPtr<Snapshot> Snapshot::i_findChildOrSelf(const Utf8Str &aName) 654 603 { 655 604 ComObjPtr<Snapshot> child; … … 670 619 ++it) 671 620 { 672 if ((child = (*it)-> findChildOrSelf(aName)))621 if ((child = (*it)->i_findChildOrSelf(aName))) 673 622 break; 674 623 } … … 683 632 * @param aNewPath 684 633 */ 685 void Snapshot:: updateSavedStatePathsImpl(const Utf8Str &strOldPath,686 const Utf8Str &strNewPath)634 void Snapshot::i_updateSavedStatePathsImpl(const Utf8Str &strOldPath, 635 const Utf8Str &strNewPath) 687 636 { 688 637 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 707 656 { 708 657 Snapshot *pChild = *it; 709 pChild-> updateSavedStatePathsImpl(strOldPath, strNewPath);658 pChild->i_updateSavedStatePathsImpl(strOldPath, strNewPath); 710 659 } 711 660 } … … 723 672 * @return 724 673 */ 725 bool Snapshot:: sharesSavedStateFile(const Utf8Str &strPath,726 Snapshot *pSnapshotToIgnore)674 bool Snapshot::i_sharesSavedStateFile(const Utf8Str &strPath, 675 Snapshot *pSnapshotToIgnore) 727 676 { 728 677 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 741 690 Snapshot *pChild = *it; 742 691 if (!pSnapshotToIgnore || pSnapshotToIgnore != pChild) 743 if (pChild-> sharesSavedStateFile(strPath, pSnapshotToIgnore))692 if (pChild->i_sharesSavedStateFile(strPath, pSnapshotToIgnore)) 744 693 return true; 745 694 } … … 760 709 * @note Locks the machine (for the snapshots tree) + this object + children for writing. 761 710 */ 762 void Snapshot:: updateSavedStatePaths(const Utf8Str &strOldPath,763 const Utf8Str &strNewPath)711 void Snapshot::i_updateSavedStatePaths(const Utf8Str &strOldPath, 712 const Utf8Str &strNewPath) 764 713 { 765 714 LogFlowThisFunc(("aOldPath={%s} aNewPath={%s}\n", strOldPath.c_str(), strNewPath.c_str())); … … 772 721 773 722 // call the implementation under the tree lock 774 updateSavedStatePathsImpl(strOldPath, strNewPath);723 i_updateSavedStatePathsImpl(strOldPath, strNewPath); 775 724 } 776 725 … … 783 732 * @return 784 733 */ 785 HRESULT Snapshot:: saveSnapshotImpl(settings::Snapshot &data, bool aAttrsOnly)734 HRESULT Snapshot::i_saveSnapshotImpl(settings::Snapshot &data, bool aAttrsOnly) 786 735 { 787 736 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 796 745 797 746 // state file (only if this snapshot is online) 798 if ( getStateFilePath().isNotEmpty())799 m->pMachine->copyPathRelativeToMachine( getStateFilePath(), data.strStateFile);747 if (i_getStateFilePath().isNotEmpty()) 748 m->pMachine->copyPathRelativeToMachine(i_getStateFilePath(), data.strStateFile); 800 749 else 801 750 data.strStateFile.setNull(); … … 822 771 823 772 settings::Snapshot *snap = new settings::Snapshot(); 824 rc = (*it)-> saveSnapshotImpl(*snap, aAttrsOnly);773 rc = (*it)->i_saveSnapshotImpl(*snap, aAttrsOnly); 825 774 if (FAILED(rc)) 826 775 { … … 844 793 * @param aAttrsOnly If true, only update user-changeable attrs. 845 794 */ 846 HRESULT Snapshot:: saveSnapshot(settings::Snapshot &data, bool aAttrsOnly)795 HRESULT Snapshot::i_saveSnapshot(settings::Snapshot &data, bool aAttrsOnly) 847 796 { 848 797 // snapshots tree is protected by machine lock 849 798 AutoReadLock alock(m->pMachine COMMA_LOCKVAL_SRC_POS); 850 799 851 return saveSnapshotImpl(data, aAttrsOnly);800 return i_saveSnapshotImpl(data, aAttrsOnly); 852 801 } 853 802 … … 875 824 * @return 876 825 */ 877 HRESULT Snapshot:: uninitRecursively(AutoWriteLock &writeLock,878 CleanupMode_T cleanupMode,879 MediaList &llMedia,880 std::list<Utf8Str> &llFilenames)826 HRESULT Snapshot::i_uninitRecursively(AutoWriteLock &writeLock, 827 CleanupMode_T cleanupMode, 828 MediaList &llMedia, 829 std::list<Utf8Str> &llFilenames) 881 830 { 882 831 Assert(m->pMachine->isWriteLockOnCurrentThread()); … … 886 835 // make a copy of the Guid for logging before we uninit ourselves 887 836 #ifdef LOG_ENABLED 888 Guid uuid = getId();889 Utf8Str name = getName();837 Guid uuid = i_getId(); 838 Utf8Str name = i_getName(); 890 839 LogFlowThisFunc(("Entering for snapshot '%s' {%RTuuid}\n", name.c_str(), uuid.raw())); 891 840 #endif … … 903 852 { 904 853 Snapshot *pChild = *it; 905 rc = pChild-> uninitRecursively(writeLock, cleanupMode, llMedia, llFilenames);854 rc = pChild->i_uninitRecursively(writeLock, cleanupMode, llMedia, llFilenames); 906 855 if (FAILED(rc)) 907 856 return rc; … … 935 884 } 936 885 937 this-> beginSnapshotDelete();886 this->i_beginSnapshotDelete(); 938 887 this->uninit(); 939 888 … … 1289 1238 AutoMultiWriteLock2 mlock(this, aSnapshot COMMA_LOCKVAL_SRC_POS); 1290 1239 Guid uuidMachine(mData->mUuid), 1291 uuidSnapshot(aSnapshot-> getId());1240 uuidSnapshot(aSnapshot->i_getId()); 1292 1241 bool fNeedsGlobalSaveSettings = false; 1293 1242 … … 1471 1420 1472 1421 if ( mData->mCurrentSnapshot 1473 && mData->mCurrentSnapshot-> getDepth() >= SETTINGS_SNAPSHOT_DEPTH_MAX)1422 && mData->mCurrentSnapshot->i_getDepth() >= SETTINGS_SNAPSHOT_DEPTH_MAX) 1474 1423 { 1475 1424 return setError(VBOX_E_INVALID_OBJECT_STATE, … … 1677 1626 /* inform callbacks */ 1678 1627 mParent->onSnapshotTaken(mData->mUuid, 1679 mConsoleTaskData.mSnapshot-> getId());1628 mConsoleTaskData.mSnapshot->i_getId()); 1680 1629 machineLock.release(); 1681 1630 } … … 1696 1645 // snapshot means that a new saved state file was created, which we must 1697 1646 // clean up now 1698 RTFileDelete(mConsoleTaskData.mSnapshot-> getStateFilePath().c_str());1647 RTFileDelete(mConsoleTaskData.mSnapshot->i_getStateFilePath().c_str()); 1699 1648 machineLock.acquire(); 1700 1649 … … 1763 1712 1764 1713 ComObjPtr<Snapshot> pSnapshot(static_cast<Snapshot*>(aSnapshot)); 1765 ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot-> getSnapshotMachine();1714 ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot->i_getSnapshotMachine(); 1766 1715 1767 1716 // create a progress object. The number of operations is: … … 1789 1738 pProgress.createObject(); 1790 1739 pProgress->init(mParent, aInitiator, 1791 BstrFmt(tr("Restoring snapshot '%s'"), pSnapshot-> getName().c_str()).raw(),1740 BstrFmt(tr("Restoring snapshot '%s'"), pSnapshot->i_getName().c_str()).raw(), 1792 1741 FALSE /* aCancelable */, 1793 1742 ulOpCount, … … 1900 1849 1901 1850 /* remember the timestamp of the snapshot we're restoring from */ 1902 snapshotTimeStamp = aTask.pSnapshot-> getTimeStamp();1903 1904 ComPtr<SnapshotMachine> pSnapshotMachine(aTask.pSnapshot-> getSnapshotMachine());1851 snapshotTimeStamp = aTask.pSnapshot->i_getTimeStamp(); 1852 1853 ComPtr<SnapshotMachine> pSnapshotMachine(aTask.pSnapshot->i_getSnapshotMachine()); 1905 1854 1906 1855 /* copy all hardware data from the snapshot */ … … 1944 1893 Assert(mSSData->strStateFilePath.isEmpty()); 1945 1894 1946 const Utf8Str &strSnapshotStateFile = aTask.pSnapshot-> getStateFilePath();1895 const Utf8Str &strSnapshotStateFile = aTask.pSnapshot->i_getStateFilePath(); 1947 1896 1948 1897 if (strSnapshotStateFile.isNotEmpty()) … … 1950 1899 mSSData->strStateFilePath = strSnapshotStateFile; 1951 1900 1952 LogFlowThisFunc(("Setting new current snapshot {%RTuuid}\n", aTask.pSnapshot-> getId().raw()));1901 LogFlowThisFunc(("Setting new current snapshot {%RTuuid}\n", aTask.pSnapshot->i_getId().raw())); 1953 1902 /* make the snapshot we restored from the current snapshot */ 1954 1903 mData->mCurrentSnapshot = aTask.pSnapshot; … … 2162 2111 AutoWriteLock snapshotLock(pSnapshot COMMA_LOCKVAL_SRC_POS); 2163 2112 2164 size_t childrenCount = pSnapshot-> getChildrenCount();2113 size_t childrenCount = pSnapshot->i_getChildrenCount(); 2165 2114 if (childrenCount > 1) 2166 2115 return setError(VBOX_E_INVALID_OBJECT_STATE, 2167 2116 tr("Snapshot '%s' of the machine '%s' cannot be deleted, because it has %d child snapshots, which is more than the one snapshot allowed for deletion"), 2168 pSnapshot-> getName().c_str(),2117 pSnapshot->i_getName().c_str(), 2169 2118 mUserData->s.strName.c_str(), 2170 2119 childrenCount); … … 2173 2122 return setError(VBOX_E_INVALID_OBJECT_STATE, 2174 2123 tr("Snapshot '%s' of the machine '%s' cannot be deleted, because it is the current snapshot and has one child snapshot"), 2175 pSnapshot-> getName().c_str(),2124 pSnapshot->i_getName().c_str(), 2176 2125 mUserData->s.strName.c_str()); 2177 2126 … … 2190 2139 } 2191 2140 2192 ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot-> getSnapshotMachine();2141 ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot->i_getSnapshotMachine(); 2193 2142 2194 2143 /* create a progress object. The number of operations is: … … 2200 2149 ULONG ulTotalWeight = 1; // one for preparations 2201 2150 2202 if (pSnapshot-> getStateFilePath().length())2151 if (pSnapshot->i_getStateFilePath().length()) 2203 2152 { 2204 2153 ++ulOpCount; … … 2237 2186 pProgress.createObject(); 2238 2187 pProgress->init(mParent, aInitiator, 2239 BstrFmt(tr("Deleting snapshot '%s'"), pSnapshot-> getName().c_str()).raw(),2188 BstrFmt(tr("Deleting snapshot '%s'"), pSnapshot->i_getName().c_str()).raw(), 2240 2189 FALSE /* aCancelable */, 2241 2190 ulOpCount, … … 2413 2362 2414 2363 AutoWriteLock treeLock(mParent->getMediaTreeLockHandle() 2415 2416 2417 ComObjPtr<SnapshotMachine> pSnapMachine = aTask.pSnapshot-> getSnapshotMachine();2364 COMMA_LOCKVAL_SRC_POS); 2365 2366 ComObjPtr<SnapshotMachine> pSnapMachine = aTask.pSnapshot->i_getSnapshotMachine(); 2418 2367 // no need to lock the snapshot machine since it is const by definition 2419 2368 Guid machineId = pSnapMachine->getId(); 2420 2369 2421 2370 // save the snapshot ID (for callbacks) 2422 snapshotId = aTask.pSnapshot-> getId();2371 snapshotId = aTask.pSnapshot->i_getId(); 2423 2372 2424 2373 // first pass: … … 2702 2651 AutoWriteLock machineLock(this COMMA_LOCKVAL_SRC_POS); 2703 2652 2704 Utf8Str stateFilePath = aTask.pSnapshot-> getStateFilePath();2653 Utf8Str stateFilePath = aTask.pSnapshot->i_getStateFilePath(); 2705 2654 if (!stateFilePath.isEmpty()) 2706 2655 { … … 2862 2811 ComObjPtr<Machine> pMachine = this; 2863 2812 Guid childSnapshotId; 2864 ComObjPtr<Snapshot> pChildSnapshot = aTask.pSnapshot-> getFirstChild();2813 ComObjPtr<Snapshot> pChildSnapshot = aTask.pSnapshot->i_getFirstChild(); 2865 2814 if (pChildSnapshot) 2866 2815 { 2867 pMachine = pChildSnapshot-> getSnapshotMachine();2868 childSnapshotId = pChildSnapshot-> getId();2816 pMachine = pChildSnapshot->i_getSnapshotMachine(); 2817 childSnapshotId = pChildSnapshot->i_getId(); 2869 2818 } 2870 2819 pAtt = findAttachment(pMachine->mMediaData->mAttachments, it->mpSource); … … 2907 2856 AutoWriteLock machineLock(this COMMA_LOCKVAL_SRC_POS); 2908 2857 2909 aTask.pSnapshot-> beginSnapshotDelete();2858 aTask.pSnapshot->i_beginSnapshotDelete(); 2910 2859 aTask.pSnapshot->uninit(); 2911 2860 … … 3113 3062 alock.release(); 3114 3063 rc = aSource->i_prepareMergeTo(aTarget, &aMachineId, &aSnapshotId, 3115 !fOnlineMergePossible /* fLockMedia */,3116 aMergeForward, aParentForTarget,3117 aChildrenToReparent, aMediumLockList);3064 !fOnlineMergePossible /* fLockMedia */, 3065 aMergeForward, aParentForTarget, 3066 aChildrenToReparent, aMediumLockList); 3118 3067 alock.acquire(); 3119 3068 childLock.acquire(); -
trunk/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp
r49951 r49960 892 892 { 893 893 AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS); 894 if (aDevice->i sMatch((*it)->i_getData()))894 if (aDevice->i_isMatch((*it)->i_getData())) 895 895 { 896 896 *aMaskedIfs = (*it)->i_getData().mMaskedIfs; -
trunk/src/VBox/Main/src-server/USBProxyService.cpp
r49951 r49960 182 182 */ 183 183 alock.release(); 184 return pHostDevice-> requestCaptureForVM(aMachine, true /* aSetError */);184 return pHostDevice->i_requestCaptureForVM(aMachine, true /* aSetError */); 185 185 } 186 186 … … 230 230 */ 231 231 LogFlowThisFunc(("id={%RTuuid} state=%s aDone=%RTbool name={%s}\n", 232 pHostDevice-> getId().raw(), pHostDevice->getStateName(), aDone, pHostDevice->getName().c_str()));232 pHostDevice->i_getId().raw(), pHostDevice->i_getStateName(), aDone, pHostDevice->i_getName().c_str())); 233 233 bool fRunFilters = false; 234 HRESULT hrc = pHostDevice-> onDetachFromVM(aMachine, aDone, &fRunFilters);234 HRESULT hrc = pHostDevice->i_onDetachFromVM(aMachine, aDone, &fRunFilters); 235 235 236 236 /* … … 240 240 && fRunFilters) 241 241 { 242 Assert(aDone && pHostDevice-> getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->getMachine().isNull());242 Assert(aDone && pHostDevice->i_getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->i_getMachine().isNull()); 243 243 devLock.release(); 244 244 alock.release(); … … 290 290 ComObjPtr<HostUSBDevice> device = *it; 291 291 AutoReadLock devLock(device COMMA_LOCKVAL_SRC_POS); 292 if ( device-> getUnistate() == kHostUSBDeviceState_HeldByProxy293 || device-> getUnistate() == kHostUSBDeviceState_Unused294 || device-> getUnistate() == kHostUSBDeviceState_Capturable)292 if ( device->i_getUnistate() == kHostUSBDeviceState_HeldByProxy 293 || device->i_getUnistate() == kHostUSBDeviceState_Unused 294 || device->i_getUnistate() == kHostUSBDeviceState_Capturable) 295 295 { 296 296 devLock.release(); … … 346 346 ComObjPtr<HostUSBDevice> pHostDevice = *it; 347 347 AutoWriteLock devLock(pHostDevice COMMA_LOCKVAL_SRC_POS); 348 if (pHostDevice-> getMachine() == aMachine)348 if (pHostDevice->i_getMachine() == aMachine) 349 349 { 350 350 /* … … 352 352 */ 353 353 bool fRunFilters = false; 354 HRESULT hrc = pHostDevice-> onDetachFromVM(aMachine, aDone, &fRunFilters, aAbnormal);354 HRESULT hrc = pHostDevice->i_onDetachFromVM(aMachine, aDone, &fRunFilters, aAbnormal); 355 355 if ( SUCCEEDED(hrc) 356 356 && fRunFilters) 357 357 { 358 Assert(aDone && pHostDevice-> getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->getMachine().isNull());358 Assert(aDone && pHostDevice->i_getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->i_getMachine().isNull()); 359 359 devLock.release(); 360 360 alock.release(); … … 395 395 SessionMachine *aIgnoreMachine) 396 396 { 397 LogFlowThisFunc(("{%s} ignoring=%p\n", aDevice-> getName().c_str(), aIgnoreMachine));397 LogFlowThisFunc(("{%s} ignoring=%p\n", aDevice->i_getName().c_str(), aIgnoreMachine)); 398 398 399 399 /* … … 404 404 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 405 405 AutoWriteLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 406 AssertMsgReturn(aDevice->i sCapturableOrHeld(), ("{%s} %s\n", aDevice->getName().c_str(), aDevice->getStateName()), E_FAIL);406 AssertMsgReturn(aDevice->i_isCapturableOrHeld(), ("{%s} %s\n", aDevice->i_getName().c_str(), aDevice->i_getStateName()), E_FAIL); 407 407 408 408 /* … … 423 423 AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS); 424 424 const HostUSBDeviceFilter::Data &data = (*it)->i_getData(); 425 if (aDevice->i sMatch(data))425 if (aDevice->i_isMatch(data)) 426 426 { 427 427 USBDeviceFilterAction_T action = USBDeviceFilterAction_Null; … … 435 435 devLock.release(); 436 436 alock.release(); 437 aDevice-> requestReleaseToHost();437 aDevice->i_requestReleaseToHost(); 438 438 return S_OK; 439 439 } … … 471 471 if (runMachineFilters(pMachine, aDevice)) 472 472 { 473 LogFlowThisFunc(("{%s} attached to %p\n", aDevice-> getName().c_str(), (void *)pMachine));473 LogFlowThisFunc(("{%s} attached to %p\n", aDevice->i_getName().c_str(), (void *)pMachine)); 474 474 return S_OK; 475 475 } … … 485 485 alock.release(); 486 486 if (fHoldIt) 487 aDevice-> requestHold();487 aDevice->i_requestHold(); 488 488 else 489 aDevice-> requestReleaseToHost();489 aDevice->i_requestReleaseToHost(); 490 490 return S_OK; 491 491 } … … 506 506 bool USBProxyService::runMachineFilters(SessionMachine *aMachine, ComObjPtr<HostUSBDevice> &aDevice) 507 507 { 508 LogFlowThisFunc(("{%s} aMachine=%p \n", aDevice-> getName().c_str(), aMachine));508 LogFlowThisFunc(("{%s} aMachine=%p \n", aDevice->i_getName().c_str(), aMachine)); 509 509 510 510 /* … … 524 524 { 525 525 /* try to capture the device */ 526 HRESULT hrc = aDevice-> requestCaptureForVM(aMachine, false /* aSetError */, ulMaskedIfs);526 HRESULT hrc = aDevice->i_requestCaptureForVM(aMachine, false /* aSetError */, ulMaskedIfs); 527 527 return SUCCEEDED(hrc) 528 528 || hrc == E_UNEXPECTED /* bad device state, give up */; … … 814 814 PUSBDEVICE pCur = pTail; 815 815 while ( pCur 816 && HostUSBDevice:: compare(pCur, pDev) > 0)816 && HostUSBDevice::i_compare(pCur, pDev) > 0) 817 817 pCur = pCur->pPrev; 818 818 … … 904 904 iDiff = -1; 905 905 else 906 iDiff = pHostDevice-> compare(pDevices);906 iDiff = pHostDevice->i_compare(pDevices); 907 907 } 908 908 if (!iDiff) … … 943 943 Log(("USBProxyService::processChanges: attached %p {%s} %s / %p:{.idVendor=%#06x, .idProduct=%#06x, .pszProduct=\"%s\", .pszManufacturer=\"%s\"}\n", 944 944 (HostUSBDevice *)NewObj, 945 NewObj-> getName().c_str(),946 NewObj-> getStateName(),945 NewObj->i_getName().c_str(), 946 NewObj->i_getStateName(), 947 947 pNew, 948 948 pNew->idVendor, … … 964 964 * as the result of a re-enumeration. 965 965 */ 966 if (!pHostDevice-> wasActuallyDetached())966 if (!pHostDevice->i_wasActuallyDetached()) 967 967 it++; 968 968 else … … 974 974 Log(("USBProxyService::processChanges: detached %p {%s}\n", 975 975 (HostUSBDevice *)pHostDevice, 976 pHostDevice-> getName().c_str()));976 pHostDevice->i_getName().c_str())); 977 977 978 978 /* from now on, the object is no more valid, … … 1025 1025 LogFlowThisFunc(("aDevice=%p name={%s} state=%s id={%RTuuid}\n", 1026 1026 (HostUSBDevice *)aDevice, 1027 aDevice-> getName().c_str(),1028 aDevice-> getStateName(),1029 aDevice-> getId().raw()));1027 aDevice->i_getName().c_str(), 1028 aDevice->i_getStateName(), 1029 aDevice->i_getId().raw())); 1030 1030 1031 1031 /* 1032 1032 * Run filters on the device. 1033 1033 */ 1034 if (aDevice->i sCapturableOrHeld())1034 if (aDevice->i_isCapturableOrHeld()) 1035 1035 { 1036 1036 devLock.release(); … … 1060 1060 LogFlowThisFunc(("aDevice=%p name={%s} state=%s id={%RTuuid}\n", 1061 1061 (HostUSBDevice *)aDevice, 1062 aDevice-> getName().c_str(),1063 aDevice-> getStateName(),1064 aDevice-> getId().raw()));1062 aDevice->i_getName().c_str(), 1063 aDevice->i_getStateName(), 1064 aDevice->i_getId().raw())); 1065 1065 1066 1066 /* … … 1069 1069 */ 1070 1070 devLock.release(); 1071 aDevice-> onPhysicalDetached();1071 aDevice->i_onPhysicalDetached(); 1072 1072 } 1073 1073 … … 1091 1091 * Just hand it to the device, it knows best what needs to be done. 1092 1092 */ 1093 return aDevice-> updateStateFake(aUSBDevice, aRunFilters, aIgnoreMachine);1093 return aDevice->i_updateStateFake(aUSBDevice, aRunFilters, aIgnoreMachine); 1094 1094 } 1095 1095 … … 1111 1111 AssertReturn(!aDevice->isWriteLockOnCurrentThread(), false); 1112 1112 1113 return aDevice-> updateState(aUSBDevice, aRunFilters, aIgnoreMachine);1113 return aDevice->i_updateState(aUSBDevice, aRunFilters, aIgnoreMachine); 1114 1114 } 1115 1115 … … 1135 1135 LogFlowThisFunc(("aDevice=%p name={%s} state=%s id={%RTuuid} aRunFilters=%RTbool aIgnoreMachine=%p\n", 1136 1136 (HostUSBDevice *)aDevice, 1137 aDevice-> getName().c_str(),1138 aDevice-> getStateName(),1139 aDevice-> getId().raw(),1137 aDevice->i_getName().c_str(), 1138 aDevice->i_getStateName(), 1139 aDevice->i_getId().raw(), 1140 1140 (pllOpenedMachines != NULL), // used to be "bool aRunFilters" 1141 1141 aIgnoreMachine)); … … 1248 1248 it != mDevices.end(); 1249 1249 ++it) 1250 if ((*it)-> getId() == Id)1250 if ((*it)->i_getId() == Id) 1251 1251 { 1252 1252 Dev = (*it); -
trunk/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp
r47117 r49960 226 226 227 227 AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 228 LogFlowThisFunc(("aDevice=%s\n", aDevice-> getName().c_str()));228 LogFlowThisFunc(("aDevice=%s\n", aDevice->i_getName().c_str())); 229 229 230 230 /* 231 231 * Don't think we need to do anything when the device is held... fake it. 232 232 */ 233 Assert(aDevice-> getUnistate() == kHostUSBDeviceState_Capturing);233 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_Capturing); 234 234 devLock.release(); 235 235 interruptWait(); … … 245 245 246 246 AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 247 LogFlowThisFunc(("aDevice=%s\n", aDevice-> getName().c_str()));247 LogFlowThisFunc(("aDevice=%s\n", aDevice->i_getName().c_str())); 248 248 249 249 /* 250 250 * We're not really holding it atm., just fake it. 251 251 */ 252 Assert(aDevice-> getUnistate() == kHostUSBDeviceState_ReleasingToHost);252 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_ReleasingToHost); 253 253 devLock.release(); 254 254 interruptWait(); -
trunk/src/VBox/Main/src-server/win/USBProxyServiceWindows.cpp
r41814 r49960 144 144 145 145 AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 146 LogFlowThisFunc(("aDevice=%s\n", aDevice-> getName().c_str()));147 148 Assert(aDevice-> getUnistate() == kHostUSBDeviceState_Capturing);146 LogFlowThisFunc(("aDevice=%s\n", aDevice->i_getName().c_str())); 147 148 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_Capturing); 149 149 150 150 /* … … 186 186 187 187 AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 188 LogFlowThisFunc(("aDevice=%s\n", aDevice-> getName().c_str()));189 190 Assert(aDevice-> getUnistate() == kHostUSBDeviceState_ReleasingToHost);188 LogFlowThisFunc(("aDevice=%s\n", aDevice->i_getName().c_str())); 189 190 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_ReleasingToHost); 191 191 192 192 /* -
trunk/src/VBox/Main/src-server/xpcom/server.cpp
r49953 r49960 110 110 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SnapshotMachine, IMachine) 111 111 112 NS_DECL_CLASSINFO(Snapshot)113 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Snapshot, ISnapshot)114 115 112 NS_DECL_CLASSINFO(Progress) 116 113 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress) … … 123 120 124 121 #ifdef VBOX_WITH_USB 125 NS_DECL_CLASSINFO(HostUSBDevice)126 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(HostUSBDevice, IUSBDevice, IHostUSBDevice)127 122 128 123 #endif
Note:
See TracChangeset
for help on using the changeset viewer.