VirtualBox

Changeset 61377 in vbox


Ignore:
Timestamp:
Jun 1, 2016 2:20:24 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107685
Message:

bugref:8238 VBoxSVC settings - MediumAttachementImpl.cpp

File:
1 edited

Legend:

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

    r56820 r61377  
    3636{
    3737    BackupableMediumAttachmentData()
    38         : lPort(0),
    39           lDevice(0),
    40           type(DeviceType_Null),
    41           fPassthrough(false),
    42           fTempEject(false),
    43           fNonRotational(false),
    44           fDiscard(false),
    45           fImplicit(false),
    46           fHotPluggable(false)
     38          : fImplicit(false)
    4739    { }
    4840
    49     ComObjPtr<Medium>   pMedium;
     41    ComObjPtr<Medium>        pMedium;
    5042    /* Since MediumAttachment is not a first class citizen when it
    5143     * comes to managing settings, having a reference to the storage
     
    5345     * to the old, uninitialized instance. Changing this requires
    5446     * substantial changes to MediumImpl.cpp. */
    55     const Utf8Str       strControllerName;
    5647    /* Same counts for the assigned bandwidth group */
    57     Utf8Str             strBandwidthGroup;
    58     const LONG          lPort;
    59     const LONG          lDevice;
    60     const DeviceType_T  type;
    61     bool                fPassthrough;
    62     bool                fTempEject;
    63     bool                fNonRotational;
    64     bool                fDiscard;
    65     bool                fImplicit;
    66     bool                fHotPluggable;
     48    bool                     fImplicit;
     49    const Utf8Str            strControllerName;
     50    settings::AttachedDevice mData;
    6751};
    6852
     
    7559
    7660    /** Reference to Machine object, for checking mutable state. */
    77     Machine * const pMachine;
     61    Machine * const                            pMachine;
    7862    /* later: const ComObjPtr<MediumAttachment> mPeer; */
    79 
    80     bool                fIsEjected;
    81 
     63    bool                                       fIsEjected;
    8264    Backupable<BackupableMediumAttachmentData> bd;
    8365};
     
    146128    m->bd.allocate();
    147129    m->bd->pMedium = aMedium;
    148     unconst(m->bd->strBandwidthGroup) = strBandwidthGroup;
     130    m->bd->mData.strBwGroup = strBandwidthGroup;
    149131    unconst(m->bd->strControllerName) = aControllerName;
    150     unconst(m->bd->lPort)   = aPort;
    151     unconst(m->bd->lDevice) = aDevice;
    152     unconst(m->bd->type)    = aType;
    153 
    154     m->bd->fPassthrough = aPassthrough;
    155     m->bd->fTempEject = aTempEject;
    156     m->bd->fNonRotational = aNonRotational;
    157     m->bd->fDiscard = aDiscard;
     132    m->bd->mData.lPort   = aPort;
     133    m->bd->mData.lDevice = aDevice;
     134    m->bd->mData.deviceType    = aType;
     135
     136    m->bd->mData.fPassThrough = aPassthrough;
     137    m->bd->mData.fTempEject = aTempEject;
     138    m->bd->mData.fNonRotational = aNonRotational;
     139    m->bd->mData.fDiscard = aDiscard;
    158140    m->bd->fImplicit = aImplicit;
    159     m->bd->fHotPluggable = aHotPluggable;
     141    m->bd->mData.fHotPluggable = aHotPluggable;
    160142
    161143    /* Confirm a successful initialization when it's the case */
     
    262244
    263245    /* m->bd->port is constant during life time, no need to lock */
    264     *aPort = m->bd->lPort;
     246    *aPort = m->bd->mData.lPort;
    265247
    266248    LogFlowThisFuncLeave();
     
    273255
    274256    /* m->bd->device is constant during life time, no need to lock */
    275     *aDevice = m->bd->lDevice;
     257    *aDevice = m->bd->mData.lDevice;
    276258
    277259    LogFlowThisFuncLeave();
     
    284266
    285267    /* m->bd->type is constant during life time, no need to lock */
    286     *aType = m->bd->type;
     268    *aType = m->bd->mData.deviceType;
    287269
    288270    LogFlowThisFuncLeave();
     
    297279    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    298280
    299     *aPassthrough = m->bd->fPassthrough;
     281    *aPassthrough = m->bd->mData.fPassThrough;
    300282
    301283    LogFlowThisFuncLeave();
     
    310292    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    311293
    312     *aTemporaryEject = m->bd->fTempEject;
     294    *aTemporaryEject = m->bd->mData.fTempEject;
    313295
    314296    LogFlowThisFuncLeave();
     
    336318    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    337319
    338     *aNonRotational = m->bd->fNonRotational;
     320    *aNonRotational = m->bd->mData.fNonRotational;
    339321
    340322    LogFlowThisFuncLeave();
     
    348330    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    349331
    350     *aDiscard = m->bd->fDiscard;
     332    *aDiscard = m->bd->mData.fDiscard;
    351333
    352334    LogFlowThisFuncLeave();
     
    362344
    363345    HRESULT hrc = S_OK;
    364     if (m->bd->strBandwidthGroup.isNotEmpty())
     346    if (m->bd->mData.strBwGroup.isNotEmpty())
    365347    {
    366348        ComObjPtr<BandwidthGroup> pBwGroup;
    367         hrc = m->pMachine->i_getBandwidthGroup(m->bd->strBandwidthGroup, pBwGroup, true /* fSetError */);
     349        hrc = m->pMachine->i_getBandwidthGroup(m->bd->mData.strBwGroup, pBwGroup, true /* fSetError */);
    368350
    369351        Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the
     
    384366    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    385367
    386     *aHotPluggable = m->bd->fHotPluggable;
     368    *aHotPluggable = m->bd->mData.fHotPluggable;
    387369
    388370    LogFlowThisFuncLeave();
     
    449431LONG MediumAttachment::i_getPort() const
    450432{
    451     return m->bd->lPort;
     433    return m->bd->mData.lPort;
    452434}
    453435
    454436LONG MediumAttachment::i_getDevice() const
    455437{
    456     return m->bd->lDevice;
     438    return m->bd->mData.lDevice;
    457439}
    458440
    459441DeviceType_T MediumAttachment::i_getType() const
    460442{
    461     return m->bd->type;
     443    return m->bd->mData.deviceType;
    462444}
    463445
     
    465447{
    466448    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    467     return m->bd->fPassthrough;
     449    return m->bd->mData.fPassThrough;
    468450}
    469451
     
    471453{
    472454    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    473     return m->bd->fTempEject;
     455    return m->bd->mData.fTempEject;
    474456}
    475457
     
    477459{
    478460    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    479     return m->bd->fNonRotational;
     461    return m->bd->mData.fNonRotational;
    480462}
    481463
     
    483465{
    484466    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    485     return m->bd->fDiscard;
     467    return m->bd->mData.fDiscard;
    486468}
    487469
     
    489471{
    490472    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
    491     return m->bd->fHotPluggable;
     473    return m->bd->mData.fHotPluggable;
    492474}
    493475
    494476Utf8Str& MediumAttachment::i_getBandwidthGroup() const
    495477{
    496     return m->bd->strBandwidthGroup;
     478    return m->bd->mData.strBwGroup;
    497479}
    498480
     
    500482{
    501483    return (    aControllerName == m->bd->strControllerName
    502              && aPort == m->bd->lPort
    503              && aDevice == m->bd->lDevice);
     484             && aPort == m->bd->mData.lPort
     485             && aDevice == m->bd->mData.lDevice);
    504486}
    505487
     
    533515
    534516    m->bd.backup();
    535     m->bd->fPassthrough = aPassthrough;
     517    m->bd->mData.fPassThrough = aPassthrough;
    536518}
    537519
     
    542524
    543525    m->bd.backup();
    544     m->bd->fTempEject = aTempEject;
     526    m->bd->mData.fTempEject = aTempEject;
    545527}
    546528
     
    559541
    560542    m->bd.backup();
    561     m->bd->fNonRotational = aNonRotational;
     543    m->bd->mData.fNonRotational = aNonRotational;
    562544}
    563545
     
    568550
    569551    m->bd.backup();
    570     m->bd->fDiscard = aDiscard;
     552    m->bd->mData.fDiscard = aDiscard;
    571553}
    572554
     
    577559
    578560    m->bd.backup();
    579     m->bd->fHotPluggable = aHotPluggable;
     561    m->bd->mData.fHotPluggable = aHotPluggable;
    580562}
    581563
     
    586568
    587569    m->bd.backup();
    588     m->bd->strBandwidthGroup = aBandwidthGroup;
     570    m->bd->mData.strBwGroup = aBandwidthGroup;
    589571
    590572    LogFlowThisFuncLeave();
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