Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 31235)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 31236)
@@ -3530,5 +3530,5 @@
     {
         /* as the last step, associate the medium to the VM */
-        rc = medium->attachTo(mData->mUuid);
+        rc = medium->addBackReference(mData->mUuid);
         /* here we can fail because of Deleting, or being in process of
          * creating a Diff */
@@ -3764,7 +3764,7 @@
         /* For non-hard disk media, detach straight away. */
         if (mediumType != DeviceType_HardDisk && !oldmedium.isNull())
-            oldmedium->detachFrom(mData->mUuid);
+            oldmedium->removeBackReference(mData->mUuid);
         if (!medium.isNull())
-            medium->attachTo(mData->mUuid);
+            medium->addBackReference(mData->mUuid);
         pAttach->updateMedium(medium, false /* aImplicit */);
         setModified(IsModified_Storage);
@@ -3779,5 +3779,5 @@
     {
         if (!medium.isNull())
-            medium->detachFrom(mData->mUuid);
+            medium->removeBackReference(mData->mUuid);
         pAttach = findAttachment(mMediaData->mAttachments,
                                  aControllerName,
@@ -3790,5 +3790,5 @@
         /* For non-hard disk media, re-attach straight away. */
         if (mediumType != DeviceType_HardDisk && !oldmedium.isNull())
-            oldmedium->attachTo(mData->mUuid);
+            oldmedium->addBackReference(mData->mUuid);
         pAttach->updateMedium(oldmedium, false /* aImplicit */);
     }
@@ -6478,5 +6478,5 @@
             if (hd.isNull())
                 continue;
-            HRESULT rc = hd->detachFrom(mData->mUuid, getSnapshotId());
+            HRESULT rc = hd->removeBackReference(mData->mUuid, getSnapshotId());
             AssertComRC(rc);
         }
@@ -7294,7 +7294,7 @@
         {
             if (isSnapshotMachine())
-                rc = medium->attachTo(mData->mUuid, *aSnapshotId);
+                rc = medium->addBackReference(mData->mUuid, *aSnapshotId);
             else
-                rc = medium->attachTo(mData->mUuid);
+                rc = medium->addBackReference(mData->mUuid);
         }
 
@@ -8474,5 +8474,5 @@
             AssertComRCThrowRC(rc);
 
-            rc = diff->attachTo(mData->mUuid);
+            rc = diff->addBackReference(mData->mUuid);
             AssertComRCThrowRC(rc);
 
@@ -8556,5 +8556,5 @@
             /* deassociate and mark for deletion */
             LogFlowThisFunc(("Detaching '%s', pending deletion\n", (*it)->getLogName()));
-            rc = hd->detachFrom(mData->mUuid);
+            rc = hd->removeBackReference(mData->mUuid);
             AssertComRC(rc);
             implicitAtts.push_back(*it);
@@ -8567,5 +8567,5 @@
             /* no: de-associate */
             LogFlowThisFunc(("Detaching '%s', no deletion\n", (*it)->getLogName()));
-            rc = hd->detachFrom(mData->mUuid);
+            rc = hd->removeBackReference(mData->mUuid);
             AssertComRC(rc);
             continue;
@@ -8761,8 +8761,8 @@
         // if this is from a snapshot, do not defer detachment to commitMedia()
         if (pSnapshot)
-            oldmedium->detachFrom(mData->mUuid, pSnapshot->getId());
+            oldmedium->removeBackReference(mData->mUuid, pSnapshot->getId());
         // else if non-hard disk media, do not defer detachment to commitMedia() either
         else if (mediumType != DeviceType_HardDisk)
-            oldmedium->detachFrom(mData->mUuid);
+            oldmedium->removeBackReference(mData->mUuid);
     }
 
@@ -8941,5 +8941,5 @@
 
             /* now de-associate from the current machine state */
-            rc = pMedium->detachFrom(mData->mUuid);
+            rc = pMedium->removeBackReference(mData->mUuid);
             AssertComRC(rc);
 
@@ -9017,5 +9017,5 @@
             if (pMedium)
             {
-                rc = pMedium->detachFrom(mData->mUuid);
+                rc = pMedium->removeBackReference(mData->mUuid);
                 AssertComRC(rc);
             }
@@ -9031,5 +9031,5 @@
             if (pMedium)
             {
-                rc = pMedium->attachTo(mData->mUuid);
+                rc = pMedium->addBackReference(mData->mUuid);
                 AssertComRC(rc);
             }
Index: /trunk/src/VBox/Main/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumImpl.cpp	(revision 31235)
+++ /trunk/src/VBox/Main/MediumImpl.cpp	(revision 31236)
@@ -2656,6 +2656,6 @@
  * @param aSnapshotId   Snapshot ID; when non-empty, adds a snapshot attachment.
  */
-HRESULT Medium::attachTo(const Guid &aMachineId,
-                         const Guid &aSnapshotId /*= Guid::Empty*/)
+HRESULT Medium::addBackReference(const Guid &aMachineId,
+                                 const Guid &aSnapshotId /*= Guid::Empty*/)
 {
     AssertReturn(!aMachineId.isEmpty(), E_FAIL);
@@ -2749,6 +2749,6 @@
  *                      attachment.
  */
-HRESULT Medium::detachFrom(const Guid &aMachineId,
-                           const Guid &aSnapshotId /*= Guid::Empty*/)
+HRESULT Medium::removeBackReference(const Guid &aMachineId,
+                                    const Guid &aSnapshotId /*= Guid::Empty*/)
 {
     AssertReturn(!aMachineId.isEmpty(), E_FAIL);
Index: /trunk/src/VBox/Main/SnapshotImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/SnapshotImpl.cpp	(revision 31235)
+++ /trunk/src/VBox/Main/SnapshotImpl.cpp	(revision 31236)
@@ -966,5 +966,5 @@
         if (pMedium) // can be NULL for non-harddisk
         {
-            rc = pMedium->attachTo(mData->mUuid, mSnapshotId);
+            rc = pMedium->addBackReference(mData->mUuid, mSnapshotId);
             AssertComRC(rc);
         }
@@ -1944,5 +1944,5 @@
             // from the current machine data; saveSettings() below would then
             // compare the current machine data with the one in the backup
-            // and actually call Medium::detachFrom(). But that works only half
+            // and actually call Medium::removeBackReference(). But that works only half
             // the time in our case so instead we force a detachment here:
             // remove from machine data
@@ -1952,5 +1952,5 @@
             mMediaData.backedUpData()->mAttachments.remove(pAttach);
             // then clean up backrefs
-            pMedium->detachFrom(mData->mUuid);
+            pMedium->removeBackReference(mData->mUuid);
 
             llDiffsToDelete.push_back(pMedium);
@@ -2452,5 +2452,5 @@
                 // with the snapshot until the merge was successful.
                 HRESULT rc2 = S_OK;
-                rc2 = pSource->detachFrom(replaceMachineId, replaceSnapshotId);
+                rc2 = pSource->removeBackReference(replaceMachineId, replaceSnapshotId);
                 AssertComRC(rc2);
 
@@ -2647,5 +2647,5 @@
                 pAtt = findAttachment(pSnapMachine->mMediaData->mAttachments,
                                       it->mpTarget);
-                it->mpTarget->detachFrom(machineId, snapshotId);
+                it->mpTarget->removeBackReference(machineId, snapshotId);
             }
             else
@@ -2673,5 +2673,5 @@
                     AutoWriteLock attLock(pAtt COMMA_LOCKVAL_SRC_POS);
                     pAtt->updateMedium(it->mpTarget, false /* aImplicit */);
-                    it->mpTarget->attachTo(pMachine->mData->mUuid, childSnapshotId);
+                    it->mpTarget->addBackReference(pMachine->mData->mUuid, childSnapshotId);
                 }
             }
@@ -3102,5 +3102,5 @@
     {
         // reattach the source media to the snapshot
-        HRESULT rc = aSource->attachTo(aMachineId, aSnapshotId);
+        HRESULT rc = aSource->addBackReference(aMachineId, aSnapshotId);
         AssertComRC(rc);
     }
Index: /trunk/src/VBox/Main/include/MediumImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MediumImpl.h	(revision 31235)
+++ /trunk/src/VBox/Main/include/MediumImpl.h	(revision 31236)
@@ -167,8 +167,8 @@
     Utf8Str getName();
 
-    HRESULT attachTo(const Guid &aMachineId,
-                     const Guid &aSnapshotId = Guid::Empty);
-    HRESULT detachFrom(const Guid &aMachineId,
-                       const Guid &aSnapshotId = Guid::Empty);
+    HRESULT addBackReference(const Guid &aMachineId,
+                             const Guid &aSnapshotId = Guid::Empty);
+    HRESULT removeBackReference(const Guid &aMachineId,
+                                const Guid &aSnapshotId = Guid::Empty);
 
     const Guid* getFirstMachineBackrefId() const;
