Index: /trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp	(revision 61417)
+++ /trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp	(revision 61418)
@@ -7,5 +7,5 @@
 
 /*
- * Copyright (C) 2008-2015 Oracle Corporation
+ * Copyright (C) 2008-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -41,32 +41,4 @@
 DEFINE_EMPTY_CTOR_DTOR(StorageController)
 
-struct BackupableStorageControllerData
-{
-    /* Constructor. */
-    BackupableStorageControllerData()
-        : mStorageBus(StorageBus_IDE),
-          mStorageControllerType(StorageControllerType_PIIX4),
-          mInstance(0),
-          mPortCount(2),
-          fUseHostIOCache(true),
-          fBootable(false)
-    { }
-
-    /** Unique name of the storage controller. */
-    Utf8Str strName;
-    /** The connection type of the storage controller. */
-    StorageBus_T mStorageBus;
-    /** Type of the Storage controller. */
-    StorageControllerType_T mStorageControllerType;
-    /** Instance number of the storage controller. */
-    ULONG mInstance;
-    /** Number of usable ports. */
-    ULONG mPortCount;
-    /** Whether to use the host IO caches. */
-    BOOL fUseHostIOCache;
-    /** Whether it is possible to boot from disks attached to this controller. */
-    BOOL fBootable;
-};
-
 struct StorageController::Data
 {
@@ -85,5 +57,5 @@
     const ComObjPtr<StorageController>  pPeer;
 
-    Backupable<BackupableStorageControllerData> bd;
+    Backupable<settings::StorageController> bd;
 };
 
@@ -152,7 +124,7 @@
 
     m->bd->strName = aName;
-    m->bd->mInstance = aInstance;
+    m->bd->ulInstance = aInstance;
     m->bd->fBootable = fBootable;
-    m->bd->mStorageBus = aStorageBus;
+    m->bd->storageBus = aStorageBus;
     if (   aStorageBus != StorageBus_IDE
         && aStorageBus != StorageBus_Floppy)
@@ -164,29 +136,29 @@
     {
         case StorageBus_IDE:
-            m->bd->mPortCount = 2;
-            m->bd->mStorageControllerType = StorageControllerType_PIIX4;
+            m->bd->ulPortCount = 2;
+            m->bd->controllerType = StorageControllerType_PIIX4;
             break;
         case StorageBus_SATA:
-            m->bd->mPortCount = 30;
-            m->bd->mStorageControllerType = StorageControllerType_IntelAhci;
+            m->bd->ulPortCount = 30;
+            m->bd->controllerType = StorageControllerType_IntelAhci;
             break;
         case StorageBus_SCSI:
-            m->bd->mPortCount = 16;
-            m->bd->mStorageControllerType = StorageControllerType_LsiLogic;
+            m->bd->ulPortCount = 16;
+            m->bd->controllerType = StorageControllerType_LsiLogic;
             break;
         case StorageBus_Floppy:
-            m->bd->mPortCount = 1;
-            m->bd->mStorageControllerType = StorageControllerType_I82078;
+            m->bd->ulPortCount = 1;
+            m->bd->controllerType = StorageControllerType_I82078;
             break;
         case StorageBus_SAS:
-            m->bd->mPortCount = 8;
-            m->bd->mStorageControllerType = StorageControllerType_LsiLogicSas;
+            m->bd->ulPortCount = 8;
+            m->bd->controllerType = StorageControllerType_LsiLogicSas;
         case StorageBus_USB:
-            m->bd->mPortCount = 8;
-            m->bd->mStorageControllerType = StorageControllerType_USB;
+            m->bd->ulPortCount = 8;
+            m->bd->controllerType = StorageControllerType_USB;
             break;
         case StorageBus_PCIe:
-            m->bd->mPortCount = 1;
-            m->bd->mStorageControllerType = StorageControllerType_NVMe;
+            m->bd->ulPortCount = 1;
+            m->bd->controllerType = StorageControllerType_NVMe;
             break;
     }
@@ -364,5 +336,5 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aBus = m->bd->mStorageBus;
+    *aBus = m->bd->storageBus;
 
     return S_OK;
@@ -373,5 +345,5 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aControllerType = m->bd->mStorageControllerType;
+    *aControllerType = m->bd->controllerType;
 
     return S_OK;
@@ -388,5 +360,5 @@
     HRESULT rc = S_OK;
 
-    switch (m->bd->mStorageBus)
+    switch (m->bd->storageBus)
     {
         case StorageBus_IDE:
@@ -436,5 +408,5 @@
         }
         default:
-            AssertMsgFailed(("Invalid controller type %d\n", m->bd->mStorageBus));
+            AssertMsgFailed(("Invalid controller type %d\n", m->bd->storageBus));
             rc = E_INVALIDARG;
     }
@@ -445,8 +417,8 @@
                         aControllerType);
 
-    if (m->bd->mStorageControllerType != aControllerType)
+    if (m->bd->controllerType != aControllerType)
     {
         m->bd.backup();
-        m->bd->mStorageControllerType = aControllerType;
+        m->bd->controllerType = aControllerType;
 
         alock.release();
@@ -465,5 +437,5 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    HRESULT rc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->mStorageBus, aMaxDevicesPerPortCount);
+    HRESULT rc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, aMaxDevicesPerPortCount);
 
     return rc;
@@ -474,5 +446,5 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    HRESULT rc = m->pSystemProperties->GetMinPortCountForStorageBus(m->bd->mStorageBus, aMinPortCount);
+    HRESULT rc = m->pSystemProperties->GetMinPortCountForStorageBus(m->bd->storageBus, aMinPortCount);
     return rc;
 }
@@ -481,5 +453,5 @@
 {
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
-    HRESULT rc = m->pSystemProperties->GetMaxPortCountForStorageBus(m->bd->mStorageBus, aMaxPortCount);
+    HRESULT rc = m->pSystemProperties->GetMaxPortCountForStorageBus(m->bd->storageBus, aMaxPortCount);
 
     return rc;
@@ -490,5 +462,5 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aPortCount = m->bd->mPortCount;
+    *aPortCount = m->bd->ulPortCount;
 
     return S_OK;
@@ -503,5 +475,5 @@
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    switch (m->bd->mStorageBus)
+    switch (m->bd->storageBus)
     {
         case StorageBus_SATA:
@@ -583,11 +555,11 @@
         }
         default:
-            AssertMsgFailed(("Invalid controller type %d\n", m->bd->mStorageBus));
-    }
-
-    if (m->bd->mPortCount != aPortCount)
+            AssertMsgFailed(("Invalid controller type %d\n", m->bd->storageBus));
+    }
+
+    if (m->bd->ulPortCount != aPortCount)
     {
         m->bd.backup();
-        m->bd->mPortCount = aPortCount;
+        m->bd->ulPortCount = aPortCount;
 
         alock.release();
@@ -606,5 +578,5 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    *aInstance = m->bd->mInstance;
+    *aInstance = m->bd->ulInstance;
 
     return S_OK;
@@ -619,8 +591,8 @@
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    if (m->bd->mInstance != aInstance)
+    if (m->bd->ulInstance != aInstance)
     {
         m->bd.backup();
-        m->bd->mInstance = aInstance;
+        m->bd->ulInstance = aInstance;
 
         alock.release();
@@ -687,15 +659,15 @@
 StorageControllerType_T StorageController::i_getControllerType() const
 {
-    return m->bd->mStorageControllerType;
+    return m->bd->controllerType;
 }
 
 StorageBus_T StorageController::i_getStorageBus() const
 {
-    return m->bd->mStorageBus;
+    return m->bd->storageBus;
 }
 
 ULONG StorageController::i_getInstance() const
 {
-    return m->bd->mInstance;
+    return m->bd->ulInstance;
 }
 
@@ -719,7 +691,7 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    ULONG portCount = m->bd->mPortCount;
+    ULONG portCount = m->bd->ulPortCount;
     ULONG devicesPerPort;
-    HRESULT rc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->mStorageBus, &devicesPerPort);
+    HRESULT rc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, &devicesPerPort);
     if (FAILED(rc)) return rc;
 
