Index: /trunk/src/VBox/Main/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumImpl.cpp	(revision 24125)
+++ /trunk/src/VBox/Main/MediumImpl.cpp	(revision 24126)
@@ -996,4 +996,7 @@
     /* there must be a storage unit */
     m->state = MediumState_Created;
+
+    /* remember device type for correct unregistering later */
+    m->devType = aDeviceType;
 
     /* cannot be a host drive */
