VirtualBox

Changeset 31370 in vbox


Ignore:
Timestamp:
Aug 4, 2010 6:49:09 PM (14 years ago)
Author:
vboxsync
Message:

Main: cleanup machine renames, remove dead code

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MediumImpl.cpp

    r31358 r31370  
    28582858 * @note Locks this object for writing.
    28592859 */
    2860 HRESULT Medium::updatePath(const char *aOldPath, const char *aNewPath)
    2861 {
    2862     AssertReturn(aOldPath, E_FAIL);
    2863     AssertReturn(aNewPath, E_FAIL);
     2860HRESULT Medium::updatePath(const Utf8Str &strOldPath, const Utf8Str &strNewPath)
     2861{
     2862    AssertReturn(!strOldPath.isEmpty(), E_FAIL);
     2863    AssertReturn(!strNewPath.isEmpty(), E_FAIL);
    28642864
    28652865    AutoCaller autoCaller(this);
     
    28722872    const char *pcszMediumPath = m->strLocationFull.c_str();
    28732873
    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());
    28792878        unconst(m->strLocationFull) = newPath;
    28802879
     
    28872886
    28882887    return S_OK;
    2889 }
    2890 
    2891 /**
    2892  * Checks if the given change of \a aOldPath to \a aNewPath affects the location
    2893  * of this medium or any its child and updates the paths if necessary to
    2894  * 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     }
    29232888}
    29242889
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r31358 r31370  
    32263226                {
    32273227                    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);
    32313230                }
    32323231            }
  • trunk/src/VBox/Main/include/MediumImpl.h

    r31358 r31370  
    188188#endif
    189189
    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);
    192191
    193192    ComObjPtr<Medium> getBase(uint32_t *aLevel = NULL);
  • trunk/src/VBox/Runtime/testcase/Makefile.kmk

    r31329 r31370  
    124124        tstRTProcIsRunningByName \
    125125        tstRTBitOperationsPIC3 \
    126         tstInlineAsmPIC \
    127126        tstInlineAsmPIC3
     127if1of ($(USERNAME), umoeller)
     128else
     129PROGRAMS.linux += \
     130        tstInlineAsmPIC
     131endif
    128132PROGRAMS.l4 += \
    129133        tstIoCtl
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette