Index: /trunk/src/VBox/Main/HostImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/HostImpl.cpp	(revision 31326)
+++ /trunk/src/VBox/Main/HostImpl.cpp	(revision 31327)
@@ -159,4 +159,5 @@
           usbListsLock(LOCKCLASS_USBLIST),
 #endif
+          drivesLock(LOCKCLASS_LISTOFMEDIA),
           fDVDDrivesListBuilt(false),
           fFloppyDrivesListBuilt(false)
@@ -176,4 +177,5 @@
 
     // list of host drives; lazily created by getDVDDrives() and getFloppyDrives()
+    WriteLockHandle         drivesLock;                 // protects the below two lists and the bools
     MediaList               llDVDDrives,
                             llFloppyDrives;
@@ -416,5 +418,5 @@
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+    AutoWriteLock alock(m->drivesLock COMMA_LOCKVAL_SRC_POS);
 
     MediaList *pList;
@@ -442,5 +444,5 @@
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+    AutoWriteLock alock(m->drivesLock COMMA_LOCKVAL_SRC_POS);
 
     MediaList *pList;
@@ -1527,7 +1529,7 @@
  * that may have changed if fRefresh == true.
  *
- * The caller must hold the Host write lock before calling this.
+ * The caller must hold the m->drivesLock write lock before calling this.
  * To protect the list to which the caller's pointer points, the caller
- * must also hold the Host lock.
+ * must also hold that lock.
  *
  * @param mediumType Must be DeviceType_Floppy or DeviceType_DVD.
@@ -1541,5 +1543,5 @@
 {
     HRESULT rc = S_OK;
-    Assert(isWriteLockOnCurrentThread());
+    Assert(m->drivesLock.isWriteLockOnCurrentThread());
 
     MediaList llNew;
@@ -1650,4 +1652,5 @@
  * and looks for a host drive with the given UUID. If found, it sets pMedium
  * to that drive; otherwise returns VBOX_E_OBJECT_NOT_FOUND.
+ *
  * @param mediumType Must be DeviceType_DVD or DeviceType_Floppy.
  * @param uuid Medium UUID of host drive to look for.
@@ -1663,5 +1666,5 @@
     MediaList *pllMedia;
 
-    AutoWriteLock wlock(this COMMA_LOCKVAL_SRC_POS);
+    AutoWriteLock wlock(m->drivesLock COMMA_LOCKVAL_SRC_POS);
     HRESULT rc = getDrives(mediumType, fRefresh, pllMedia);
     if (SUCCEEDED(rc))
@@ -1692,5 +1695,5 @@
     HRESULT rc = S_OK;
 
-    Assert(isWriteLockOnCurrentThread());
+    Assert(m->drivesLock.isWriteLockOnCurrentThread());
 
     try
@@ -1809,5 +1812,5 @@
     HRESULT rc = S_OK;
 
-    Assert(isWriteLockOnCurrentThread());
+    Assert(m->drivesLock.isWriteLockOnCurrentThread());
 
     try
