Index: trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp	(revision 98808)
@@ -1710,7 +1710,7 @@
 }
 
-void UICommon::prepareStorageMenu(QMenu &menu,
-                                    QObject *pListener, const char *pszSlotName,
-                                    const CMachine &comMachine, const QString &strControllerName, const StorageSlot &storageSlot)
+void UICommon::prepareStorageMenu(QMenu *pMenu,
+                                  QObject *pListener, const char *pszSlotName,
+                                  const CMachine &comMachine, const QString &strControllerName, const StorageSlot &storageSlot)
 {
     /* Current attachment attributes: */
@@ -1730,6 +1730,6 @@
 
     /* Prepare open-existing-medium action: */
-    QAction *pActionOpenExistingMedium = menu.addAction(UIIconPool::iconSet(":/select_file_16px.png"),
-                                                        QString(), pListener, pszSlotName);
+    QAction *pActionOpenExistingMedium = pMenu->addAction(UIIconPool::iconSet(":/select_file_16px.png"),
+                                                          QString(), pListener, pszSlotName);
     pActionOpenExistingMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(),
                                                                           comCurrentAttachment.GetDevice(), enmMediumType)));
@@ -1738,6 +1738,6 @@
 
     /* Prepare open medium file action: */
-    QAction *pActionFileSelector = menu.addAction(UIIconPool::iconSet(":/select_file_16px.png"),
-                                                  QString(), pListener, pszSlotName);
+    QAction *pActionFileSelector = pMenu->addAction(UIIconPool::iconSet(":/select_file_16px.png"),
+                                                    QString(), pListener, pszSlotName);
     pActionFileSelector->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(),
                                                                     comCurrentAttachment.GetDevice(), enmMediumType,
@@ -1747,5 +1747,5 @@
 
     /* Insert separator: */
-    menu.addSeparator();
+    pMenu->addSeparator();
 
     /* Get existing-host-drive vector: */
@@ -1777,5 +1777,5 @@
         if (!fIsHostDriveUsed)
         {
-            QAction *pActionChooseHostDrive = menu.addAction(UIMedium(comMedium, enmMediumType).name(), pListener, pszSlotName);
+            QAction *pActionChooseHostDrive = pMenu->addAction(UIMedium(comMedium, enmMediumType).name(), pListener, pszSlotName);
             pActionChooseHostDrive->setCheckable(true);
             pActionChooseHostDrive->setChecked(!comCurrentMedium.isNull() && comMedium.GetId() == uCurrentID);
@@ -1832,6 +1832,6 @@
         if (!fIsRecentMediumUsed)
         {
-            QAction *pActionChooseRecentMedium = menu.addAction(QFileInfo(strRecentMediumLocation).fileName(),
-                                                                pListener, pszSlotName);
+            QAction *pActionChooseRecentMedium = pMenu->addAction(QFileInfo(strRecentMediumLocation).fileName(),
+                                                                  pListener, pszSlotName);
             pActionChooseRecentMedium->setCheckable(true);
             pActionChooseRecentMedium->setChecked(!comCurrentMedium.isNull() && strRecentMediumLocation == strCurrentLocation);
@@ -1850,8 +1850,8 @@
     {
         /* Insert separator: */
-        menu.addSeparator();
+        pMenu->addSeparator();
 
         /* Prepare unmount-current-medium action: */
-        QAction *pActionUnmountMedium = menu.addAction(QString(), pListener, pszSlotName);
+        QAction *pActionUnmountMedium = pMenu->addAction(QString(), pListener, pszSlotName);
         pActionUnmountMedium->setEnabled(!comCurrentMedium.isNull());
         pActionUnmountMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(),
Index: trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h	(revision 98808)
@@ -421,5 +421,5 @@
           * @param  strControllerName  Brings the name of the #CStorageController in the @a machine above.
           * @param  storageSlot        Brings the #StorageSlot of the storage controller with @a strControllerName above. */
-        void prepareStorageMenu(QMenu &menu,
+        void prepareStorageMenu(QMenu *pMenu,
                                 QObject *pListener, const char *pszSlotName,
                                 const CMachine &comMachine, const QString &strControllerName, const StorageSlot &storageSlot);
Index: trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp	(revision 98808)
@@ -1077,5 +1077,5 @@
 
     /* Fill storage-menu: */
-    uiCommon().prepareStorageMenu(menu, this, SLOT(sltMountStorageMedium()),
+    uiCommon().prepareStorageMenu(&menu, this, SLOT(sltMountStorageMedium()),
                                   machine(), strControllerName, storageSlot);
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 98808)
@@ -770,4 +770,18 @@
 {
     return uisession()->mountBootMedium(uMediumId);
+}
+
+void UIMachine::prepareStorageMenu(QMenu *pMenu,
+                                   QObject *pListener, const char *pszSlotName,
+                                   const QString &strControllerName, const StorageSlot &storageSlot)
+{
+    return uisession()->prepareStorageMenu(pMenu,
+                                           pListener, pszSlotName,
+                                           strControllerName, storageSlot);
+}
+
+void UIMachine::updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool)
+{
+    return uisession()->updateMachineStorage(target, pActionPool);
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h	(revision 98808)
@@ -40,4 +40,5 @@
 #include "UIExtraDataDefs.h"
 #include "UIMachineDefs.h"
+#include "UIMediumDefs.h"
 #include "UIMousePointerShapeData.h"
 #include "UITextTable.h"
@@ -527,4 +528,11 @@
           * if it can find an appropriate controller and port. */
         bool mountBootMedium(const QUuid &uMediumId);
+
+        /** Prepares storage menu. */
+        void prepareStorageMenu(QMenu *pMenu,
+                                QObject *pListener, const char *pszSlotName,
+                                const QString &strControllerName, const StorageSlot &storageSlot);
+        /** Updates machine storage with data described by target. */
+        void updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool);
     /** @} */
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 98808)
@@ -268,9 +268,4 @@
 {
     return uimachine()->actionPool();
-}
-
-CMachine& UIMachineLogic::machine() const
-{
-    return uisession()->machine();
 }
 
@@ -2167,5 +2162,5 @@
 
     /* Update current machine mount-target: */
-    uiCommon().updateMachineStorage(machine(), target, actionPool());
+    uimachine()->updateMachineStorage(target, actionPool());
 }
 
@@ -2683,7 +2678,7 @@
 
         /* Fill current storage menu: */
-        uiCommon().prepareStorageMenu(*pStorageMenu,
-                                      this, SLOT(sltMountStorageMedium()), machine(),
-                                      guiStorageDevice.m_strControllerName, guiStorageDevice.m_guiStorageSlot);
+        uimachine()->prepareStorageMenu(pStorageMenu,
+                                        this, SLOT(sltMountStorageMedium()),
+                                        guiStorageDevice.m_strControllerName, guiStorageDevice.m_guiStorageSlot);
     }
 }
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 98808)
@@ -37,7 +37,4 @@
 #include "UISettingsDialog.h"
 
-/* COM includes: */
-#include "COMEnums.h"
-
 /* Forward declarations: */
 class QAction;
@@ -54,7 +51,4 @@
 class UISoftKeyboard;
 class UIVMInformationDialog;
-class CMachine;
-class CMouse;
-class CSnapshot;
 class CUSBDevice;
 class CVirtualBoxErrorInfo;
@@ -107,7 +101,4 @@
     /** Returns action-pool reference.  */
     UIActionPool *actionPool() const;
-
-    /** Returns the session's machine reference. */
-    CMachine& machine() const;
 
     /** Returns the machine name. */
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 98808)
@@ -844,4 +844,20 @@
 }
 
+void UISession::prepareStorageMenu(QMenu *pMenu,
+                                   QObject *pListener, const char *pszSlotName,
+                                   const QString &strControllerName, const StorageSlot &storageSlot)
+{
+    CMachine comMachine = machine();
+    uiCommon().prepareStorageMenu(pMenu,
+                                  pListener, pszSlotName,
+                                  comMachine, strControllerName, storageSlot);
+}
+
+void UISession::updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool)
+{
+    CMachine comMachine = machine();
+    uiCommon().updateMachineStorage(comMachine, target, pActionPool);
+}
+
 bool UISession::usbDevices(QList<USBDeviceInfo> &guiUSBDevices)
 {
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 98806)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 98808)
@@ -338,4 +338,11 @@
           * if it can find an appropriate controller and port. */
         bool mountBootMedium(const QUuid &uMediumId);
+
+        /** Prepares storage menu. */
+        void prepareStorageMenu(QMenu *pMenu,
+                                QObject *pListener, const char *pszSlotName,
+                                const QString &strControllerName, const StorageSlot &storageSlot);
+        /** Updates machine storage with data described by target. */
+        void updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool);
     /** @} */
 
