Changeset 31370 in vbox
- Timestamp:
- Aug 4, 2010 6:49:09 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
-
Main/MediumImpl.cpp (modified) (3 diffs)
-
Main/VirtualBoxImpl.cpp (modified) (1 diff)
-
Main/include/MediumImpl.h (modified) (1 diff)
-
Runtime/testcase/Makefile.kmk (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumImpl.cpp
r31358 r31370 2858 2858 * @note Locks this object for writing. 2859 2859 */ 2860 HRESULT Medium::updatePath(const char *aOldPath, const char *aNewPath)2861 { 2862 AssertReturn( aOldPath, E_FAIL);2863 AssertReturn( aNewPath, E_FAIL);2860 HRESULT Medium::updatePath(const Utf8Str &strOldPath, const Utf8Str &strNewPath) 2861 { 2862 AssertReturn(!strOldPath.isEmpty(), E_FAIL); 2863 AssertReturn(!strNewPath.isEmpty(), E_FAIL); 2864 2864 2865 2865 AutoCaller autoCaller(this); … … 2872 2872 const char *pcszMediumPath = m->strLocationFull.c_str(); 2873 2873 2874 if (RTPathStartsWith(pcszMediumPath, aOldPath)) 2875 { 2876 Utf8Str newPath = Utf8StrFmt("%s%s", 2877 aNewPath, 2878 pcszMediumPath + strlen(aOldPath)); 2874 if (RTPathStartsWith(pcszMediumPath, strOldPath.c_str())) 2875 { 2876 Utf8Str newPath(strNewPath); 2877 newPath.append(pcszMediumPath + strOldPath.length()); 2879 2878 unconst(m->strLocationFull) = newPath; 2880 2879 … … 2887 2886 2888 2887 return S_OK; 2889 }2890 2891 /**2892 * Checks if the given change of \a aOldPath to \a aNewPath affects the location2893 * of this medium or any its child and updates the paths if necessary to2894 * reflect the new location.2895 *2896 * @param aOldPath Old path (full).2897 * @param aNewPath New path (full).2898 *2899 * @note Locks the medium tree for reading, this object and all children for writing.2900 */2901 void Medium::updatePaths(const char *aOldPath, const char *aNewPath)2902 {2903 AssertReturnVoid(aOldPath);2904 AssertReturnVoid(aNewPath);2905 2906 AutoCaller autoCaller(this);2907 AssertComRCReturnVoid(autoCaller.rc());2908 2909 /* we access children() */2910 AutoReadLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);2911 2912 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2913 2914 updatePath(aOldPath, aNewPath);2915 2916 /* update paths of all children */2917 for (MediaList::const_iterator it = getChildren().begin();2918 it != getChildren().end();2919 ++it)2920 {2921 (*it)->updatePaths(aOldPath, aNewPath);2922 }2923 2888 } 2924 2889 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r31358 r31370 3226 3226 { 3227 3227 const Data::PendingMachineRename &pmr = *it2; 3228 const char *pcszOld = pmr.strConfigDirOld.c_str(); 3229 const char *pcszNew = pmr.strConfigDirNew.c_str(); 3230 pMedium->updatePath(pcszOld, pcszNew); 3228 pMedium->updatePath(pmr.strConfigDirOld, 3229 pmr.strConfigDirNew); 3231 3230 } 3232 3231 } -
trunk/src/VBox/Main/include/MediumImpl.h
r31358 r31370 188 188 #endif 189 189 190 HRESULT updatePath(const char *aOldPath, const char *aNewPath); 191 void updatePaths(const char *aOldPath, const char *aNewPath); 190 HRESULT updatePath(const Utf8Str &strOldPath, const Utf8Str &strNewPath); 192 191 193 192 ComObjPtr<Medium> getBase(uint32_t *aLevel = NULL); -
trunk/src/VBox/Runtime/testcase/Makefile.kmk
r31329 r31370 124 124 tstRTProcIsRunningByName \ 125 125 tstRTBitOperationsPIC3 \ 126 tstInlineAsmPIC \127 126 tstInlineAsmPIC3 127 if1of ($(USERNAME), umoeller) 128 else 129 PROGRAMS.linux += \ 130 tstInlineAsmPIC 131 endif 128 132 PROGRAMS.l4 += \ 129 133 tstIoCtl
Note:
See TracChangeset
for help on using the changeset viewer.

