Index: /trunk/include/VBox/settings.h
===================================================================
--- /trunk/include/VBox/settings.h	(revision 49189)
+++ /trunk/include/VBox/settings.h	(revision 49190)
@@ -959,4 +959,6 @@
           fTempEject(false),
           fNonRotational(false),
+          fDiscard(false),
+          fHotPluggable(false),
           lPort(0),
           lDevice(0)
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 49189)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 49190)
@@ -535,4 +535,5 @@
                      "                            [--nonrotational on|off]\n"
                      "                            [--discard on|off]\n"
+                     "                            [--hotpluggable on|off]\n"
                      "                            [--bandwidthgroup <name>]\n"
                      "                            [--forceunmount]\n"
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp	(revision 49189)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp	(revision 49190)
@@ -55,4 +55,5 @@
     { "--nonrotational",    'n', RTGETOPT_REQ_STRING },
     { "--discard",          'u', RTGETOPT_REQ_STRING },
+    { "--hotpluggable",     'o', RTGETOPT_REQ_STRING },
     { "--bandwidthgroup",   'b', RTGETOPT_REQ_STRING },
     { "--forceunmount",     'f', RTGETOPT_REQ_NOTHING },
@@ -91,4 +92,5 @@
     const char *pszNonRotational = NULL;
     const char *pszDiscard = NULL;
+    const char *pszHotPluggable = NULL;
     const char *pszBandwidthGroup = NULL;
     Bstr bstrNewUuid;
@@ -199,4 +201,13 @@
                 if (ValueUnion.psz)
                     pszDiscard = ValueUnion.psz;
+                else
+                    rc = E_FAIL;
+                break;
+            }
+
+            case 'o':   // hotpluggable <on|off>
+            {
+                if (ValueUnion.psz)
+                    pszHotPluggable = ValueUnion.psz;
                 else
                     rc = E_FAIL;
@@ -853,4 +864,29 @@
         }
 
+        if (   pszHotPluggable
+            && (SUCCEEDED(rc)))
+        {
+            ComPtr<IMediumAttachment> mattach;
+            CHECK_ERROR(machine, GetMediumAttachment(Bstr(pszCtl).raw(), port,
+                                                     device, mattach.asOutParam()));
+
+            if (SUCCEEDED(rc))
+            {
+                if (!RTStrICmp(pszHotPluggable, "on"))
+                {
+                    CHECK_ERROR(machine, SetHotPluggableForDevice(Bstr(pszCtl).raw(),
+                                                                  port, device, TRUE));
+                }
+                else if (!RTStrICmp(pszHotPluggable, "off"))
+                {
+                    CHECK_ERROR(machine, SetHotPluggableForDevice(Bstr(pszCtl).raw(),
+                                                                  port, device, FALSE));
+                }
+                else
+                    throw Utf8StrFmt("Invalid --hotpluggable argument '%s'", pszHotPluggable);
+            }
+            else
+                throw Utf8StrFmt("Couldn't find the controller attachment for the controller '%s'\n", pszCtl);
+        }
 
         if (   pszBandwidthGroup
Index: /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 49189)
+++ /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 49189)
+++ /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 49189)
+++ /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")
