Changeset 35139 in vbox
- Timestamp:
- Dec 15, 2010 3:13:43 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 68976
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumImpl.cpp
r35126 r35139 1747 1747 m->type = aType; 1748 1748 1749 // save the global settings; for that we should hold only the VirtualBox lock 1749 // save the settings 1750 GuidList llRegistriesThatNeedSaving; 1751 addToRegistryIDList(llRegistriesThatNeedSaving); 1750 1752 mlock.release(); 1751 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 1752 HRESULT rc = m->pVirtualBox->saveSettings(); 1753 HRESULT rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); 1753 1754 1754 1755 return rc; … … 1870 1871 m->strLocationFull.c_str()); 1871 1872 1873 HRESULT rc = S_OK; 1874 1872 1875 if (m->autoReset != !!aAutoReset) 1873 1876 { 1874 1877 m->autoReset = !!aAutoReset; 1875 1878 1876 // save the global settings; for that we should hold only the VirtualBox lock 1879 // save the settings 1880 GuidList llRegistriesThatNeedSaving; 1881 addToRegistryIDList(llRegistriesThatNeedSaving); 1877 1882 mlock.release(); 1878 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS);1879 return m->pVirtualBox->saveSettings();1880 } 1881 1882 return S_OK; 1883 } 1883 rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); 1884 } 1885 1886 return rc; 1887 } 1888 1884 1889 STDMETHODIMP Medium::COMGETTER(LastAccessError)(BSTR *aLastAccessError) 1885 1890 { … … 2300 2305 it->second = aValue; 2301 2306 2302 // save the global settings; for that we should hold only the VirtualBox lock 2307 // save the settings 2308 GuidList llRegistriesThatNeedSaving; 2309 addToRegistryIDList(llRegistriesThatNeedSaving); 2303 2310 mlock.release(); 2304 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 2305 HRESULT rc = m->pVirtualBox->saveSettings(); 2311 HRESULT rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); 2306 2312 2307 2313 return rc; … … 2377 2383 } 2378 2384 2385 // save the settings 2386 GuidList llRegistriesThatNeedSaving; 2387 addToRegistryIDList(llRegistriesThatNeedSaving); 2379 2388 mlock.release(); 2380 2381 // saveSettings needs vbox lock 2382 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 2383 HRESULT rc = m->pVirtualBox->saveSettings(); 2389 HRESULT rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); 2384 2390 2385 2391 return rc; … … 6604 6610 { 6605 6611 // in asynchronous mode, save settings now 6606 // for that we should hold only the VirtualBox lock6607 AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS);6608 m->pVirtualBox->saveSettings();6612 GuidList llRegistriesThatNeedSaving; 6613 addToRegistryIDList(llRegistriesThatNeedSaving); 6614 rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); 6609 6615 } 6610 6616 else … … 6869 6875 // now, at the end of this task (always asynchronous), save the settings 6870 6876 { 6871 AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 6872 m->pVirtualBox->saveSettings(); 6877 // save the settings 6878 GuidList llRegistriesThatNeedSaving; 6879 addToRegistryIDList(llRegistriesThatNeedSaving); 6880 rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); 6873 6881 } 6874 6882 … … 7623 7631 // now, at the end of this task (always asynchronous), save the settings 7624 7632 { 7625 AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 7626 m->pVirtualBox->saveSettings(); 7633 // save the settings 7634 GuidList llRegistriesThatNeedSaving; 7635 addToRegistryIDList(llRegistriesThatNeedSaving); 7636 rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); 7627 7637 } 7628 7638 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r34795 r35139 3732 3732 } 3733 3733 3734 /** 3735 * Saves all settings files according to the given list of UUIDs, which are 3736 * either machine IDs (in which case Machine::saveSettings is invoked) or 3737 * the global registry UUID (in which case VirtualBox::saveSettings is invoked). 3738 * 3739 * This locks machines and the VirtualBox object as necessary, so better not 3740 * hold any locks before calling this. 3741 * 3742 * @param llRegistriesThatNeedSaving 3743 * @return 3744 */ 3734 3745 HRESULT VirtualBox::saveRegistries(const GuidList &llRegistriesThatNeedSaving) 3735 3746 {
Note:
See TracChangeset
for help on using the changeset viewer.