Changeset 92822 in vbox
- Timestamp:
- Dec 8, 2021 2:55:45 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
doc/manual/en_US/SDKRef.xml (modified) (1 diff)
-
src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp (modified) (3 diffs)
-
src/VBox/Main/idl/VirtualBox.xidl (modified) (2 diffs)
-
src/VBox/Main/include/GuestSessionImplTasks.h (modified) (1 diff)
-
src/VBox/Main/src-client/GuestSessionImpl.cpp (modified) (7 diffs)
-
src/VBox/Main/src-client/GuestSessionImplTasks.cpp (modified) (8 diffs)
-
src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/SDKRef.xml
r87265 r92822 4139 4139 interfaces, methods or attributes or other changes that do not affect 4140 4140 existing client code.</para> 4141 4142 <sect1> 4143 <title>Incompatible API changes with version 7.0</title> 4144 4145 <itemizedlist> 4146 4147 <listitem><para><link linkend="IGuestSession__directoryCopyFromGuest">IGuestSession::directoryCopyFromGuest()</link> and 4148 <link linkend="IGuestSession__directoryCopyToGuest">IGuestSession::directoryCopyToGuest()</link> no longer implicitly 4149 copy recursively and follow symbolic links -- for this to continue working, the newly introduced flags 4150 <link linkend="DirectoryCopyFlag_Recursive">DirectoryCopyFlag_Recursive</link> and/or 4151 <link linkend="DirectoryCopyFlag_FollowLinks">DirectoryCopyFlag_FollowLinks</link> have to be used.</para> 4152 </listitem> 4153 4154 </itemizedlist> 4155 4156 </sect1> 4141 4157 4142 4158 <sect1> -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r92594 r92822 1890 1890 RTPrintf(GuestCtrl::tr("Directory '%s' -> '%s'\n"), szAbsSrc, pszDst); 1891 1891 1892 SafeArray<DirectoryCopyFlag_T> copyFlags; 1893 copyFlags.push_back(DirectoryCopyFlag_CopyIntoExisting); 1892 SafeArray<DirectoryCopyFlag_T> aCopyFlags; 1893 aCopyFlags.push_back(DirectoryCopyFlag_CopyIntoExisting); 1894 if (fRecursive) 1895 aCopyFlags.push_back(DirectoryCopyFlag_Recursive); 1896 if (fFollow) 1897 aCopyFlags.push_back(DirectoryCopyFlag_FollowLinks); 1894 1898 rc = pCtx->pGuestSession->DirectoryCopyToGuest(Bstr(szAbsSrc).raw(), Bstr(pszDst).raw(), 1895 ComSafeArrayAsInParam( copyFlags), pProgress.asOutParam());1899 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam()); 1896 1900 } 1897 1901 else … … 1926 1930 SafeArray<DirectoryCopyFlag_T> aCopyFlags; 1927 1931 aCopyFlags.push_back(DirectoryCopyFlag_CopyIntoExisting); 1932 if (fRecursive) 1933 aCopyFlags.push_back(DirectoryCopyFlag_Recursive); 1934 if (fFollow) 1935 aCopyFlags.push_back(DirectoryCopyFlag_FollowLinks); 1928 1936 rc = pCtx->pGuestSession->DirectoryCopyFromGuest(Bstr(pszSource).raw(), Bstr(pszDst).raw(), 1929 1937 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam()); … … 1935 1943 1936 1944 SafeArray<FileCopyFlag_T> aCopyFlags; 1945 if (fFollow) 1946 aCopyFlags.push_back(FileCopyFlag_FollowLinks); 1937 1947 rc = pCtx->pGuestSession->FileCopyFromGuest(Bstr(pszSource).raw(), Bstr(pszDst).raw(), 1938 1948 ComSafeArrayAsInParam(aCopyFlags), pProgress.asOutParam()); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r92813 r92822 13192 13192 <enum 13193 13193 name="DirectoryCopyFlag" 13194 uuid=" b5901856-d064-4fbc-ab06-2909ba106154"13194 uuid="20108C67-B1EB-4EF6-869B-25539A47A18E" 13195 13195 > 13196 13196 <desc> … … 13202 13202 <const name="CopyIntoExisting" value="1"> 13203 13203 <desc>Allow copying into an existing destination directory.</desc> 13204 </const> 13205 <const name="Recursive" value="2"> 13206 <desc>Copy directories recursively.</desc> 13207 </const> 13208 <const name="FollowLinks" value="4"> 13209 <desc>Follow symbolic links.</desc> 13204 13210 </const> 13205 13211 <!-- Later, basically have to see what cp and xcopy offers. --> -
trunk/src/VBox/Main/include/GuestSessionImplTasks.h
r91312 r92822 67 67 /** Directory copy flags. */ 68 68 DirectoryCopyFlag_T fCopyFlags; 69 /** Whether to follow symbolic links or not. */70 bool fFollowSymlinks; /** @todo Remove once we have that parameter in DirectoryCopyFlag_T. */71 /** Whether to copy the directory recursively or not. */72 bool fRecursive;73 69 } Dir; 74 70 /** File-specific data. */ -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r92817 r92822 869 869 if (MATCH_KEYWORD("CopyIntoExisting")) 870 870 fFlags |= (unsigned)DirectoryCopyFlag_CopyIntoExisting; 871 else if (MATCH_KEYWORD("Recursive")) 872 fFlags |= (unsigned)DirectoryCopyFlag_Recursive; 873 else if (MATCH_KEYWORD("FollowLinks")) 874 fFlags |= (unsigned)DirectoryCopyFlag_FollowLinks; 871 875 else 872 876 return setError(E_INVALIDARG, tr("Invalid directory copy flag: %.*s"), (int)cchKeyword, pszNext); … … 3201 3205 { 3202 3206 hrc = GuestSession::i_directoryCopyFlagFromStr(strFlags, &source.Type.Dir.fCopyFlags); 3203 source.Type.Dir.fRecursive = true; /* Implicit. */3204 3207 } 3205 3208 else if (source.enmType == FsObjType_File) 3206 3209 hrc = GuestSession::i_fileCopyFlagFromStr(strFlags, &source.Type.File.fCopyFlags); 3207 3210 else 3208 return setError(E_INVALIDARG, tr("Source type % dinvalid / not supported"), source.enmType);3211 return setError(E_INVALIDARG, tr("Source type %#x invalid / not supported"), source.enmType); 3209 3212 if (FAILED(hrc)) 3210 3213 return hrc; … … 3272 3275 { 3273 3276 hrc = GuestSession::i_directoryCopyFlagFromStr(strFlags, &source.Type.Dir.fCopyFlags); 3274 source.Type.Dir.fFollowSymlinks = true; /** @todo Add a flag for that in DirectoryCopyFlag_T. Later. */3275 source.Type.Dir.fRecursive = true; /* Implicit. */3276 3277 } 3277 3278 else if (source.enmType == FsObjType_File) 3278 3279 hrc = GuestSession::i_fileCopyFlagFromStr(strFlags, &source.Type.File.fCopyFlags); 3279 3280 else 3280 return setError(E_INVALIDARG, tr("Source type % dinvalid / not supported"), source.enmType);3281 return setError(E_INVALIDARG, tr("Source type %#x invalid / not supported"), source.enmType); 3281 3282 if (FAILED(hrc)) 3282 3283 return hrc; … … 3314 3315 fFlags |= aFlags[i]; 3315 3316 3316 const uint32_t fValidFlags = DirectoryCopyFlag_None | DirectoryCopyFlag_CopyIntoExisting; 3317 const uint32_t fValidFlags = DirectoryCopyFlag_None | DirectoryCopyFlag_CopyIntoExisting | DirectoryCopyFlag_Recursive 3318 | DirectoryCopyFlag_FollowLinks; 3317 3319 if (fFlags & ~fValidFlags) 3318 3320 return setError(E_INVALIDARG,tr("Unknown flags: flags value %#x, invalid: %#x"), fFlags, fFlags & ~fValidFlags); … … 3327 3329 source.fDryRun = false; /** @todo Implement support for a dry run. */ 3328 3330 source.Type.Dir.fCopyFlags = (DirectoryCopyFlag_T)fFlags; 3329 source.Type.Dir.fRecursive = true; /* Implicit. */3330 3331 3331 3332 SourceSet.push_back(source); … … 3343 3344 fFlags |= aFlags[i]; 3344 3345 3345 const uint32_t fValidFlags = DirectoryCopyFlag_None | DirectoryCopyFlag_CopyIntoExisting; 3346 const uint32_t fValidFlags = DirectoryCopyFlag_None | DirectoryCopyFlag_CopyIntoExisting | DirectoryCopyFlag_Recursive 3347 | DirectoryCopyFlag_FollowLinks; 3346 3348 if (fFlags & ~fValidFlags) 3347 3349 return setError(E_INVALIDARG,tr("Unknown flags: flags value %#x, invalid: %#x"), fFlags, fFlags & ~fValidFlags); … … 3356 3358 source.fDryRun = false; /** @todo Implement support for a dry run. */ 3357 3359 source.Type.Dir.fCopyFlags = (DirectoryCopyFlag_T)fFlags; 3358 source.Type.Dir.fFollowSymlinks = true; /** @todo Add a flag for that in DirectoryCopyFlag_T. Later. */3359 source.Type.Dir.fRecursive = true; /* Implicit. */3360 3360 3361 3361 SourceSet.push_back(source); -
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r92715 r92822 1004 1004 * will be done directly when working on those. See @bugref{10139}. */ 1005 1005 1006 LogFlowFunc(("mSrcRootAbs=%s, mDstRootAbs=%s, fCopyFlags=%#x, fFollowSymlinks=%RTbool, fRecursive=%RTbool\n", 1007 mSrcRootAbs.c_str(), mDstRootAbs.c_str(), mSourceSpec.Type.Dir.fCopyFlags, 1008 mSourceSpec.Type.Dir.fFollowSymlinks, mSourceSpec.Type.Dir.fRecursive)); 1006 LogFlowFunc(("mSrcRootAbs=%s, mDstRootAbs=%s, fCopyFlags=%#x\n", 1007 mSrcRootAbs.c_str(), mDstRootAbs.c_str(), mSourceSpec.Type.Dir.fCopyFlags)); 1009 1008 1010 1009 return VINF_SUCCESS; … … 1123 1122 LogRel2(("Guest Control: Directory '%s'\n", strEntry.c_str())); 1124 1123 1125 if (!(mSourceSpec.Type.Dir.f Recursive))1124 if (!(mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_Recursive)) 1126 1125 break; 1127 1126 … … 1132 1131 case FsObjType_Symlink: 1133 1132 { 1134 if (mSourceSpec.Type.Dir.f FollowSymlinks)1133 if (mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks) 1135 1134 { 1136 1135 /** @todo Symlink handling from guest is not implemented yet. … … 1234 1233 LogRel2(("Guest Control: Directory '%s'\n", strEntry.c_str())); 1235 1234 1236 if (!(mSourceSpec.Type.Dir.f Recursive))1235 if (!(mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_Recursive)) 1237 1236 break; 1238 1237 … … 1251 1250 case RTFS_TYPE_SYMLINK: 1252 1251 { 1253 if (mSourceSpec.Type.Dir.f FollowSymlinks)1252 if (mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks) 1254 1253 { 1255 1254 Utf8Str strEntryAbs = strPathAbs + Utf8Str(Entry.szName); … … 1443 1442 } 1444 1443 1445 fFollowSymlinks = itSrc->Type.Dir.f FollowSymlinks;1444 fFollowSymlinks = itSrc->Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks; 1446 1445 } 1447 1446 else … … 1838 1837 GuestFsObjData dstObjData; 1839 1838 int rcGuest; 1840 rc = mSession->i_fsQueryInfo(strDstRootAbs, pList->mSourceSpec.Type.Dir.fFollowSymlinks, dstObjData, &rcGuest); 1839 rc = mSession->i_fsQueryInfo(strDstRootAbs, pList->mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks, 1840 dstObjData, &rcGuest); 1841 1841 if (RT_FAILURE(rc)) 1842 1842 { … … 1879 1879 { 1880 1880 fCopyIntoExisting = RT_BOOL(pList->mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_CopyIntoExisting); 1881 fFollowSymlinks = pList->mSourceSpec.Type.Dir.fFollowSymlinks;1881 fFollowSymlinks = RT_BOOL(pList->mSourceSpec.Type.Dir.fCopyFlags & DirectoryCopyFlag_FollowLinks); 1882 1882 1883 1883 LogFlowFunc(("Directory: fDirCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool\n", -
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r92681 r92822 1841 1841 reporter.log2('Copying guest dir "%s" to host "%s"' % (limitString(oTest.sSrc), limitString(oTest.sDst))); 1842 1842 try: 1843 if self.oTstDrv.fpApiVer >= 7.0: 1844 ## @todo Make the following new flags implicit for 7.0 for now. Develop dedicated tests for this later and remove. 1845 if vboxcon.DirectoryCopyFlag_Recursive not in oTest.afFlags: 1846 oTest.afFlags.extend([ vboxcon.DirectoryCopyFlag_Recursive ]); 1847 ## @todo Ditto. 1848 if vboxcon.DirectoryCopyFlag_FollowLinks not in oTest.afFlags: 1849 oTest.afFlags.extend([ vboxcon.DirectoryCopyFlag_FollowLinks ]); 1843 1850 oCurProgress = oGuestSession.directoryCopyFromGuest(oTest.sSrc, oTest.sDst, oTest.afFlags); 1844 1851 except: … … 1898 1905 def gctrlCopyDirTo(self, oGuestSession, sSrc, sDst, afFlags, fIsError): 1899 1906 """ 1900 Helper function to copy a directory treefrom the host to the guest.1907 Helper function to copy a directory (tree) from the host to the guest. 1901 1908 """ 1902 1909 reporter.log2('Copying host directory "%s" to guest "%s" (flags %s)' % (limitString(sSrc), limitString(sDst), afFlags)); 1903 1910 try: 1911 if self.oTstDrv.fpApiVer >= 7.0: 1912 ## @todo Make the following new flags implicit for 7.0 for now. Develop dedicated tests for this later and remove. 1913 if vboxcon.DirectoryCopyFlag_Recursive not in afFlags: 1914 afFlags.extend([ vboxcon.DirectoryCopyFlag_Recursive ]); 1915 ## @todo Ditto. 1916 if vboxcon.DirectoryCopyFlag_FollowLinks not in afFlags: 1917 afFlags.extend([ vboxcon.DirectoryCopyFlag_FollowLinks ]); 1904 1918 oCurProgress = oGuestSession.directoryCopyToGuest(sSrc, sDst, afFlags); 1905 1919 except:
Note:
See TracChangeset
for help on using the changeset viewer.

