Changeset 72205 in vbox for trunk/src/VBox/Main
- Timestamp:
- May 14, 2018 6:37:50 PM (7 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r71108 r72205 10817 10817 // decide which medium registry to use now that the medium is attached: 10818 10818 Guid uuid; 10819 if (mData->pMachineConfigFile->canHaveOwnMediaRegistry()) 10819 bool fCanHaveOwnMediaRegistry = mData->pMachineConfigFile->canHaveOwnMediaRegistry(); 10820 if (fCanHaveOwnMediaRegistry) 10820 10821 // machine XML is VirtualBox 4.0 or higher: 10821 10822 uuid = i_getId(); // machine UUID … … 10823 10824 uuid = mParent->i_getGlobalRegistryId(); // VirtualBox global registry UUID 10824 10825 10826 if (fCanHaveOwnMediaRegistry && pMedium->i_removeRegistry(mParent->i_getGlobalRegistryId())) 10827 mParent->i_markRegistryModified(mParent->i_getGlobalRegistryId()); 10825 10828 if (pMedium->i_addRegistry(uuid)) 10826 10829 mParent->i_markRegistryModified(uuid); … … 10832 10835 /* Tree lock needed by Medium::addRegistry when recursing. */ 10833 10836 AutoReadLock treeLock(&mParent->i_getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS); 10837 if (fCanHaveOwnMediaRegistry && pMedium->i_removeRegistryRecursive(mParent->i_getGlobalRegistryId())) 10838 { 10839 treeLock.release(); 10840 mParent->i_markRegistryModified(mParent->i_getGlobalRegistryId()); 10841 treeLock.acquire(); 10842 } 10834 10843 if (pBase->i_addRegistryRecursive(uuid)) 10835 10844 { -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r69500 r72205 4382 4382 AssertComRCReturnRC(mediumCaller.rc()); 4383 4383 4384 bool fAddToGlobalRegistry = false; 4384 4385 const char *pszDevType = NULL; 4386 Guid regId; 4385 4387 ObjectsList<Medium> *pall = NULL; 4386 4388 DeviceType_T devType; … … 4388 4390 AutoReadLock mediumLock(pMedium COMMA_LOCKVAL_SRC_POS); 4389 4391 devType = pMedium->i_getDeviceType(); 4392 4393 if (!pMedium->i_getFirstRegistryMachineId(regId)) 4394 fAddToGlobalRegistry = true; 4390 4395 } 4391 4396 switch (devType) … … 4462 4467 Assert(!i_getMediaTreeLockHandle().isWriteLockOnCurrentThread()); 4463 4468 *ppMedium = pDupMedium; 4469 } 4470 4471 if (fAddToGlobalRegistry) 4472 { 4473 AutoWriteLock mediumLock(pMedium COMMA_LOCKVAL_SRC_POS); 4474 if (pMedium->i_addRegistry(m->uuidMediaRegistry)) 4475 i_markRegistryModified(m->uuidMediaRegistry); 4464 4476 } 4465 4477
Note:
See TracChangeset
for help on using the changeset viewer.