Index: trunk/src/VBox/Main/ConsoleImpl.cpp
===================================================================
--- trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 28977)
+++ trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 29224)
@@ -3280,5 +3280,5 @@
  * @thread  EMT
  */
-DECLCALLBACK(int) Console::changeRemovableMedium(Console *pThis,
+DECLCALLBACK(int) Console::changeRemovableMedium(Console *pConsole,
                                                  const char *pcszDevice,
                                                  unsigned uInstance,
@@ -3288,13 +3288,13 @@
                                                  bool fForce)
 {
-    LogFlowFunc(("pThis=%p uInstance=%u pszDevice=%p:{%s} enmBus=%u, aMediumAtt=%p, fForce=%d\n",
-                 pThis, uInstance, pcszDevice, enmBus, fForce));
-
-    AssertReturn(pThis, VERR_INVALID_PARAMETER);
-
-    AutoCaller autoCaller(pThis);
+    LogFlowFunc(("pConsole=%p uInstance=%u pszDevice=%p:{%s} enmBus=%u, aMediumAtt=%p, fForce=%d\n",
+                 pConsole, uInstance, pcszDevice, enmBus, fForce));
+
+    AssertReturn(pConsole, VERR_INVALID_PARAMETER);
+
+    AutoCaller autoCaller(pConsole);
     AssertComRCReturn(autoCaller.rc(), VERR_ACCESS_DENIED);
 
-    PVM pVM = pThis->mpVM;
+    PVM pVM = pConsole->mpVM;
 
     /*
@@ -3313,7 +3313,7 @@
             LogFlowFunc(("Suspending the VM...\n"));
             /* disable the callback to prevent Console-level state change */
-            pThis->mVMStateChangeCallbackDisabled = true;
+            pConsole->mVMStateChangeCallbackDisabled = true;
             int rc = VMR3Suspend(pVM);
-            pThis->mVMStateChangeCallbackDisabled = false;
+            pConsole->mVMStateChangeCallbackDisabled = false;
             AssertRCReturn(rc, rc);
             fResume = true;
@@ -3343,14 +3343,19 @@
     int rcRet = VINF_SUCCESS;
 
-    rcRet = Console::configMediumAttachment(pCtlInst, pcszDevice, uInstance,
-                                            enmBus, enmIoBackend,
-                                            false /* fSetupMerge */,
-                                            0 /* uMergeSource */,
-                                            0 /* uMergeTarget */,
-                                            aMediumAtt, pThis->mMachineState,
-                                            NULL /* phrc */,
-                                            true /* fAttachDetach */,
-                                            fForce /* fForceUnmount */,
-                                            pVM, NULL /* paLedDevType */);
+    rcRet = pConsole->configMediumAttachment(pCtlInst,
+                                             pcszDevice,
+                                             uInstance,
+                                             enmBus,
+                                             enmIoBackend,
+                                             false /* fSetupMerge */,
+                                             0 /* uMergeSource */,
+                                             0 /* uMergeTarget */,
+                                             aMediumAtt,
+                                             pConsole->mMachineState,
+                                             NULL /* phrc */,
+                                             true /* fAttachDetach */,
+                                             fForce /* fForceUnmount */,
+                                             pVM,
+                                             NULL /* paLedDevType */);
     /** @todo this dumps everything attached to this device instance, which
      * is more than necessary. Dumping the changed LUN would be enough. */
@@ -3364,12 +3369,12 @@
         LogFlowFunc(("Resuming the VM...\n"));
         /* disable the callback to prevent Console-level state change */
-        pThis->mVMStateChangeCallbackDisabled = true;
+        pConsole->mVMStateChangeCallbackDisabled = true;
         rc = VMR3Resume(pVM);
-        pThis->mVMStateChangeCallbackDisabled = false;
+        pConsole->mVMStateChangeCallbackDisabled = false;
         AssertRC(rc);
         if (RT_FAILURE(rc))
         {
             /* too bad, we failed. try to sync the console state with the VMM state */
-            vmstateChangeCallback(pVM, VMSTATE_SUSPENDED, enmVMState, pThis);
+            vmstateChangeCallback(pVM, VMSTATE_SUSPENDED, enmVMState, pConsole);
         }
         /// @todo (r=dmik) if we failed with drive mount, then the VMR3Resume
@@ -7548,5 +7553,6 @@
  */
 /* static */
-DECLCALLBACK(int) Console::reconfigureMediumAttachment(PVM pVM,
+DECLCALLBACK(int) Console::reconfigureMediumAttachment(Console *pConsole,
+                                                       PVM pVM,
                                                        const char *pcszDevice,
                                                        unsigned uInstance,
@@ -7582,11 +7588,18 @@
 
     /* Update the device instance configuration. */
-    rc = Console::configMediumAttachment(pCtlInst, pcszDevice, uInstance,
-                                         enmBus, enmIoBackend,
-                                         fSetupMerge, uMergeSource,
-                                         uMergeTarget, aMediumAtt,
-                                         aMachineState, phrc,
+    rc = pConsole->configMediumAttachment(pCtlInst,
+                                         pcszDevice,
+                                         uInstance,
+                                         enmBus,
+                                         enmIoBackend,
+                                         fSetupMerge,
+                                         uMergeSource,
+                                         uMergeTarget,
+                                         aMediumAtt,
+                                         aMachineState,
+                                         phrc,
                                          true /* fAttachDetach */,
-                                         false /* fForceUnmount */, pVM,
+                                         false /* fForceUnmount */,
+                                         pVM,
                                          NULL /* paLedDevType */);
     /** @todo this dumps everything attached to this device instance, which
