Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp	(revision 8566)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp	(revision 8567)
@@ -746,6 +746,6 @@
     , deviceTypes (KDeviceType_COUNT)
     , storageBuses (KStorageBus_COUNT)
-    , storageBusDevices (3)
-    , storageBusChannels (2)
+    , storageBusDevices (2)
+    , storageBusChannels (3)
     , diskTypes (KHardDiskType_COUNT)
     , diskStorageTypes (KHardDiskStorageType_COUNT)
@@ -975,5 +975,5 @@
 QString VBoxGlobal::toString (KStorageBus aBus, LONG aChannel) const
 {
-    Assert (storageBusChannels.count() == 2);
+    Assert (storageBusChannels.count() == 3);
     QString channel;
 
@@ -992,7 +992,5 @@
         case KStorageBus_SATA:
         {
-            AssertMsgBreakVoid (aChannel == 0, ("Invalid channel %d\n", aChannel));
-
-            /* null string since the SATA channel is alwayz zero so far */
+            channel = storageBusChannels [2].arg (aChannel);
             break;
         }
@@ -1026,7 +1024,13 @@
         case KStorageBus_SATA:
         {
-            AssertMsgBreakVoid (aChannel.isEmpty(),
-                                ("Invalid channel {%s}\n", aChannel.latin1()));
-            /* always zero so far for SATA */
+            /// @todo use regexp to properly extract the %1 text
+            QString tpl = storageBusChannels [2].arg ("");
+            if (aChannel.startsWith (tpl))
+            {
+                channel = aChannel.right (aChannel.length() - tpl.length()).toLong();
+                break;
+            }
+
+            AssertMsgFailedBreakVoid (("Invalid channel {%s}\n", aChannel.latin1()));
             break;
         }
@@ -1047,5 +1051,5 @@
     NOREF (aChannel);
 
-    Assert (storageBusDevices.count() == 3);
+    Assert (storageBusDevices.count() == 2);
     QString device;
 
@@ -1064,5 +1068,6 @@
         case KStorageBus_SATA:
         {
-            device = storageBusDevices [2].arg (aDevice);
+            AssertMsgBreakVoid (aDevice == 0, ("Invalid device %d\n", aDevice));
+            /* always zero so far for SATA */
             break;
         }
@@ -1100,13 +1105,7 @@
         case KStorageBus_SATA:
         {
-            /// @todo use regexp to properly extract the %1 text
-            QString tpl = storageBusDevices [2].arg ("");
-            if (aDevice.startsWith (tpl))
-            {
-                device = aDevice.right (aDevice.length() - tpl.length()).toLong();
-                break;
-            }
-
-            AssertMsgFailedBreakVoid (("Invalid device {%s}\n", aDevice.latin1()));
+            AssertMsgBreakVoid(aDevice.isEmpty(), ("Invalid device {%s}\n", aDevice.latin1()));
+            /* always zero for SATA so far. */
+            break;
         }
         default:
@@ -1139,8 +1138,8 @@
         case KStorageBus_SATA:
         {
-            /* we only have one SATA channel so far which is always zero */
+            /* we only have one SATA device so far which is always zero */
             device = QString ("%1 %2")
                 .arg (vboxGlobal().toString (aBus))
-                .arg (vboxGlobal().toString (aBus, aChannel, aDevice));
+                .arg (vboxGlobal().toString (aBus, aChannel));
             break;
         }
@@ -2453,14 +2452,15 @@
         tr ("SATA", "StorageBus");
 
-    Assert (storageBusChannels.count() == 2);
+    Assert (storageBusChannels.count() == 3);
     storageBusChannels [0] =
         tr ("Primary", "StorageBusChannel");
     storageBusChannels [1] =
         tr ("Secondary", "StorageBusChannel");
-
-    Assert (storageBusDevices.count() == 3);
+    storageBusChannels [2] =
+        tr ("Port %1", "StorageBusChannel");
+
+    Assert (storageBusDevices.count() == 2);
     storageBusDevices [0] = tr ("Master", "StorageBusDevice");
     storageBusDevices [1] = tr ("Slave", "StorageBusDevice");
-    storageBusDevices [2] = tr ("Port %1", "StorageBusDevice");
 
     diskTypes [KHardDiskType_Normal] =
Index: trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h	(revision 8566)
+++ trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h	(revision 8567)
@@ -135,6 +135,6 @@
 
         for (int i = 0; i < mSataPortsCount; ++ i)
-            mSATAList << HDSlot (vboxGlobal().toFullString (KStorageBus_SATA, 0, i),
-                                 KStorageBus_SATA, 0, i);
+            mSATAList << HDSlot (vboxGlobal().toFullString (KStorageBus_SATA, i, 0),
+                                 KStorageBus_SATA, i, 0);
 
         emit listChanged();
