Index: /trunk/src/VBox/Devices/Storage/ATAController.cpp
===================================================================
--- /trunk/src/VBox/Devices/Storage/ATAController.cpp	(revision 35213)
+++ /trunk/src/VBox/Devices/Storage/ATAController.cpp	(revision 35214)
@@ -5443,9 +5443,10 @@
 }
 
-DECLCALLBACK(int) ataControllerInit(PPDMDEVINS pDevIns, PAHCIATACONTROLLER pCtl,
-                                    unsigned iLUNMaster, PPDMIBASE pDrvBaseMaster,
-                                    unsigned iLUNSlave, PPDMIBASE pDrvBaseSlave,
-                                    uint32_t *pcbSSMState, const char *szName, PPDMLED pLed,
-                                    PSTAMCOUNTER pStatBytesRead, PSTAMCOUNTER pStatBytesWritten)
+int ataControllerInit(PPDMDEVINS pDevIns, PAHCIATACONTROLLER pCtl,
+                      unsigned iLUNMaster, PPDMIBASE pDrvBaseMaster, PPDMLED pLedMaster,
+                      PSTAMCOUNTER pStatBytesReadMaster, PSTAMCOUNTER pStatBytesWrittenMaster,
+                      unsigned iLUNSlave, PPDMIBASE pDrvBaseSlave, PPDMLED pLedSlave,
+                      PSTAMCOUNTER pStatBytesReadSlave, PSTAMCOUNTER pStatBytesWrittenSlave,
+                      uint32_t *pcbSSMState, const char *szName)
 {
     int      rc;
@@ -5470,7 +5471,7 @@
         pCtl->aIfs[j].pControllerR0     = MMHyperR3ToR0(PDMDevHlpGetVM(pDevIns), pCtl);
         pCtl->aIfs[j].pControllerRC     = MMHyperR3ToRC(PDMDevHlpGetVM(pDevIns), pCtl);
-        pCtl->aIfs[j].pLed              = pLed;
-        pCtl->aIfs[j].pStatBytesRead    = pStatBytesRead;
-        pCtl->aIfs[j].pStatBytesWritten = pStatBytesWritten;
+        pCtl->aIfs[j].pLed              = j == 0 ? pLedMaster : pLedSlave;
+        pCtl->aIfs[j].pStatBytesRead    = j == 0 ? pStatBytesReadMaster : pStatBytesReadSlave;
+        pCtl->aIfs[j].pStatBytesWritten = j == 0 ? pStatBytesWrittenMaster : pStatBytesWrittenSlave;
     }
 
Index: /trunk/src/VBox/Devices/Storage/ATAController.h
===================================================================
--- /trunk/src/VBox/Devices/Storage/ATAController.h	(revision 35213)
+++ /trunk/src/VBox/Devices/Storage/ATAController.h	(revision 35214)
@@ -421,7 +421,9 @@
  */
 int ataControllerInit(PPDMDEVINS pDevIns, PAHCIATACONTROLLER pCtl,
-                      unsigned iLUNMaster, PPDMIBASE pDrvBaseMaster,
-                      unsigned iLUNSlave, PPDMIBASE pDrvBaseSlave,
-                      uint32_t *pcbSSMState, const char *szName, PPDMLED pLed, PSTAMCOUNTER pStatBytesRead, PSTAMCOUNTER pStatBytesWritten);
+                      unsigned iLUNMaster, PPDMIBASE pDrvBaseMaster, PPDMLED pLedMaster,
+                      PSTAMCOUNTER pStatBytesReadMaster, PSTAMCOUNTER pStatBytesWrittenMaster,
+                      unsigned iLUNSlave, PPDMIBASE pDrvBaseSlave, PPDMLED pLedSlave,
+                      PSTAMCOUNTER pStatBytesReadSlave, PSTAMCOUNTER pStatBytesWrittenSlave,
+                      uint32_t *pcbSSMState, const char *szName);
 
 /**
Index: /trunk/src/VBox/Devices/Storage/DevAHCI.cpp
===================================================================
--- /trunk/src/VBox/Devices/Storage/DevAHCI.cpp	(revision 35213)
+++ /trunk/src/VBox/Devices/Storage/DevAHCI.cpp	(revision 35214)
@@ -8171,8 +8171,12 @@
             rc = ataControllerInit(pDevIns, pCtl,
                                    iPortMaster, pThis->ahciPort[iPortMaster].pDrvBase,
+                                   &pThis->ahciPort[iPortMaster].Led,
+                                   &pThis->ahciPort[iPortMaster].StatBytesRead,
+                                   &pThis->ahciPort[iPortMaster].StatBytesWritten,
                                    iPortSlave, pThis->ahciPort[iPortSlave].pDrvBase,
-                                   &cbSSMState, szName, &pThis->ahciPort[iPortMaster].Led,
-                                   &pThis->ahciPort[iPortMaster].StatBytesRead,
-                                   &pThis->ahciPort[iPortMaster].StatBytesWritten);
+                                   &pThis->ahciPort[iPortSlave].Led,
+                                   &pThis->ahciPort[iPortSlave].StatBytesRead,
+                                   &pThis->ahciPort[iPortSlave].StatBytesWritten,
+                                   &cbSSMState, szName);
             if (RT_FAILURE(rc))
                 return rc;
