Changeset 63581 in vbox
- Timestamp:
- Aug 18, 2016 10:58:11 AM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r63563 r63581 1706 1706 HRESULT Medium::setDescription(const com::Utf8Str &aDescription) 1707 1707 { 1708 // AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1709 1710 /// @todo update m->description and save the global registry (and local 1708 /// @todo update m->strDescription and save the global registry (and local 1711 1709 /// registries of portable VMs referring to this medium), this will also 1712 1710 /// require to add the mRegistered flag to data 1713 NOREF(aDescription); 1714 ReturnComNotImplemented(); 1711 1712 HRESULT rc = S_OK; 1713 1714 MediumLockList *pMediumLockList(new MediumLockList()); 1715 1716 try 1717 { 1718 // locking: we need the tree lock first because we access parent pointers 1719 // and we need to write-lock the media involved 1720 uint32_t cHandles = 2; 1721 LockHandle* pHandles[2] = { &m->pVirtualBox->i_getMediaTreeLockHandle(), 1722 this->lockHandle() }; 1723 1724 AutoWriteLock alock(cHandles, 1725 pHandles 1726 COMMA_LOCKVAL_SRC_POS); 1727 1728 /* Build the lock list. */ 1729 alock.release(); 1730 rc = i_createMediumLockList(true /* fFailIfInaccessible */, 1731 this /* pToLockWrite */, 1732 true /* fMediumLockWriteAll */, 1733 NULL, 1734 *pMediumLockList); 1735 alock.acquire(); 1736 1737 if (FAILED(rc)) 1738 { 1739 throw setError(rc, 1740 tr("Failed to create medium lock list for '%s'"), 1741 i_getLocationFull().c_str()); 1742 } 1743 1744 alock.release(); 1745 rc = pMediumLockList->Lock(); 1746 alock.acquire(); 1747 1748 if (FAILED(rc)) 1749 { 1750 throw setError(rc, 1751 tr("Failed to lock media '%s'"), 1752 i_getLocationFull().c_str()); 1753 } 1754 1755 /* Set a new description */ 1756 if (SUCCEEDED(rc)) 1757 { 1758 m->strDescription = aDescription; 1759 } 1760 1761 // save the settings 1762 i_markRegistriesModified(); 1763 m->pVirtualBox->i_saveModifiedRegistries(); 1764 } 1765 catch (HRESULT aRC) { rc = aRC; } 1766 1767 delete pMediumLockList; 1768 1769 return rc; 1715 1770 } 1716 1771
Note:
See TracChangeset
for help on using the changeset viewer.

