Index: /trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp	(revision 61376)
+++ /trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp	(revision 61377)
@@ -36,16 +36,8 @@
 {
     BackupableMediumAttachmentData()
-        : lPort(0),
-          lDevice(0),
-          type(DeviceType_Null),
-          fPassthrough(false),
-          fTempEject(false),
-          fNonRotational(false),
-          fDiscard(false),
-          fImplicit(false),
-          fHotPluggable(false)
+          : fImplicit(false)
     { }
 
-    ComObjPtr<Medium>   pMedium;
+    ComObjPtr<Medium>        pMedium;
     /* Since MediumAttachment is not a first class citizen when it
      * comes to managing settings, having a reference to the storage
@@ -53,16 +45,8 @@
      * to the old, uninitialized instance. Changing this requires
      * substantial changes to MediumImpl.cpp. */
-    const Utf8Str       strControllerName;
     /* Same counts for the assigned bandwidth group */
-    Utf8Str             strBandwidthGroup;
-    const LONG          lPort;
-    const LONG          lDevice;
-    const DeviceType_T  type;
-    bool                fPassthrough;
-    bool                fTempEject;
-    bool                fNonRotational;
-    bool                fDiscard;
-    bool                fImplicit;
-    bool                fHotPluggable;
+    bool                     fImplicit;
+    const Utf8Str            strControllerName;
+    settings::AttachedDevice mData;
 };
 
@@ -75,9 +59,7 @@
 
     /** Reference to Machine object, for checking mutable state. */
-    Machine * const pMachine;
+    Machine * const                            pMachine;
     /* later: const ComObjPtr<MediumAttachment> mPeer; */
-
-    bool                fIsEjected;
-
+    bool                                       fIsEjected;
     Backupable<BackupableMediumAttachmentData> bd;
 };
@@ -146,16 +128,16 @@
     m->bd.allocate();
     m->bd->pMedium = aMedium;
-    unconst(m->bd->strBandwidthGroup) = strBandwidthGroup;
+    m->bd->mData.strBwGroup = strBandwidthGroup;
     unconst(m->bd->strControllerName) = aControllerName;
-    unconst(m->bd->lPort)   = aPort;
-    unconst(m->bd->lDevice) = aDevice;
-    unconst(m->bd->type)    = aType;
-
-    m->bd->fPassthrough = aPassthrough;
-    m->bd->fTempEject = aTempEject;
-    m->bd->fNonRotational = aNonRotational;
-    m->bd->fDiscard = aDiscard;
+    m->bd->mData.lPort   = aPort;
+    m->bd->mData.lDevice = aDevice;
+    m->bd->mData.deviceType    = aType;
+
+    m->bd->mData.fPassThrough = aPassthrough;
+    m->bd->mData.fTempEject = aTempEject;
+    m->bd->mData.fNonRotational = aNonRotational;
+    m->bd->mData.fDiscard = aDiscard;
     m->bd->fImplicit = aImplicit;
-    m->bd->fHotPluggable = aHotPluggable;
+    m->bd->mData.fHotPluggable = aHotPluggable;
 
     /* Confirm a successful initialization when it's the case */
@@ -262,5 +244,5 @@
 
     /* m->bd->port is constant during life time, no need to lock */
-    *aPort = m->bd->lPort;
+    *aPort = m->bd->mData.lPort;
 
     LogFlowThisFuncLeave();
@@ -273,5 +255,5 @@
 
     /* m->bd->device is constant during life time, no need to lock */
-    *aDevice = m->bd->lDevice;
+    *aDevice = m->bd->mData.lDevice;
 
     LogFlowThisFuncLeave();
@@ -284,5 +266,5 @@
 
     /* m->bd->type is constant during life time, no need to lock */
-    *aType = m->bd->type;
+    *aType = m->bd->mData.deviceType;
 
     LogFlowThisFuncLeave();
@@ -297,5 +279,5 @@
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aPassthrough = m->bd->fPassthrough;
+    *aPassthrough = m->bd->mData.fPassThrough;
 
     LogFlowThisFuncLeave();
@@ -310,5 +292,5 @@
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aTemporaryEject = m->bd->fTempEject;
+    *aTemporaryEject = m->bd->mData.fTempEject;
 
     LogFlowThisFuncLeave();
@@ -336,5 +318,5 @@
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aNonRotational = m->bd->fNonRotational;
+    *aNonRotational = m->bd->mData.fNonRotational;
 
     LogFlowThisFuncLeave();
@@ -348,5 +330,5 @@
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aDiscard = m->bd->fDiscard;
+    *aDiscard = m->bd->mData.fDiscard;
 
     LogFlowThisFuncLeave();
@@ -362,8 +344,8 @@
 
     HRESULT hrc = S_OK;
-    if (m->bd->strBandwidthGroup.isNotEmpty())
+    if (m->bd->mData.strBwGroup.isNotEmpty())
     {
         ComObjPtr<BandwidthGroup> pBwGroup;
-        hrc = m->pMachine->i_getBandwidthGroup(m->bd->strBandwidthGroup, pBwGroup, true /* fSetError */);
+        hrc = m->pMachine->i_getBandwidthGroup(m->bd->mData.strBwGroup, pBwGroup, true /* fSetError */);
 
         Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the
@@ -384,5 +366,5 @@
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aHotPluggable = m->bd->fHotPluggable;
+    *aHotPluggable = m->bd->mData.fHotPluggable;
 
     LogFlowThisFuncLeave();
@@ -449,15 +431,15 @@
 LONG MediumAttachment::i_getPort() const
 {
-    return m->bd->lPort;
+    return m->bd->mData.lPort;
 }
 
 LONG MediumAttachment::i_getDevice() const
 {
-    return m->bd->lDevice;
+    return m->bd->mData.lDevice;
 }
 
 DeviceType_T MediumAttachment::i_getType() const
 {
-    return m->bd->type;
+    return m->bd->mData.deviceType;
 }
 
@@ -465,5 +447,5 @@
 {
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
-    return m->bd->fPassthrough;
+    return m->bd->mData.fPassThrough;
 }
 
@@ -471,5 +453,5 @@
 {
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
-    return m->bd->fTempEject;
+    return m->bd->mData.fTempEject;
 }
 
@@ -477,5 +459,5 @@
 {
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
-    return m->bd->fNonRotational;
+    return m->bd->mData.fNonRotational;
 }
 
@@ -483,5 +465,5 @@
 {
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
-    return m->bd->fDiscard;
+    return m->bd->mData.fDiscard;
 }
 
@@ -489,10 +471,10 @@
 {
     AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
-    return m->bd->fHotPluggable;
+    return m->bd->mData.fHotPluggable;
 }
 
 Utf8Str& MediumAttachment::i_getBandwidthGroup() const
 {
-    return m->bd->strBandwidthGroup;
+    return m->bd->mData.strBwGroup;
 }
 
@@ -500,6 +482,6 @@
 {
     return (    aControllerName == m->bd->strControllerName
-             && aPort == m->bd->lPort
-             && aDevice == m->bd->lDevice);
+             && aPort == m->bd->mData.lPort
+             && aDevice == m->bd->mData.lDevice);
 }
 
@@ -533,5 +515,5 @@
 
     m->bd.backup();
-    m->bd->fPassthrough = aPassthrough;
+    m->bd->mData.fPassThrough = aPassthrough;
 }
 
@@ -542,5 +524,5 @@
 
     m->bd.backup();
-    m->bd->fTempEject = aTempEject;
+    m->bd->mData.fTempEject = aTempEject;
 }
 
@@ -559,5 +541,5 @@
 
     m->bd.backup();
-    m->bd->fNonRotational = aNonRotational;
+    m->bd->mData.fNonRotational = aNonRotational;
 }
 
@@ -568,5 +550,5 @@
 
     m->bd.backup();
-    m->bd->fDiscard = aDiscard;
+    m->bd->mData.fDiscard = aDiscard;
 }
 
@@ -577,5 +559,5 @@
 
     m->bd.backup();
-    m->bd->fHotPluggable = aHotPluggable;
+    m->bd->mData.fHotPluggable = aHotPluggable;
 }
 
@@ -586,5 +568,5 @@
 
     m->bd.backup();
-    m->bd->strBandwidthGroup = aBandwidthGroup;
+    m->bd->mData.strBwGroup = aBandwidthGroup;
 
     LogFlowThisFuncLeave();
