VirtualBox

Changeset 108317 in vbox


Ignore:
Timestamp:
Feb 20, 2025 5:14:58 PM (3 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167661
Message:

Main/MachineImplMoveVM: IMachine::moveTo() wouldn't move all of a VM's
files to the new location on Solaris hosts since MachineMoveVM::getFilesList()
uses RTDirRead() to read the contents of the VM's directory but the
entries had an unknown entry type (RTDIRENTRYTYPE_UNKNOWN) since 'struct
dirent' on Solaris doesn't have a 'd_type' entry. In such instances we
need to fallback to RTDirQueryUnknownType() to retrieve the details of
each entry in the directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImplMoveVM.cpp

    r106061 r108317  
    12851285    {
    12861286        /** @todo r=bird: RTDIRENTRY is big and this function is doing
    1287          * unrestrained recursion of arbritrary depth.  Four things:
     1287         * unrestrained recursion of arbritrary depth.  Three things:
    12881288         *      - Add a depth counter parameter and refuse to go deeper than
    12891289         *        a certain reasonable limit.
     
    12951295         *        entry with a name longer than RTDIRENTRY have space to
    12961296         *        store (windows host with UTF-16 encoding shorter than 255
    1297          *        chars, but UTF-8 encoding longer than 260).
    1298          *      - enmType can be RTDIRENTRYTYPE_UNKNOWN if the file system or
    1299          *        the host doesn't return the information.  See
    1300          *        RTDIRENTRY::enmType.  Use RTDirQueryUnknownType() to get the
    1301          *        actual type. */
     1297         *        chars, but UTF-8 encoding longer than 260). */
    13021298        RTDIRENTRY DirEntry;
    13031299        while (RT_SUCCESS(RTDirRead(hDir, &DirEntry, NULL)))
     
    13051301            if (RTDirEntryIsStdDotLink(&DirEntry))
    13061302                continue;
     1303
     1304            /* Make sure we've got the entry type. */
     1305            if (DirEntry.enmType == RTDIRENTRYTYPE_UNKNOWN)
     1306            {
     1307                /* Build the complete path which is needed by RTDirQueryUnknownType(). */
     1308                char szPath[RTPATH_MAX];
     1309                vrc = RTPathJoin(szPath, sizeof(szPath), strRootFolder.c_str(), DirEntry.szName);
     1310                if (RT_SUCCESS(vrc))
     1311                    vrc = RTDirQueryUnknownType(szPath, false /*fFollowSymlinks*/, &DirEntry.enmType);
     1312                if (RT_FAILURE(vrc))
     1313                    continue;
     1314            }
    13071315
    13081316            if (DirEntry.enmType == RTDIRENTRYTYPE_FILE)
Note: See TracChangeset for help on using the changeset viewer.

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