Index: trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 49161)
+++ trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 49190)
@@ -1947,4 +1947,17 @@
                                     lPortUsed[u32HDSataPortCount++] = lPortNum;
                                     LogFlowFunc(("HD Sata port Count=%d\n", u32HDSataPortCount));
+                                }
+
+                                /* Configure the hotpluggable flag for the port. */
+                                BOOL fHotPluggable = FALSE;
+                                hrc = pMediumAtt->COMGETTER(HotPluggable)(&fHotPluggable); H();
+                                if (SUCCEEDED(hrc))
+                                {
+                                    PCFGMNODE pPortCfg;
+                                    char szName[24];
+                                    RTStrPrintf(szName, sizeof(szName), "Port%d", lPortNum);
+
+                                    InsertConfigNode(pCfg, szName, &pPortCfg);
+                                    InsertConfigInteger(pPortCfg, "Hotpluggable", fHotPluggable ? 1 : 0);
                                 }
                              }
Index: trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 49161)
+++ trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 49190)
@@ -4512,5 +4512,5 @@
                           false /* fNonRotational */,
                           false /* fDiscard */,
-                          false /* fHotPluggable */,
+                          fHotplug /* fHotPluggable */,
                           Utf8Str::Empty);
     if (FAILED(rc)) return rc;
@@ -4641,4 +4641,9 @@
                         aDevice, aControllerPort, aControllerName);
 
+    if (fHotplug && !pAttach->getHotPluggable())
+        return setError(VBOX_E_NOT_SUPPORTED,
+                        tr("The device slot %d on port %d of controller '%ls' does not support hotplugging"),
+                        aDevice, aControllerPort, aControllerName);
+
     /*
      * The VM has to detach the device before we delete any implicit diffs.
@@ -4876,6 +4881,17 @@
                         aDevice, aControllerPort, aControllerName);
 
-    /** @todo remove this blocker and add the missing code to support this
-     * flag properly in all code areas, with proper support checks below. */
+    /* Check for an existing controller. */
+    ComObjPtr<StorageController> ctl;
+    rc = getStorageControllerByName(aControllerName, ctl, true /* aSetError */);
+    if (FAILED(rc)) return rc;
+
+    StorageControllerType_T ctrlType;
+    rc = ctl->COMGETTER(ControllerType)(&ctrlType);
+    if (FAILED(rc))
+        return setError(E_FAIL,
+                        tr("Could not get type of controller '%ls'"),
+                        aControllerName);
+
+    if (!isControllerHotplugCapable(ctrlType))
     return setError(VBOX_E_NOT_SUPPORTED,
                     tr("Controller '%ls' does not support changing the hot-pluggable device flag"),
@@ -9781,6 +9797,5 @@
                                dev.fNonRotational,
                                dev.fDiscard,
-        /// @todo load setting once the hot-pluggable flag works
-                               false /*dev.fHotPluggable*/,
+                               dev.fHotPluggable,
                                pBwGroup.isNull() ? Utf8Str::Empty : pBwGroup->getName());
         if (FAILED(rc)) break;
@@ -10887,6 +10902,5 @@
         dev.lDevice = pAttach->getDevice();
         dev.fPassThrough = pAttach->getPassthrough();
-        /// @todo save setting once the hot-pluggable flag works
-        dev.fHotPluggable = false /* pAttach->getHotPluggable()*/;
+        dev.fHotPluggable = pAttach->getHotPluggable();
         if (pMedium)
         {
Index: trunk/src/VBox/Main/xml/Settings.cpp
===================================================================
--- trunk/src/VBox/Main/xml/Settings.cpp	(revision 49161)
+++ trunk/src/VBox/Main/xml/Settings.cpp	(revision 49190)
@@ -3442,4 +3442,5 @@
             att.fDiscard = false;
             att.fNonRotational = false;
+            att.fHotPluggable = false;
 
             if (strTemp == "HardDisk")
