Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h	(revision 42441)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h	(revision 42442)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2012 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp	(revision 42441)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp	(revision 42442)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2012 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -395,9 +395,8 @@
                     {
                         /* just unmount the floppy/dvd */
-                        CHECK_ERROR(machine, MountMedium(Bstr(pszCtl).raw(),
-                                                         port,
-                                                         device,
-                                                         NULL,
-                                                         fForceUnmount));
+                        CHECK_ERROR(machine, UnmountMedium(Bstr(pszCtl).raw(),
+                                                           port,
+                                                           device,
+                                                           fForceUnmount));
                     }
                 }
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 42441)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 42442)
@@ -3757,5 +3757,5 @@
   <interface
     name="IMachine" extends="$unknown"
-    uuid="0e84a036-73bf-49c8-b587-c558d4daa788"
+    uuid="f5b974bd-473b-43b6-b800-1ec40b9a8513"
     wsmap="managed"
     >
@@ -5041,4 +5041,56 @@
       </param>
     </method>
+
+    <method name="UnmountMedium">
+          <desc>
+            Unmounts any currently mounted medium (<link to="IMedium" />,
+            identified by the given UUID @a id) to the given storage controller
+            (<link to="IStorageController" />, identified by @a name),
+            at the indicated port and device. The device must already exist;
+
+            This method is intended only for managing removable media, where the
+            device is fixed but media is changeable at runtime (such as DVDs
+            and floppies). It cannot be used for fixed media such as hard disks.
+
+            The @a controllerPort and @a device parameters specify the device slot
+            and have have the same meaning as with
+            <link to="IMachine::attachDevice" />.
+
+            The specified device slot must have a medium mounted, which will be
+            unmounted. If there is no mounted medium it will do nothing.
+            See <link to="IMedium"/> for more detailed information about
+            attaching/unmounting media.
+
+            <result name="E_INVALIDARG">
+            SATA device, SATA port, IDE port or IDE slot out of range.
+            </result>
+            <result name="VBOX_E_INVALID_OBJECT_STATE">
+            Attempt to unmount medium that is not removeable - not dvd or floppy.
+            </result>
+            <result name="VBOX_E_INVALID_VM_STATE">
+            Invalid machine state.
+            </result>
+            <result name="VBOX_E_OBJECT_IN_USE">
+            Medium already attached to this or another virtual machine.
+            </result>
+            <result name="VBOX_E_OBJECT_NOT_FOUND">
+            Medium not attached to specified port, device, controller.
+            </result>
+
+            </desc>
+              <param name="name" type="wstring" dir="in">
+              <desc>Name of the storage controller to unmount the medium from.</desc>
+              </param>
+              <param name="controllerPort" type="long" dir="in">
+              <desc>Port to unmount the medium from.</desc>
+              </param>
+              <param name="device" type="long" dir="in">
+              <desc>Device slot in the given port to unmount the medium from.</desc>
+              </param>
+              <param name="force" type="boolean" dir="in">
+              <desc>Allows to force unmount of a medium which is locked by 
+              the device slot in the given port medium is attached to.</desc>
+              </param>
+          </method>
 
     <method name="mountMedium">
Index: /trunk/src/VBox/Main/include/MachineImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MachineImpl.h	(revision 42441)
+++ /trunk/src/VBox/Main/include/MachineImpl.h	(revision 42442)
@@ -508,4 +508,6 @@
     STDMETHOD(MountMedium)(IN_BSTR aControllerName, LONG aControllerPort,
                            LONG aDevice, IMedium *aMedium, BOOL aForce);
+    STDMETHOD(UnmountMedium)(IN_BSTR aControllerName, LONG aControllerPort,
+                             LONG aDevice, BOOL aForce);
     STDMETHOD(GetMedium)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice,
                          IMedium **aMedium);
Index: /trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 42441)
+++ /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 42442)
@@ -4350,4 +4350,17 @@
 }
 
+STDMETHODIMP Machine::UnmountMedium(IN_BSTR aControllerName,
+                                    LONG    aControllerPort,
+                                    LONG    aDevice,
+                                    BOOL    aForce)
+{
+     int rc = S_OK;
+     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d",
+                      aControllerName, aControllerPort, aForce));
+
+     rc = MountMedium(aControllerName, aControllerPort, aDevice, NULL, aForce);
+
+     return rc;
+}
 
 STDMETHODIMP Machine::MountMedium(IN_BSTR aControllerName,
