VirtualBox

Changeset 49960 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Dec 17, 2013 5:24:57 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91379
Message:

6813 stage 6 - Make use of server side API wrapper code in all interfaces

Location:
trunk/src/VBox/Main/src-server
Files:
8 edited

Legend:

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

    r41813 r49960  
    55
    66/*
    7  * Copyright (C) 2005-2012 Oracle Corporation
     7 * Copyright (C) 2005-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1515 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616 */
     17
    1718
    1819#include <iprt/types.h> /* for UINT64_C */
     
    9293
    9394    /* Set the name. */
    94     mNameObj = getName();
     95    mNameObj = i_getName();
    9596    mName = mNameObj.c_str();
    9697
     
    122123}
    123124
    124 // IUSBDevice properties
     125// Wrapped IUSBDevice properties
    125126/////////////////////////////////////////////////////////////////////////////
    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 
     127HRESULT HostUSBDevice::getId(com::Guid &aId)
     128{
    134129    /* mId is constant during life time, no need to lock */
    135     mId.toUtf16().cloneTo(aId);
     130    aId = mId;
    136131
    137132    return S_OK;
    138133}
    139134
    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
     136HRESULT HostUSBDevice::getVendorId(USHORT *aVendorId)
     137{
    147138    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    148139
     
    152143}
    153144
    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 
     145HRESULT HostUSBDevice::getProductId(USHORT *aProductId)
     146{
    161147    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    162148
     
    166152}
    167153
    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
     155HRESULT HostUSBDevice::getRevision(USHORT *aRevision)
     156{
    175157    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    176158
     
    180162}
    181163
    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 
     164HRESULT HostUSBDevice::getManufacturer(com::Utf8Str &aManufacturer)
     165{
    189166    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    190167
    191     Bstr(mUsb->pszManufacturer).cloneTo(aManufacturer);
     168    aManufacturer = mUsb->pszManufacturer;
    192169
    193170    return S_OK;
    194171}
    195172
    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
     174HRESULT HostUSBDevice::getProduct(com::Utf8Str &aProduct)
     175{
    203176    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    204177
    205     Bstr(mUsb->pszProduct).cloneTo(aProduct);
     178    aProduct = mUsb->pszProduct;
    206179
    207180    return S_OK;
    208181}
    209182
    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
     184HRESULT HostUSBDevice::getSerialNumber(com::Utf8Str &aSerialNumber)
     185{
    217186    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    218187
    219     Bstr(mUsb->pszSerialNumber).cloneTo(aSerialNumber);
     188    aSerialNumber = mUsb->pszSerialNumber;
    220189
    221190    return S_OK;
    222191}
    223192
    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 
     193HRESULT HostUSBDevice::getAddress(com::Utf8Str &aAddress)
     194{
    231195    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    232 
    233     Bstr(mUsb->pszAddress).cloneTo(aAddress);
    234 
     196    aAddress = mUsb->pszAddress;
    235197    return S_OK;
    236198}
    237199
    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
     201HRESULT HostUSBDevice::getPort(USHORT *aPort)
     202{
    245203    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    246204
     
    254212}
    255213
    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
     215HRESULT HostUSBDevice::getVersion(USHORT *aVersion)
     216{
    263217    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    264218
     
    268222}
    269223
    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 
     224HRESULT HostUSBDevice::getPortVersion(USHORT *aPortVersion)
     225{
    277226    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    278 
    279227    /* Port version is 2 (EHCI) if and only if the device runs at high speed;
    280228     * if speed is unknown, fall back to the old and inaccurate method.
     
    288236}
    289237
    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
     239HRESULT HostUSBDevice::getRemote(BOOL *aRemote)
     240{
    297241    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    298242
     
    302246}
    303247
    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
     249HRESULT HostUSBDevice::getState(USBDeviceState_T *aState)
     250{
    314251    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    315252
    316     *aState = canonicalState();
     253    *aState = i_canonicalState();
    317254
    318255    return S_OK;
     
    326263 * @note Locks this object for reading.
    327264 */
    328 Utf8Str HostUSBDevice::getName()
     265com::Utf8Str HostUSBDevice::i_getName()
    329266{
    330267    Utf8Str name;
     
    366303 * @retval  E_* as appropriate.
    367304 */
    368 HRESULT HostUSBDevice::requestCaptureForVM(SessionMachine *aMachine, bool aSetError, ULONG aMaskedIfs /* = 0*/)
     305HRESULT HostUSBDevice::i_requestCaptureForVM(SessionMachine *aMachine, bool aSetError, ULONG aMaskedIfs /* = 0*/)
    369306{
    370307    /*
     
    406343            return setError(E_INVALIDARG,
    407344                            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());
    409346    }
    410347
     
    422359    {
    423360        alock.release();
    424         HRESULT hrc = attachToVM(aMachine, aMaskedIfs);
     361        HRESULT hrc = i_attachToVM(aMachine, aMaskedIfs);
    425362        return SUCCEEDED(hrc);
    426363    }
     
    435372#if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \
    436373 || 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);
    438375#else
    439     setState(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_UsedByVM);
     376    i_setState(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_UsedByVM);
    440377#endif
    441378    mMachine = aMachine;
     
    446383    {
    447384        alock.acquire();
    448         failTransition();
     385        i_failTransition();
    449386        mMachine.setNull();
    450387        if (rc == VERR_SHARING_VIOLATION)
     
    475412 * @param   aMaskedIfs      The interfaces to hide from the guest.
    476413 */
    477 HRESULT HostUSBDevice::attachToVM(SessionMachine *aMachine, ULONG aMaskedIfs /* = 0*/)
     414HRESULT HostUSBDevice::i_attachToVM(SessionMachine *aMachine, ULONG aMaskedIfs /* = 0*/)
    478415{
    479416    AssertReturn(!isWriteLockOnCurrentThread(), E_FAIL);
     
    486423                 || mUniState == kHostUSBDeviceState_AttachingToVM,
    487424                 E_UNEXPECTED);
    488     setState(kHostUSBDeviceState_AttachingToVM, kHostUSBDeviceState_UsedByVM);
     425    i_setState(kHostUSBDeviceState_AttachingToVM, kHostUSBDeviceState_UsedByVM);
    489426
    490427    /*
     
    515452        mMachine = aMachine;
    516453        if (!mIsPhysicallyDetached)
    517             setState(kHostUSBDeviceState_UsedByVM);
     454            i_setState(kHostUSBDeviceState_UsedByVM);
    518455        else
    519456        {
    520457            alock.release();
    521             detachFromVM(kHostUSBDeviceState_PhysDetached);
     458            i_detachFromVM(kHostUSBDeviceState_PhysDetached);
    522459            hrc = E_UNEXPECTED;
    523460        }
     
    528465        if (!mIsPhysicallyDetached)
    529466        {
    530             setState(kHostUSBDeviceState_HeldByProxy);
     467            i_setState(kHostUSBDeviceState_HeldByProxy);
    531468            if (hrc == E_UNEXPECTED)
    532469                hrc = E_FAIL; /* No confusion. */
     
    535472        {
    536473            alock.release();
    537             onPhysicalDetachedInternal();
     474            i_onPhysicalDetachedInternal();
    538475            hrc = E_UNEXPECTED;
    539476        }
     
    551488 * @param   aFinalState     The final state (PhysDetached).
    552489 */
    553 void HostUSBDevice::detachFromVM(HostUSBDeviceState aFinalState)
     490void HostUSBDevice::i_detachFromVM(HostUSBDeviceState aFinalState)
    554491{
    555492    NOREF(aFinalState);
     
    570507     * so, it's not a bit issue here.
    571508     */
    572     setState(kHostUSBDeviceState_PhysDetachingFromVM, kHostUSBDeviceState_PhysDetached);
     509    i_setState(kHostUSBDeviceState_PhysDetachingFromVM, kHostUSBDeviceState_PhysDetached);
    573510
    574511    /*
     
    589526     */
    590527    alock.acquire();
    591     advanceTransition();
     528    i_advanceTransition();
    592529}
    593530
     
    612549 * @note    Must be called from under the object write lock.
    613550 */
    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));
     551HRESULT 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));
    617554
    618555    /*
     
    626563            return setError(E_INVALIDARG,
    627564                            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());
    629566    }
    630567    else
    631568        AssertMsgReturn(    mUniState == kHostUSBDeviceState_DetachingFromVM /** @todo capturing for VM ends up here on termination. */
    632569                        ||  (mUniState == kHostUSBDeviceState_UsedByVM && aAbnormal),
    633                         ("{%s} %s\n", mName, getStateName()), E_UNEXPECTED);
     570                        ("{%s} %s\n", mName, i_getStateName()), E_UNEXPECTED);
    634571    AssertMsgReturn((mMachine == aMachine), ("%p != %p\n", (void *)mMachine, aMachine), E_FAIL);
    635572
     
    639576    if (!aDone)
    640577    {
    641         *aRunFilters = startTransition(kHostUSBDeviceState_DetachingFromVM, kHostUSBDeviceState_HeldByProxy);
     578        *aRunFilters = i_startTransition(kHostUSBDeviceState_DetachingFromVM, kHostUSBDeviceState_HeldByProxy);
    642579        /* PORTME: This might require host specific changes if you re-enumerate the device. */
    643580    }
     
    646583        /* Fast forward thru the DetachingFromVM state and on to HeldByProxy. */
    647584        /** @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();
    650587        mMachine.setNull();
    651588        /* PORTME: ditto / trouble if you depend on the VM process to do anything. */
     
    655592        /* normal completion. */
    656593        Assert(mUniSubState == kHostUSBDeviceSubState_Default); /* PORTME: ditto */
    657         *aRunFilters = advanceTransition();
     594        *aRunFilters = i_advanceTransition();
    658595        mMachine.setNull();
    659596    }
     
    675612 * @note Must be called without holding the object lock.
    676613 */
    677 HRESULT HostUSBDevice::requestReleaseToHost()
     614HRESULT HostUSBDevice::i_requestReleaseToHost()
    678615{
    679616    /*
     
    688625        ||  mUniState == kHostUSBDeviceState_Capturable)
    689626        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);
    691628
    692629    /*
     
    695632#if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \
    696633 || defined(RT_OS_WINDOWS)
    697     startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused, kHostUSBDeviceSubState_AwaitingDetach);
     634    i_startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused, kHostUSBDeviceSubState_AwaitingDetach);
    698635#else
    699     startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused);
     636    i_startTransition(kHostUSBDeviceState_ReleasingToHost, kHostUSBDeviceState_Unused);
    700637#endif
    701638    alock.release();
     
    704641    {
    705642        alock.acquire();
    706         failTransition();
     643        i_failTransition();
    707644        return E_FAIL;
    708645    }
     
    724661 * @note Must be called without holding the object lock.
    725662 */
    726 HRESULT HostUSBDevice::requestHold()
     663HRESULT HostUSBDevice::i_requestHold()
    727664{
    728665    /*
     
    735672                    || mUniState == kHostUSBDeviceState_Capturable
    736673                    || mUniState == kHostUSBDeviceState_HeldByProxy,
    737                     ("{%s} %s\n", mName, getStateName()),
     674                    ("{%s} %s\n", mName, i_getStateName()),
    738675                    E_UNEXPECTED);
    739676
     
    749686#if (defined(RT_OS_DARWIN) && defined(VBOX_WITH_NEW_USB_CODE_ON_DARWIN)) /* PORTME */ \
    750687 || defined(RT_OS_WINDOWS)
    751     startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy, kHostUSBDeviceSubState_AwaitingDetach);
     688    i_startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy, kHostUSBDeviceSubState_AwaitingDetach);
    752689#else
    753     startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy);
     690    i_startTransition(kHostUSBDeviceState_Capturing, kHostUSBDeviceState_HeldByProxy);
    754691#endif
    755692    alock.release();
     
    758695    {
    759696        alock.acquire();
    760         failTransition();
     697        i_failTransition();
    761698        return E_FAIL;
    762699    }
     
    774711 * @returns true if it was actually detached, false if it's just a re-enumeration.
    775712 */
    776 bool HostUSBDevice::wasActuallyDetached()
     713bool HostUSBDevice::i_wasActuallyDetached()
    777714{
    778715    /*
     
    792729                 */
    793730                case kHostUSBDeviceSubState_AwaitingDetach:
    794                     advanceTransition();
     731                    i_advanceTransition();
    795732                    return false; /* not physically detached. */
    796733
     
    804741                    if (elapsedNanoseconds > UINT64_C(60000000000)) /* 60 seconds */
    805742                    {
    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();
    808745                    }
    809746#endif
     
    829766
    830767        default:
    831             AssertLogRelMsgFailed(("this=%p %s\n", this, getStateName()));
     768            AssertLogRelMsgFailed(("this=%p %s\n", this, i_getStateName()));
    832769            break;
    833770    }
     
    847784 * reset.
    848785 */
    849 void HostUSBDevice::onPhysicalDetached()
     786void HostUSBDevice::i_onPhysicalDetached()
    850787{
    851788    AssertReturnVoid(!isWriteLockOnCurrentThread());
     
    857794    {
    858795        alock.release();
    859         onPhysicalDetachedInternal();
     796        i_onPhysicalDetachedInternal();
    860797    }
    861798}
     
    868805 * See onPhysicalDetach() for details.
    869806 */
    870 void HostUSBDevice::onPhysicalDetachedInternal()
     807void HostUSBDevice::i_onPhysicalDetachedInternal()
    871808{
    872809    AssertReturnVoid(!isWriteLockOnCurrentThread());
     
    883820    {
    884821        alock.release();
    885         detachFromVM(kHostUSBDeviceState_PhysDetached);
     822        i_detachFromVM(kHostUSBDeviceState_PhysDetached);
    886823        alock.acquire();
    887824    }
    888825    else
    889         AssertMsg(mMachine.isNull(), ("%s\n", getStateName()));
     826        AssertMsg(mMachine.isNull(), ("%s\n", i_getStateName()));
    890827
    891828    /*
     
    893830     */
    894831    mMachine.setNull();
    895     setState(kHostUSBDeviceState_PhysDetached);
     832    i_setState(kHostUSBDeviceState_PhysDetached);
    896833}
    897834
     
    910847 *  @note Locks this object for reading.
    911848 */
    912 bool HostUSBDevice::isMatch(const USBDeviceFilter::Data &aData)
     849bool HostUSBDevice::i_isMatch(const USBDeviceFilter::Data &aData)
    913850{
    914851    AutoCaller autoCaller(this);
     
    950887 * @note Must be called from under the object write lock.
    951888 */
    952 int HostUSBDevice::compare(PCUSBDEVICE aDev2)
     889int HostUSBDevice::i_compare(PCUSBDEVICE aDev2)
    953890{
    954891    AssertReturn(isWriteLockOnCurrentThread(), -1);
    955892    //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);
    959896}
    960897
     
    972909 */
    973910/*static*/
    974 int HostUSBDevice::compare(PCUSBDEVICE aDev1, PCUSBDEVICE aDev2, bool aIsAwaitingReAttach /*= false */)
     911int HostUSBDevice::i_compare(PCUSBDEVICE aDev1, PCUSBDEVICE aDev2, bool aIsAwaitingReAttach /*= false */)
    975912{
    976913    /*
     
    10751012 *          works by state change. Using 3 return codes/parameters is just plain ugly.
    10761013 */
    1077 bool HostUSBDevice::updateState(PCUSBDEVICE aDev, bool *aRunFilters, SessionMachine **aIgnoreMachine)
     1014bool HostUSBDevice::i_updateState(PCUSBDEVICE aDev, bool *aRunFilters, SessionMachine **aIgnoreMachine)
    10781015{
    10791016    *aRunFilters = false;
     
    11671104    if (enmOldState != mUsb->enmState)
    11681105    {
    1169         LogFlowThisFunc(("%p {%s} %s\n", this, mName, getStateName()));
     1106        LogFlowThisFunc(("%p {%s} %s\n", this, mName, i_getStateName()));
    11701107        switch (mUsb->enmState)
    11711108        {
     
    11791116                    case kHostUSBDeviceState_Capturable:
    11801117                    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);
    11831120                        break;
    11841121                    case kHostUSBDeviceState_UsedByHost:
     
    11891126                        LogThisFunc(("{%s} capture failed!\n", mName));
    11901127                        mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */);
    1191                         *aRunFilters = failTransition();
     1128                        *aRunFilters = i_failTransition();
    11921129                        mMachine.setNull();
    11931130                        break;
     
    11951132                    /* Guess we've successfully released it. */
    11961133                    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)));
    11981135                        mUSBProxyService->releaseDeviceCompleted(this, true /* aSuccess */);
    1199                         *aRunFilters = setState(kHostUSBDeviceState_UsedByHost);
     1136                        *aRunFilters = i_setState(kHostUSBDeviceState_UsedByHost);
    12001137                        break;
    12011138
     
    12041141                    case kHostUSBDeviceState_DetachingFromVM:
    12051142                    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()));
    12071144                        break;
    12081145
     
    12101147                    /* Fake: We can't prevent anyone from grabbing it. */
    12111148                    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);
    12141151                        break;
    12151152                    //case kHostUSBDeviceState_UsedByVM:
     
    12251162                    case kHostUSBDeviceState_Unsupported:
    12261163                    default:
    1227                         AssertMsgFailed(("{%s} %s\n", mName, getStateName()));
     1164                        AssertMsgFailed(("{%s} %s\n", mName, i_getStateName()));
    12281165                        break;
    12291166                }
     
    12491186                        fIsImportant = true;
    12501187                    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);
    12531190                        break;
    12541191
     
    12571194                        LogThisFunc(("{%s} capture failed!\n", mName));
    12581195                        mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */);
    1259                         *aRunFilters = failTransition();
     1196                        *aRunFilters = i_failTransition();
    12601197                        mMachine.setNull();
    12611198                        break;
     
    12631200                    /* Guess we've successfully released it. */
    12641201                    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)));
    12661203                        mUSBProxyService->releaseDeviceCompleted(this, true /* aSuccess */);
    1267                         *aRunFilters = setState(kHostUSBDeviceState_Capturable);
     1204                        *aRunFilters = i_setState(kHostUSBDeviceState_Capturable);
    12681205                        break;
    12691206
     
    12721209                    case kHostUSBDeviceState_DetachingFromVM:
    12731210                    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()));
    12751212                        break;
    12761213
     
    12831220                    case kHostUSBDeviceState_PhysDetached:
    12841221                    default:
    1285                         AssertMsgFailed(("{%s} %s\n", mName, getStateName()));
     1222                        AssertMsgFailed(("{%s} %s\n", mName, i_getStateName()));
    12861223                        break;
    12871224                }
     
    13081245                    case kHostUSBDeviceState_Capturable:
    13091246                        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);
    13121249                        break;
    13131250
     
    13181255                        {
    13191256                            LogThisFunc(("{%s} capture advancing thru UNUSED...\n", mName));
    1320                             *aRunFilters = advanceTransition();
     1257                            *aRunFilters = i_advanceTransition();
    13211258                        }
    13221259                        else
     
    13251262                            LogThisFunc(("{%s} capture failed!\n", mName));
    13261263                            mUSBProxyService->captureDeviceCompleted(this, false /* aSuccess */);
    1327                             *aRunFilters = failTransition();
     1264                            *aRunFilters = i_failTransition();
    13281265                            mMachine.setNull();
    13291266                        }
     
    13321269                    /* Guess we've successfully released it. */
    13331270                    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)));
    13351272                        mUSBProxyService->releaseDeviceCompleted(this, true /* aSuccess */);
    1336                         *aRunFilters = setState(kHostUSBDeviceState_Unused);
     1273                        *aRunFilters = i_setState(kHostUSBDeviceState_Unused);
    13371274                        break;
    13381275
     
    13411278                    case kHostUSBDeviceState_DetachingFromVM:
    13421279                    case kHostUSBDeviceState_PhysDetachingFromVM:
    1343                         LogThisFunc(("{%s} %s - changed to UNUSED...\n", mName, getStateName()));
     1280                        LogThisFunc(("{%s} %s - changed to UNUSED...\n", mName, i_getStateName()));
    13441281                        break;
    13451282
     
    13521289                    case kHostUSBDeviceState_PhysDetached:
    13531290                    default:
    1354                         AssertMsgFailed(("{%s} %s\n", mName, getStateName()));
     1291                        AssertMsgFailed(("{%s} %s\n", mName, i_getStateName()));
    13551292                        break;
    13561293                }
     
    13681305                        break;
    13691306                    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()));
    13711308                        break;
    13721309
     
    13751312                        LogThisFunc(("{%s} capture succeeded!\n", mName));
    13761313                        mUSBProxyService->captureDeviceCompleted(this, true /* aSuccess */);
    1377                         *aRunFilters = advanceTransition(true /* fast forward thru re-attach */);
     1314                        *aRunFilters = i_advanceTransition(true /* fast forward thru re-attach */);
    13781315
    13791316                        /* Take action if we're supposed to attach it to a VM. */
     
    13811318                        {
    13821319                            alock.release();
    1383                             attachToVM(mMachine, mMaskedIfs);
     1320                            i_attachToVM(mMachine, mMaskedIfs);
    13841321                            alock.acquire();
    13851322                        }
     
    13881325                    /* Can only mean that we've failed capturing it. */
    13891326                    case kHostUSBDeviceState_ReleasingToHost:
    1390                         LogThisFunc(("{%s} %s failed!\n", mName, getStateName()));
     1327                        LogThisFunc(("{%s} %s failed!\n", mName, i_getStateName()));
    13911328                        mUSBProxyService->releaseDeviceCompleted(this, false /* aSuccess */);
    1392                         *aRunFilters = setState(kHostUSBDeviceState_HeldByProxy);
     1329                        *aRunFilters = i_setState(kHostUSBDeviceState_HeldByProxy);
    13931330                        break;
    13941331
     
    13971334                    case kHostUSBDeviceState_DetachingFromVM:
    13981335                    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()));
    14001337                        break;
    14011338
     
    14071344                    case kHostUSBDeviceState_PhysDetached:
    14081345                    default:
    1409                         AssertMsgFailed(("{%s} %s\n", mName, getStateName()));
     1346                        AssertMsgFailed(("{%s} %s\n", mName, i_getStateName()));
    14101347                        break;
    14111348                }
     
    14201357                    /* No change. */
    14211358                    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()));
    14231360                        break;
    14241361                    case kHostUSBDeviceState_UsedByVM:
     
    14291366                    case kHostUSBDeviceState_DetachingFromVM:
    14301367                    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()));
    14321369                        break;
    14331370
     
    14411378                    case kHostUSBDeviceState_Capturing:
    14421379                    default:
    1443                         AssertMsgFailed(("{%s} %s\n", mName, getStateName()));
     1380                        AssertMsgFailed(("{%s} %s\n", mName, i_getStateName()));
    14441381                        break;
    14451382                }
     
    14501387             */
    14511388            case USBDEVICESTATE_UNSUPPORTED:
    1452                 AssertMsgFailed(("enmOldState=%d {%s} %s\n", enmOldState, mName, getStateName()));
     1389                AssertMsgFailed(("enmOldState=%d {%s} %s\n", enmOldState, mName, i_getStateName()));
    14531390                break;
    14541391            default:
    1455                 AssertMsgFailed(("enmState=%d {%s} %s\n", mUsb->enmState, mName, getStateName()));
     1392                AssertMsgFailed(("enmState=%d {%s} %s\n", mUsb->enmState, mName, i_getStateName()));
    14561393                break;
    14571394        }
    14581395    }
    14591396    else if (   mUniSubState == kHostUSBDeviceSubState_AwaitingDetach
    1460              && hasAsyncOperationTimedOut())
     1397             && i_hasAsyncOperationTimedOut())
    14611398    {
    14621399        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();
    14651402        fIsImportant = true;
    14661403    }
    14671404    else
    14681405    {
    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));
    14701407        /** @todo might have to handle some stuff here too if we cannot make the release/capture handling deal with that above ... */
    14711408    }
     
    14861423 * @returns See HostUSBDevice::updateState()
    14871424 */
    1488 bool HostUSBDevice::updateStateFake(PCUSBDEVICE aDev, bool *aRunFilters, SessionMachine **aIgnoreMachine)
     1425bool HostUSBDevice::i_updateStateFake(PCUSBDEVICE aDev, bool *aRunFilters, SessionMachine **aIgnoreMachine)
    14891426{
    14901427    Assert(!isWriteLockOnCurrentThread());
     
    14971434        {
    14981435            *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()));
    15011438
    15021439            if (mUsb != aDev)
     
    15181455            {
    15191456                alock.release();
    1520                 attachToVM(mMachine, mMaskedIfs);
     1457                i_attachToVM(mMachine, mMaskedIfs);
    15211458            }
    15221459            return true;
     
    15251462        default:
    15261463            alock.release();
    1527             return updateState(aDev, aRunFilters, aIgnoreMachine);
     1464            return i_updateState(aDev, aRunFilters, aIgnoreMachine);
    15281465    }
    15291466}
     
    15381475 * @note    Caller must have read or write locked the object before calling.
    15391476 */
    1540 bool HostUSBDevice::hasAsyncOperationTimedOut() const
     1477bool HostUSBDevice::i_hasAsyncOperationTimedOut() const
    15411478{
    15421479    switch (mUniSubState)
     
    15641501 * @param   aPendingState
    15651502 */
    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*/)
    15691506{
    15701507    switch (aState)
     
    17621699 * @note    The caller must own the write lock for this object.
    17631700 */
    1764 bool HostUSBDevice::setState(HostUSBDeviceState aNewState, HostUSBDeviceState aNewPendingState /*= kHostUSBDeviceState_Invalid*/,
     1701bool HostUSBDevice::i_setState(HostUSBDeviceState aNewState, HostUSBDeviceState aNewPendingState /*= kHostUSBDeviceState_Invalid*/,
    17651702                             HostUSBDeviceSubState aNewSubState /*= kHostUSBDeviceSubState_Default*/)
    17661703{
     
    17821719     * Welcome to the switch orgies!
    17831720     * 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!
    17851722     */
    17861723
     
    18001737                    break;
    18011738                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);
    18041741            }
    18051742            break;
     
    18201757                    break;
    18211758                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);
    18241761            }
    18251762            break;
     
    18481785                            break;
    18491786                        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);
    18521789                    }
    18531790                    break;
    18541791                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);
    18571794            }
    18581795            break;
     
    18771814                            break;
    18781815                        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);
    18811818                    }
    18821819                    break;
    18831820                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);
    18861823            }
    18871824            break;
     
    19061843                            break;
    19071844                        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);
    19101847                    }
    19111848                    break;
     
    19161853                            break;
    19171854                        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);
    19201857                    }
    19211858                    break;
    19221859                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);
    19251862            }
    19261863            break;
     
    19441881                            break;
    19451882                        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);
    19481885                    }
    19491886                    break;
    19501887                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);
    19531890            }
    19541891            break;
     
    19741911                case kHostUSBDeviceState_UsedByVM:
    19751912                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);
    19781915            }
    19791916            break;
     
    20261963
    20271964                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);
    20301967            }
    20311968            break;
     
    20702007
    20712008                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);
    20742011            }
    20752012            break;
     
    20992036
    21002037                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);
    21032040            }
    21042041            break;
     
    21352072
    21362073                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);
    21392076            }
    21402077            break;
     
    21522089                    break;
    21532090                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);
    21562093            }
    21572094            break;
     
    21662103    if (NewPrevState != mPrevUniState)
    21672104        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));
    21702107    else
    21712108        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));
    21732110    mPrevUniState = NewPrevState;
    21742111    mUniState = aNewState;
     
    21922129 * @note    The caller must own the write lock for this object.
    21932130 */
    2194 bool HostUSBDevice::startTransition(HostUSBDeviceState aNewState, HostUSBDeviceState aFinalState,
    2195                                     HostUSBDeviceSubState aNewSubState /*= kHostUSBDeviceSubState_Default*/)
     2131bool HostUSBDevice::i_startTransition(HostUSBDeviceState aNewState, HostUSBDeviceState aFinalState,
     2132                                      HostUSBDeviceSubState aNewSubState /*= kHostUSBDeviceSubState_Default*/)
    21962133{
    21972134    AssertReturn(isWriteLockOnCurrentThread(), false);
     
    22152152        case kHostUSBDeviceState_AttachingToVM:
    22162153        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);
    22182155
    22192156        case kHostUSBDeviceState_PhysDetached:
     
    22222159    }
    22232160
    2224     return setState(aNewState, aFinalState, aNewSubState);
     2161    return i_setState(aNewState, aFinalState, aNewSubState);
    22252162}
    22262163
     
    22362173 * @note    The caller must own the write lock for this object.
    22372174 */
    2238 bool HostUSBDevice::advanceTransition(bool aSkipReAttach /* = false */)
     2175bool HostUSBDevice::i_advanceTransition(bool aSkipReAttach /* = false */)
    22392176{
    22402177    AssertReturn(isWriteLockOnCurrentThread(), false);
     
    22642201                            break;
    22652202                        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);
    22672204                    }
    22682205                    break;
     
    22922229                            break;
    22932230                        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);
    22952232                    }
    22962233                    break;
     
    23172254                            break;
    23182255                        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);
    23202257                    }
    23212258                    break;
     
    23452282                            break;
    23462283                        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);
    23482285                    }
    23492286                    break;
     
    23642301                            break;
    23652302                        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);
    23672304                    }
    23682305                    break;
     
    23782315        case kHostUSBDeviceState_HeldByProxy:
    23792316        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);
    23812318        case kHostUSBDeviceState_PhysDetached:
    23822319        default:
     
    23852322    }
    23862323
    2387     bool fRc = setState(enmState, enmPending, enmSub);
     2324    bool fRc = i_setState(enmState, enmPending, enmSub);
    23882325    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 */);
    23902327    return fRc;
    23912328}
     
    23982335 * @note    The caller must own the write lock for this object.
    23992336 */
    2400 bool HostUSBDevice::failTransition()
     2337bool HostUSBDevice::i_failTransition()
    24012338{
    24022339    AssertReturn(isWriteLockOnCurrentThread(), false);
     
    24322369
    24332370        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);
    24352372
    24362373        case kHostUSBDeviceState_Unsupported:
     
    24402377        case kHostUSBDeviceState_HeldByProxy:
    24412378        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);
    24432380        case kHostUSBDeviceState_PhysDetached:
    24442381        default:
     
    24472384    }
    24482385
    2449     return setState(enmState, kHostUSBDeviceState_Invalid, enmSub);
     2386    return i_setState(enmState, kHostUSBDeviceState_Invalid, enmSub);
    24502387}
    24512388
     
    24582395 * @note    The caller must own the read (or write) lock for this object.
    24592396 */
    2460 USBDeviceState_T HostUSBDevice::canonicalState() const
     2397USBDeviceState_T HostUSBDevice::i_canonicalState() const
    24612398{
    24622399    switch (mUniState)
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r49951 r49960  
    29112911    *aSnapshotCount = mData->mFirstSnapshot.isNull()
    29122912                          ? 0
    2913                           : mData->mFirstSnapshot->getAllChildrenCount() + 1;
     2913                          : mData->mFirstSnapshot->i_getAllChildrenCount() + 1;
    29142914
    29152915    return S_OK;
     
    43484348                AutoReadLock snapLock(snap COMMA_LOCKVAL_SRC_POS);
    43494349
    4350                 const MediaData::AttachmentList &snapAtts = snap->getSnapshotMachine()->mMediaData->mAttachments;
     4350                const MediaData::AttachmentList &snapAtts = snap->i_getSnapshotMachine()->mMediaData->mAttachments;
    43514351
    43524352                MediumAttachment *pAttachFound = NULL;
     
    43954395                }
    43964396
    4397                 snap = snap->getParent();
     4397                snap = snap->i_getParent();
    43984398            }
    43994399
     
    54755475    size_t cSnapshots = 0;
    54765476    if (mData->mFirstSnapshot)
    5477         cSnapshots = mData->mFirstSnapshot->getAllChildrenCount() + 1;
     5477        cSnapshots = mData->mFirstSnapshot->i_getAllChildrenCount() + 1;
    54785478    if (cSnapshots && cleanupMode == CleanupMode_UnregisterOnly)
    54795479        // fail now before we start detaching media
     
    55255525
    55265526        // GO!
    5527         pFirstSnapshot->uninitRecursively(alock, cleanupMode, llMedia, mData->llFilesToDelete);
     5527        pFirstSnapshot->i_uninitRecursively(alock, cleanupMode, llMedia, mData->llFilesToDelete);
    55285528
    55295529        mData->mMachineState = oldState;
     
    92019201    /* memorize the current snapshot when appropriate */
    92029202    if (    !mData->mCurrentSnapshot
    9203          && pSnapshot->getId() == aCurSnapshotId
     9203         && pSnapshot->i_getId() == aCurSnapshotId
    92049204       )
    92059205        mData->mCurrentSnapshot = pSnapshot;
     
    98659865        aSnapshot = mData->mFirstSnapshot;
    98669866    else
    9867         aSnapshot = mData->mFirstSnapshot->findChildOrSelf(aId.ref());
     9867        aSnapshot = mData->mFirstSnapshot->i_findChildOrSelf(aId.ref());
    98689868
    98699869    if (!aSnapshot)
     
    99029902    }
    99039903
    9904     aSnapshot = mData->mFirstSnapshot->findChildOrSelf(strName);
     9904    aSnapshot = mData->mFirstSnapshot->i_findChildOrSelf(strName);
    99059905
    99069906    if (!aSnapshot)
     
    1019210192            // and do the same thing for the saved state file paths of all the online snapshots
    1019310193            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());
    1019610196        }
    1019710197        while (0);
     
    1046110461
    1046210462    if (mData->mCurrentSnapshot)
    10463         config.uuidCurrentSnapshot = mData->mCurrentSnapshot->getId();
     10463        config.uuidCurrentSnapshot = mData->mCurrentSnapshot->i_getId();
    1046410464    else
    1046510465        config.uuidCurrentSnapshot.clear();
     
    1051710517            settings::Snapshot &snap = config.llFirstSnapshot.front();
    1051810518
    10519             rc = mData->mFirstSnapshot->saveSnapshot(snap, false /*aAttrsOnly*/);
     10519            rc = mData->mFirstSnapshot->i_saveSnapshot(snap, false /*aAttrsOnly*/);
    1052010520            if (FAILED(rc)) throw rc;
    1052110521        }
     
    1163811638        // if this is from a snapshot, do not defer detachment to commitMedia()
    1163911639        if (pSnapshot)
    11640             oldmedium->i_removeBackReference(mData->mUuid, pSnapshot->getId());
     11640            oldmedium->i_removeBackReference(mData->mUuid, pSnapshot->i_getId());
    1164111641        // else if non-hard disk media, do not defer detachment to commitMedia() either
    1164211642        else if (mediumType != DeviceType_HardDisk)
     
    1304213042        // AFTER killing the snapshot so that releaseSavedStateFile() won't
    1304313043        // think it's still in use
    13044         Utf8Str strStateFile = mConsoleTaskData.mSnapshot->getStateFilePath();
     13044        Utf8Str strStateFile = mConsoleTaskData.mSnapshot->i_getStateFilePath();
    1304513045        mConsoleTaskData.mSnapshot->uninit();
    1304613046        releaseSavedStateFile(strStateFile, NULL /* pSnapshotToIgnore */ );
     
    1467114671        // ... and it must also not be shared with other snapshots
    1467214672        if (    !mData->mFirstSnapshot
    14673              || !mData->mFirstSnapshot->sharesSavedStateFile(strStateFile, pSnapshotToIgnore)
     14673             || !mData->mFirstSnapshot->i_sharesSavedStateFile(strStateFile, pSnapshotToIgnore)
    1467414674                                // this checks the SnapshotMachine's state file paths
    1467514675           )
     
    1493714937            // it is safe to delete the saved state file if ...
    1493814938            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 */)
    1494014940                                                // ... none of the snapshots share the saved state file
    1494114941               )
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r49871 r49960  
    4343#include <VBox/settings.h>
    4444
    45 
    4645////////////////////////////////////////////////////////////////////////////////
    4746//
     
    8281//
    8382////////////////////////////////////////////////////////////////////////////////
     83DEFINE_EMPTY_CTOR_DTOR(Snapshot)
    8484
    8585HRESULT Snapshot::FinalConstruct()
     
    176176
    177177    if (m->pParent)
    178         deparent();
     178        i_deparent();
    179179
    180180    if (m->pMachine)
     
    200200 *  lock in write mode AND the machine state must be DeletingSnapshot.
    201201 */
    202 void Snapshot::beginSnapshotDelete()
     202void Snapshot::i_beginSnapshotDelete()
    203203{
    204204    AutoCaller autoCaller(this);
     
    266266 * The caller must hold the machine lock in write mode (which protects the snapshots tree)!
    267267 */
    268 void Snapshot::deparent()
     268void Snapshot::i_deparent()
    269269{
    270270    Assert(m->pMachine->isWriteLockOnCurrentThread());
     
    292292////////////////////////////////////////////////////////////////////////////////
    293293
    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 
     294HRESULT Snapshot::getId(com::Guid &aId)
     295{
    301296    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    302297
    303     m->uuid.toUtf16().cloneTo(aId);
     298    aId = m->uuid;
     299
    304300    return S_OK;
    305301}
    306302
    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 
     303HRESULT Snapshot::getName(com::Utf8Str &aName)
     304{
    314305    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    315 
    316     m->strName.cloneTo(aName);
     306    aName = m->strName;
    317307    return S_OK;
    318308}
     
    322312 *  (see its lock requirements).
    323313 */
    324 STDMETHODIMP Snapshot::COMSETTER(Name)(IN_BSTR aName)
     314HRESULT Snapshot::setName(const com::Utf8Str &aName)
    325315{
    326316    HRESULT rc = S_OK;
    327     CheckComArgStrNotEmptyOrNull(aName);
    328317
    329318    // prohibit setting a UUID only as the machine name, or else it can
     
    334323        return setError(E_INVALIDARG,  tr("A machine cannot have a UUID as its name"));
    335324
    336     AutoCaller autoCaller(this);
    337     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    338 
    339     Utf8Str strName(aName);
    340 
    341325    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    342326
    343     if (m->strName != strName)
    344     {
    345         m->strName = strName;
     327    if (m->strName != aName)
     328    {
     329        m->strName = aName;
    346330        alock.release(); /* Important! (child->parent locks are forbidden) */
    347331        rc = m->pMachine->onSnapshotChange(this);
     
    351335}
    352336
    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 
     337HRESULT Snapshot::getDescription(com::Utf8Str &aDescription)
     338{
    360339    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    361 
    362     m->strDescription.cloneTo(aDescription);
     340    aDescription = m->strDescription;
    363341    return S_OK;
    364342}
    365343
    366 STDMETHODIMP Snapshot::COMSETTER(Description)(IN_BSTR aDescription)
     344HRESULT Snapshot::setDescription(const com::Utf8Str &aDescription)
    367345{
    368346    HRESULT rc = S_OK;
    369     AutoCaller autoCaller(this);
    370     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    371 
    372     Utf8Str strDescription(aDescription);
    373347
    374348    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;
    379352        alock.release(); /* Important! (child->parent locks are forbidden) */
    380353        rc = m->pMachine->onSnapshotChange(this);
     
    384357}
    385358
    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 
     359HRESULT Snapshot::getTimeStamp(LONG64 *aTimeStamp)
     360{
    393361    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    394362
     
    397365}
    398366
    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 
     367HRESULT Snapshot::getOnline(BOOL *aOnline)
     368{
    406369    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    407370
    408     *aOnline = getStateFilePath().isNotEmpty();
     371    *aOnline = i_getStateFilePath().isNotEmpty();
    409372    return S_OK;
    410373}
    411374
    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 
     375HRESULT Snapshot::getMachine(ComPtr<IMachine> &aMachine)
     376{
    419377    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    420378
    421     m->pMachine.queryInterfaceTo(aMachine);
     379    m->pMachine.queryInterfaceTo(aMachine.asOutParam());
     380
    422381    return S_OK;
    423382}
    424383
    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
     385HRESULT Snapshot::getParent(ComPtr<ISnapshot> &aParent)
     386{
    432387    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    433388
    434     m->pParent.queryInterfaceTo(aParent);
     389    m->pParent.queryInterfaceTo(aParent.asOutParam());
    435390    return S_OK;
    436391}
    437392
    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 
     393HRESULT Snapshot::getChildren(std::vector<ComPtr<ISnapshot> > &aChildren)
     394{
    445395    // snapshots tree is protected by machine lock
    446396    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);
    451402    return S_OK;
    452403}
    453404
    454 STDMETHODIMP Snapshot::GetChildrenCount(ULONG* count)
    455 {
    456     CheckComArgOutPointerValid(count);
    457 
    458     *count = getChildrenCount();
     405HRESULT Snapshot::getChildrenCount(ULONG* count)
     406{
     407    *count = i_getChildrenCount();
    459408
    460409    return S_OK;
     
    471420 * @return
    472421 */
    473 const ComObjPtr<Snapshot>& Snapshot::getParent() const
     422const ComObjPtr<Snapshot>& Snapshot::i_getParent() const
    474423{
    475424    return m->pParent;
     
    480429 * @return
    481430 */
    482 const ComObjPtr<Snapshot> Snapshot::getFirstChild() const
     431const ComObjPtr<Snapshot> Snapshot::i_getFirstChild() const
    483432{
    484433    if (!m->llChildren.size())
     
    491440 *      Must be called from under the object's lock!
    492441 */
    493 const Utf8Str& Snapshot::getStateFilePath() const
     442const Utf8Str& Snapshot::i_getStateFilePath() const
    494443{
    495444    return m->pMachine->mSSData->strStateFilePath;
     
    502451 */
    503452
    504 uint32_t Snapshot::getDepth()
     453uint32_t Snapshot::i_getDepth()
    505454{
    506455    AutoCaller autoCaller(this);
     
    526475 * @return
    527476 */
    528 ULONG Snapshot::getChildrenCount()
     477ULONG Snapshot::i_getChildrenCount()
    529478{
    530479    AutoCaller autoCaller(this);
     
    542491 * @return
    543492 */
    544 ULONG Snapshot::getAllChildrenCountImpl()
     493ULONG Snapshot::i_getAllChildrenCountImpl()
    545494{
    546495    AutoCaller autoCaller(this);
     
    552501         ++it)
    553502    {
    554         count += (*it)->getAllChildrenCountImpl();
     503        count += (*it)->i_getAllChildrenCountImpl();
    555504    }
    556505
     
    563512 * @return
    564513 */
    565 ULONG Snapshot::getAllChildrenCount()
     514ULONG Snapshot::i_getAllChildrenCount()
    566515{
    567516    AutoCaller autoCaller(this);
     
    571520    AutoReadLock alock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    572521
    573     return getAllChildrenCountImpl();
     522    return i_getAllChildrenCountImpl();
    574523}
    575524
     
    579528 * @return
    580529 */
    581 const ComObjPtr<SnapshotMachine>& Snapshot::getSnapshotMachine() const
     530const ComObjPtr<SnapshotMachine>& Snapshot::i_getSnapshotMachine() const
    582531{
    583532    return m->pMachine;
     
    589538 * @return
    590539 */
    591 Guid Snapshot::getId() const
     540Guid Snapshot::i_getId() const
    592541{
    593542    return m->uuid;
     
    599548 * @return
    600549 */
    601 const Utf8Str& Snapshot::getName() const
     550const Utf8Str& Snapshot::i_getName() const
    602551{
    603552    return m->strName;
     
    609558 * @return
    610559 */
    611 RTTIMESPEC Snapshot::getTimeStamp() const
     560RTTIMESPEC Snapshot::i_getTimeStamp() const
    612561{
    613562    return m->timeStamp;
     
    620569 *  Caller must hold the machine lock (which protects the snapshots tree!)
    621570 */
    622 ComObjPtr<Snapshot> Snapshot::findChildOrSelf(IN_GUID aId)
     571ComObjPtr<Snapshot> Snapshot::i_findChildOrSelf(IN_GUID aId)
    623572{
    624573    ComObjPtr<Snapshot> child;
     
    636585             ++it)
    637586        {
    638             if ((child = (*it)->findChildOrSelf(aId)))
     587            if ((child = (*it)->i_findChildOrSelf(aId)))
    639588                break;
    640589        }
     
    651600 *  Caller must hold the machine lock (which protects the snapshots tree!)
    652601 */
    653 ComObjPtr<Snapshot> Snapshot::findChildOrSelf(const Utf8Str &aName)
     602ComObjPtr<Snapshot> Snapshot::i_findChildOrSelf(const Utf8Str &aName)
    654603{
    655604    ComObjPtr<Snapshot> child;
     
    670619             ++it)
    671620        {
    672             if ((child = (*it)->findChildOrSelf(aName)))
     621            if ((child = (*it)->i_findChildOrSelf(aName)))
    673622                break;
    674623        }
     
    683632 * @param aNewPath
    684633 */
    685 void Snapshot::updateSavedStatePathsImpl(const Utf8Str &strOldPath,
    686                                          const Utf8Str &strNewPath)
     634void Snapshot::i_updateSavedStatePathsImpl(const Utf8Str &strOldPath,
     635                                           const Utf8Str &strNewPath)
    687636{
    688637    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    707656    {
    708657        Snapshot *pChild = *it;
    709         pChild->updateSavedStatePathsImpl(strOldPath, strNewPath);
     658        pChild->i_updateSavedStatePathsImpl(strOldPath, strNewPath);
    710659    }
    711660}
     
    723672 * @return
    724673 */
    725 bool Snapshot::sharesSavedStateFile(const Utf8Str &strPath,
    726                                     Snapshot *pSnapshotToIgnore)
     674bool Snapshot::i_sharesSavedStateFile(const Utf8Str &strPath,
     675                                      Snapshot *pSnapshotToIgnore)
    727676{
    728677    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    741690        Snapshot *pChild = *it;
    742691        if (!pSnapshotToIgnore || pSnapshotToIgnore != pChild)
    743             if (pChild->sharesSavedStateFile(strPath, pSnapshotToIgnore))
     692            if (pChild->i_sharesSavedStateFile(strPath, pSnapshotToIgnore))
    744693                return true;
    745694    }
     
    760709 *  @note Locks the machine (for the snapshots tree) +  this object + children for writing.
    761710 */
    762 void Snapshot::updateSavedStatePaths(const Utf8Str &strOldPath,
    763                                      const Utf8Str &strNewPath)
     711void Snapshot::i_updateSavedStatePaths(const Utf8Str &strOldPath,
     712                                      const Utf8Str &strNewPath)
    764713{
    765714    LogFlowThisFunc(("aOldPath={%s} aNewPath={%s}\n", strOldPath.c_str(), strNewPath.c_str()));
     
    772721
    773722    // call the implementation under the tree lock
    774     updateSavedStatePathsImpl(strOldPath, strNewPath);
     723    i_updateSavedStatePathsImpl(strOldPath, strNewPath);
    775724}
    776725
     
    783732 * @return
    784733 */
    785 HRESULT Snapshot::saveSnapshotImpl(settings::Snapshot &data, bool aAttrsOnly)
     734HRESULT Snapshot::i_saveSnapshotImpl(settings::Snapshot &data, bool aAttrsOnly)
    786735{
    787736    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    796745
    797746    // 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);
    800749    else
    801750        data.strStateFile.setNull();
     
    822771
    823772            settings::Snapshot *snap = new settings::Snapshot();
    824             rc = (*it)->saveSnapshotImpl(*snap, aAttrsOnly);
     773            rc = (*it)->i_saveSnapshotImpl(*snap, aAttrsOnly);
    825774            if (FAILED(rc))
    826775            {
     
    844793 *  @param aAttrsOnly   If true, only update user-changeable attrs.
    845794 */
    846 HRESULT Snapshot::saveSnapshot(settings::Snapshot &data, bool aAttrsOnly)
     795HRESULT Snapshot::i_saveSnapshot(settings::Snapshot &data, bool aAttrsOnly)
    847796{
    848797    // snapshots tree is protected by machine lock
    849798    AutoReadLock alock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    850799
    851     return saveSnapshotImpl(data, aAttrsOnly);
     800    return i_saveSnapshotImpl(data, aAttrsOnly);
    852801}
    853802
     
    875824 * @return
    876825 */
    877 HRESULT Snapshot::uninitRecursively(AutoWriteLock &writeLock,
    878                                     CleanupMode_T cleanupMode,
    879                                     MediaList &llMedia,
    880                                     std::list<Utf8Str> &llFilenames)
     826HRESULT Snapshot::i_uninitRecursively(AutoWriteLock &writeLock,
     827                                      CleanupMode_T cleanupMode,
     828                                      MediaList &llMedia,
     829                                      std::list<Utf8Str> &llFilenames)
    881830{
    882831    Assert(m->pMachine->isWriteLockOnCurrentThread());
     
    886835    // make a copy of the Guid for logging before we uninit ourselves
    887836#ifdef LOG_ENABLED
    888     Guid uuid = getId();
    889     Utf8Str name = getName();
     837    Guid uuid = i_getId();
     838    Utf8Str name = i_getName();
    890839    LogFlowThisFunc(("Entering for snapshot '%s' {%RTuuid}\n", name.c_str(), uuid.raw()));
    891840#endif
     
    903852    {
    904853        Snapshot *pChild = *it;
    905         rc = pChild->uninitRecursively(writeLock, cleanupMode, llMedia, llFilenames);
     854        rc = pChild->i_uninitRecursively(writeLock, cleanupMode, llMedia, llFilenames);
    906855        if (FAILED(rc))
    907856            return rc;
     
    935884    }
    936885
    937     this->beginSnapshotDelete();
     886    this->i_beginSnapshotDelete();
    938887    this->uninit();
    939888
     
    12891238    AutoMultiWriteLock2 mlock(this, aSnapshot COMMA_LOCKVAL_SRC_POS);
    12901239    Guid uuidMachine(mData->mUuid),
    1291          uuidSnapshot(aSnapshot->getId());
     1240         uuidSnapshot(aSnapshot->i_getId());
    12921241    bool fNeedsGlobalSaveSettings = false;
    12931242
     
    14711420
    14721421    if (   mData->mCurrentSnapshot
    1473         && mData->mCurrentSnapshot->getDepth() >= SETTINGS_SNAPSHOT_DEPTH_MAX)
     1422        && mData->mCurrentSnapshot->i_getDepth() >= SETTINGS_SNAPSHOT_DEPTH_MAX)
    14741423    {
    14751424        return setError(VBOX_E_INVALID_OBJECT_STATE,
     
    16771626        /* inform callbacks */
    16781627        mParent->onSnapshotTaken(mData->mUuid,
    1679                                  mConsoleTaskData.mSnapshot->getId());
     1628                                 mConsoleTaskData.mSnapshot->i_getId());
    16801629        machineLock.release();
    16811630    }
     
    16961645            // snapshot means that a new saved state file was created, which we must
    16971646            // clean up now
    1698             RTFileDelete(mConsoleTaskData.mSnapshot->getStateFilePath().c_str());
     1647            RTFileDelete(mConsoleTaskData.mSnapshot->i_getStateFilePath().c_str());
    16991648            machineLock.acquire();
    17001649
     
    17631712
    17641713    ComObjPtr<Snapshot> pSnapshot(static_cast<Snapshot*>(aSnapshot));
    1765     ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot->getSnapshotMachine();
     1714    ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot->i_getSnapshotMachine();
    17661715
    17671716    // create a progress object. The number of operations is:
     
    17891738    pProgress.createObject();
    17901739    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(),
    17921741                    FALSE /* aCancelable */,
    17931742                    ulOpCount,
     
    19001849
    19011850            /* 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());
    19051854
    19061855            /* copy all hardware data from the snapshot */
     
    19441893            Assert(mSSData->strStateFilePath.isEmpty());
    19451894
    1946             const Utf8Str &strSnapshotStateFile = aTask.pSnapshot->getStateFilePath();
     1895            const Utf8Str &strSnapshotStateFile = aTask.pSnapshot->i_getStateFilePath();
    19471896
    19481897            if (strSnapshotStateFile.isNotEmpty())
     
    19501899                mSSData->strStateFilePath = strSnapshotStateFile;
    19511900
    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()));
    19531902            /* make the snapshot we restored from the current snapshot */
    19541903            mData->mCurrentSnapshot = aTask.pSnapshot;
     
    21622111    AutoWriteLock snapshotLock(pSnapshot COMMA_LOCKVAL_SRC_POS);
    21632112
    2164     size_t childrenCount = pSnapshot->getChildrenCount();
     2113    size_t childrenCount = pSnapshot->i_getChildrenCount();
    21652114    if (childrenCount > 1)
    21662115        return setError(VBOX_E_INVALID_OBJECT_STATE,
    21672116                        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(),
    21692118                        mUserData->s.strName.c_str(),
    21702119                        childrenCount);
     
    21732122        return setError(VBOX_E_INVALID_OBJECT_STATE,
    21742123                        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(),
    21762125                        mUserData->s.strName.c_str());
    21772126
     
    21902139    }
    21912140
    2192     ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot->getSnapshotMachine();
     2141    ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot->i_getSnapshotMachine();
    21932142
    21942143    /* create a progress object. The number of operations is:
     
    22002149    ULONG ulTotalWeight = 1;        // one for preparations
    22012150
    2202     if (pSnapshot->getStateFilePath().length())
     2151    if (pSnapshot->i_getStateFilePath().length())
    22032152    {
    22042153        ++ulOpCount;
     
    22372186    pProgress.createObject();
    22382187    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(),
    22402189                    FALSE /* aCancelable */,
    22412190                    ulOpCount,
     
    24132362
    24142363        AutoWriteLock treeLock(mParent->getMediaTreeLockHandle()
    2415                                       COMMA_LOCKVAL_SRC_POS);
    2416 
    2417         ComObjPtr<SnapshotMachine> pSnapMachine = aTask.pSnapshot->getSnapshotMachine();
     2364                               COMMA_LOCKVAL_SRC_POS);
     2365
     2366        ComObjPtr<SnapshotMachine> pSnapMachine = aTask.pSnapshot->i_getSnapshotMachine();
    24182367        // no need to lock the snapshot machine since it is const by definition
    24192368        Guid machineId = pSnapMachine->getId();
    24202369
    24212370        // save the snapshot ID (for callbacks)
    2422         snapshotId = aTask.pSnapshot->getId();
     2371        snapshotId = aTask.pSnapshot->i_getId();
    24232372
    24242373        // first pass:
     
    27022651            AutoWriteLock machineLock(this COMMA_LOCKVAL_SRC_POS);
    27032652
    2704             Utf8Str stateFilePath = aTask.pSnapshot->getStateFilePath();
     2653            Utf8Str stateFilePath = aTask.pSnapshot->i_getStateFilePath();
    27052654            if (!stateFilePath.isEmpty())
    27062655            {
     
    28622811                ComObjPtr<Machine> pMachine = this;
    28632812                Guid childSnapshotId;
    2864                 ComObjPtr<Snapshot> pChildSnapshot = aTask.pSnapshot->getFirstChild();
     2813                ComObjPtr<Snapshot> pChildSnapshot = aTask.pSnapshot->i_getFirstChild();
    28652814                if (pChildSnapshot)
    28662815                {
    2867                     pMachine = pChildSnapshot->getSnapshotMachine();
    2868                     childSnapshotId = pChildSnapshot->getId();
     2816                    pMachine = pChildSnapshot->i_getSnapshotMachine();
     2817                    childSnapshotId = pChildSnapshot->i_getId();
    28692818                }
    28702819                pAtt = findAttachment(pMachine->mMediaData->mAttachments, it->mpSource);
     
    29072856            AutoWriteLock machineLock(this COMMA_LOCKVAL_SRC_POS);
    29082857
    2909             aTask.pSnapshot->beginSnapshotDelete();
     2858            aTask.pSnapshot->i_beginSnapshotDelete();
    29102859            aTask.pSnapshot->uninit();
    29112860
     
    31133062    alock.release();
    31143063    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);
    31183067    alock.acquire();
    31193068    childLock.acquire();
  • trunk/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp

    r49951 r49960  
    892892    {
    893893        AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS);
    894         if (aDevice->isMatch((*it)->i_getData()))
     894        if (aDevice->i_isMatch((*it)->i_getData()))
    895895        {
    896896            *aMaskedIfs = (*it)->i_getData().mMaskedIfs;
  • trunk/src/VBox/Main/src-server/USBProxyService.cpp

    r49951 r49960  
    182182     */
    183183    alock.release();
    184     return pHostDevice->requestCaptureForVM(aMachine, true /* aSetError */);
     184    return pHostDevice->i_requestCaptureForVM(aMachine, true /* aSetError */);
    185185}
    186186
     
    230230     */
    231231    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()));
    233233    bool fRunFilters = false;
    234     HRESULT hrc = pHostDevice->onDetachFromVM(aMachine, aDone, &fRunFilters);
     234    HRESULT hrc = pHostDevice->i_onDetachFromVM(aMachine, aDone, &fRunFilters);
    235235
    236236    /*
     
    240240        &&  fRunFilters)
    241241    {
    242         Assert(aDone && pHostDevice->getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->getMachine().isNull());
     242        Assert(aDone && pHostDevice->i_getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->i_getMachine().isNull());
    243243        devLock.release();
    244244        alock.release();
     
    290290        ComObjPtr<HostUSBDevice> device = *it;
    291291        AutoReadLock devLock(device COMMA_LOCKVAL_SRC_POS);
    292         if (   device->getUnistate() == kHostUSBDeviceState_HeldByProxy
    293             || device->getUnistate() == kHostUSBDeviceState_Unused
    294             || device->getUnistate() == kHostUSBDeviceState_Capturable)
     292        if (   device->i_getUnistate() == kHostUSBDeviceState_HeldByProxy
     293            || device->i_getUnistate() == kHostUSBDeviceState_Unused
     294            || device->i_getUnistate() == kHostUSBDeviceState_Capturable)
    295295        {
    296296            devLock.release();
     
    346346        ComObjPtr<HostUSBDevice> pHostDevice = *it;
    347347        AutoWriteLock devLock(pHostDevice COMMA_LOCKVAL_SRC_POS);
    348         if (pHostDevice->getMachine() == aMachine)
     348        if (pHostDevice->i_getMachine() == aMachine)
    349349        {
    350350            /*
     
    352352             */
    353353            bool fRunFilters = false;
    354             HRESULT hrc = pHostDevice->onDetachFromVM(aMachine, aDone, &fRunFilters, aAbnormal);
     354            HRESULT hrc = pHostDevice->i_onDetachFromVM(aMachine, aDone, &fRunFilters, aAbnormal);
    355355            if (    SUCCEEDED(hrc)
    356356                &&  fRunFilters)
    357357            {
    358                 Assert(aDone && pHostDevice->getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->getMachine().isNull());
     358                Assert(aDone && pHostDevice->i_getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->i_getMachine().isNull());
    359359                devLock.release();
    360360                alock.release();
     
    395395                                               SessionMachine *aIgnoreMachine)
    396396{
    397     LogFlowThisFunc(("{%s} ignoring=%p\n", aDevice->getName().c_str(), aIgnoreMachine));
     397    LogFlowThisFunc(("{%s} ignoring=%p\n", aDevice->i_getName().c_str(), aIgnoreMachine));
    398398
    399399    /*
     
    404404    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    405405    AutoWriteLock devLock(aDevice COMMA_LOCKVAL_SRC_POS);
    406     AssertMsgReturn(aDevice->isCapturableOrHeld(), ("{%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);
    407407
    408408    /*
     
    423423        AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS);
    424424        const HostUSBDeviceFilter::Data &data = (*it)->i_getData();
    425         if (aDevice->isMatch(data))
     425        if (aDevice->i_isMatch(data))
    426426        {
    427427            USBDeviceFilterAction_T action = USBDeviceFilterAction_Null;
     
    435435                devLock.release();
    436436                alock.release();
    437                 aDevice->requestReleaseToHost();
     437                aDevice->i_requestReleaseToHost();
    438438                return S_OK;
    439439            }
     
    471471        if (runMachineFilters(pMachine, aDevice))
    472472        {
    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));
    474474            return S_OK;
    475475        }
     
    485485    alock.release();
    486486    if (fHoldIt)
    487         aDevice->requestHold();
     487        aDevice->i_requestHold();
    488488    else
    489         aDevice->requestReleaseToHost();
     489        aDevice->i_requestReleaseToHost();
    490490    return S_OK;
    491491}
     
    506506bool USBProxyService::runMachineFilters(SessionMachine *aMachine, ComObjPtr<HostUSBDevice> &aDevice)
    507507{
    508     LogFlowThisFunc(("{%s} aMachine=%p \n", aDevice->getName().c_str(), aMachine));
     508    LogFlowThisFunc(("{%s} aMachine=%p \n", aDevice->i_getName().c_str(), aMachine));
    509509
    510510    /*
     
    524524    {
    525525        /* try to capture the device */
    526         HRESULT hrc = aDevice->requestCaptureForVM(aMachine, false /* aSetError */, ulMaskedIfs);
     526        HRESULT hrc = aDevice->i_requestCaptureForVM(aMachine, false /* aSetError */, ulMaskedIfs);
    527527        return SUCCEEDED(hrc)
    528528            || hrc == E_UNEXPECTED /* bad device state, give up */;
     
    814814        PUSBDEVICE pCur = pTail;
    815815        while (     pCur
    816                &&   HostUSBDevice::compare(pCur, pDev) > 0)
     816               &&   HostUSBDevice::i_compare(pCur, pDev) > 0)
    817817            pCur = pCur->pPrev;
    818818
     
    904904                iDiff = -1;
    905905            else
    906                 iDiff = pHostDevice->compare(pDevices);
     906                iDiff = pHostDevice->i_compare(pDevices);
    907907        }
    908908        if (!iDiff)
     
    943943                Log(("USBProxyService::processChanges: attached %p {%s} %s / %p:{.idVendor=%#06x, .idProduct=%#06x, .pszProduct=\"%s\", .pszManufacturer=\"%s\"}\n",
    944944                     (HostUSBDevice *)NewObj,
    945                      NewObj->getName().c_str(),
    946                      NewObj->getStateName(),
     945                     NewObj->i_getName().c_str(),
     946                     NewObj->i_getStateName(),
    947947                     pNew,
    948948                     pNew->idVendor,
     
    964964                 * as the result of a re-enumeration.
    965965                 */
    966                 if (!pHostDevice->wasActuallyDetached())
     966                if (!pHostDevice->i_wasActuallyDetached())
    967967                    it++;
    968968                else
     
    974974                    Log(("USBProxyService::processChanges: detached %p {%s}\n",
    975975                         (HostUSBDevice *)pHostDevice,
    976                          pHostDevice->getName().c_str()));
     976                         pHostDevice->i_getName().c_str()));
    977977
    978978                    /* from now on, the object is no more valid,
     
    10251025    LogFlowThisFunc(("aDevice=%p name={%s} state=%s id={%RTuuid}\n",
    10261026                     (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()));
    10301030
    10311031    /*
    10321032     * Run filters on the device.
    10331033     */
    1034     if (aDevice->isCapturableOrHeld())
     1034    if (aDevice->i_isCapturableOrHeld())
    10351035    {
    10361036        devLock.release();
     
    10601060    LogFlowThisFunc(("aDevice=%p name={%s} state=%s id={%RTuuid}\n",
    10611061                     (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()));
    10651065
    10661066    /*
     
    10691069     */
    10701070    devLock.release();
    1071     aDevice->onPhysicalDetached();
     1071    aDevice->i_onPhysicalDetached();
    10721072}
    10731073
     
    10911091     * Just hand it to the device, it knows best what needs to be done.
    10921092     */
    1093     return aDevice->updateStateFake(aUSBDevice, aRunFilters, aIgnoreMachine);
     1093    return aDevice->i_updateStateFake(aUSBDevice, aRunFilters, aIgnoreMachine);
    10941094}
    10951095
     
    11111111    AssertReturn(!aDevice->isWriteLockOnCurrentThread(), false);
    11121112
    1113     return aDevice->updateState(aUSBDevice, aRunFilters, aIgnoreMachine);
     1113    return aDevice->i_updateState(aUSBDevice, aRunFilters, aIgnoreMachine);
    11141114}
    11151115
     
    11351135    LogFlowThisFunc(("aDevice=%p name={%s} state=%s id={%RTuuid} aRunFilters=%RTbool aIgnoreMachine=%p\n",
    11361136                     (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(),
    11401140                     (pllOpenedMachines != NULL),       // used to be "bool aRunFilters"
    11411141                     aIgnoreMachine));
     
    12481248         it != mDevices.end();
    12491249         ++it)
    1250         if ((*it)->getId() == Id)
     1250        if ((*it)->i_getId() == Id)
    12511251        {
    12521252            Dev = (*it);
  • trunk/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp

    r47117 r49960  
    226226
    227227    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()));
    229229
    230230    /*
    231231     * Don't think we need to do anything when the device is held... fake it.
    232232     */
    233     Assert(aDevice->getUnistate() == kHostUSBDeviceState_Capturing);
     233    Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_Capturing);
    234234    devLock.release();
    235235    interruptWait();
     
    245245
    246246    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()));
    248248
    249249    /*
    250250     * We're not really holding it atm., just fake it.
    251251     */
    252     Assert(aDevice->getUnistate() == kHostUSBDeviceState_ReleasingToHost);
     252    Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_ReleasingToHost);
    253253    devLock.release();
    254254    interruptWait();
  • trunk/src/VBox/Main/src-server/win/USBProxyServiceWindows.cpp

    r41814 r49960  
    144144
    145145    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);
    149149
    150150    /*
     
    186186
    187187    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);
    191191
    192192    /*
  • trunk/src/VBox/Main/src-server/xpcom/server.cpp

    r49953 r49960  
    110110NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SnapshotMachine, IMachine)
    111111
    112 NS_DECL_CLASSINFO(Snapshot)
    113 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Snapshot, ISnapshot)
    114 
    115112NS_DECL_CLASSINFO(Progress)
    116113NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress)
     
    123120
    124121#ifdef VBOX_WITH_USB
    125 NS_DECL_CLASSINFO(HostUSBDevice)
    126 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(HostUSBDevice, IUSBDevice, IHostUSBDevice)
    127122
    128123#endif
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