Changeset 46524 in vbox
- Timestamp:
- Jun 13, 2013 12:10:23 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
doc/manual/en_US/SDKRef.xml (modified) (1 diff)
-
doc/manual/en_US/user_VBoxManage.xml (modified) (2 diffs)
-
doc/manual/user_ChangeLogImpl.xml (modified) (1 diff)
-
src/VBox (modified) (1 prop)
-
src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp (modified) (8 diffs)
-
src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp (modified) (1 diff)
-
src/VBox/Main/idl/VirtualBox.xidl (modified) (4 diffs)
-
src/VBox/Main/include/GuestImpl.h (modified) (1 diff)
-
src/VBox/Main/include/GuestSessionImpl.h (modified) (3 diffs)
-
src/VBox/Main/src-client/GuestCtrlImpl.cpp (modified) (4 diffs)
-
src/VBox/Main/src-client/GuestSessionImplTasks.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/SDKRef.xml
r46478 r46524 3644 3644 the host.</para> 3645 3645 </listitem> 3646 3647 <listitem> 3648 <para>The parameter list for <xref 3649 linkend="IGuest__updateGuestAdditions" 3650 xreflabel="IMedium::updateGuestAdditions()" /> was modified.</para> 3651 It now supports specifying optional command line arguments for the 3652 Guest Additions installer performing the actual update on the guest. 3653 </listitem> 3646 3654 </itemizedlist> 3647 3655 </sect1> -
trunk/doc/manual/en_US/user_VBoxManage.xml
r46207 r46524 3216 3216 <screen>VBoxManage guestcontrol <vmname>|<uuid> updateadditions 3217 3217 [--source "<guest additions .ISO file to use>"] [--verbose] 3218 [--wait-start] </screen>3218 [--wait-start] [-- [<argument1>] ... [<argumentN>]]</screen> 3219 3219 3220 3220 <para>where the parameters mean: <glosslist> … … 3254 3254 <para>When omitting this flag VBoxManage will wait for the 3255 3255 whole Guest Additions update to complete.</para> 3256 </glossdef> 3257 </glossentry> 3258 3259 <glossentry> 3260 <glossterm>[-- [<argument1s>] ... [<argumentNs>]]</glossterm> 3261 3262 <glossdef> 3263 <para>Optional command line arguments to use for the Guest Additions 3264 installer. Useful for retrofitting features which weren't installed 3265 before on the guest.</para> 3266 <para>Arguments containing spaces must be enclosed in 3267 quotation marks.</para> 3256 3268 </glossdef> 3257 3269 </glossentry> -
trunk/doc/manual/user_ChangeLogImpl.xml
r46100 r46524 38 38 media, and support the <computeroutput>--long</computeroutput> 39 39 option to show really all available details</para> 40 </listitem> 41 42 <listitem> 43 <para>VBoxManage: added support for optional command line parameters for 44 the automatic Guest Additions update.</para> 40 45 </listitem> 41 46 -
trunk/src/VBox
- Property svn:mergeinfo changed
/branches/VBox-4.2/src/VBox (added) merged: 86229-86230,86234
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r46009 r46524 261 261 " [--source <guest additions .ISO>] [--verbose]\n" 262 262 " [--wait-start]\n" 263 " [-- [<argument1>] ... [<argumentN>]]\n" 263 264 "\n", pcszSep1, pcszSep2); 264 265 } … … 633 634 com::SafeArray<ProcessCreateFlag_T> aCreateFlags; 634 635 com::SafeArray<ProcessWaitForFlag_T> aWaitFlags; 635 com::SafeArray<IN_BSTR> a rgs;636 com::SafeArray<IN_BSTR> env;636 com::SafeArray<IN_BSTR> aArgs; 637 com::SafeArray<IN_BSTR> aEnv; 637 638 Utf8Str strUsername; 638 639 Utf8Str strPassword; … … 669 670 return errorSyntax(USAGE_GUESTCONTROL, "Failed to parse environment value, rc=%Rrc", vrc); 670 671 for (int j = 0; j < cArgs; j++) 671 env.push_back(Bstr(papszArg[j]).raw());672 aEnv.push_back(Bstr(papszArg[j]).raw()); 672 673 673 674 RTGetOptArgvFree(papszArg); … … 742 743 case VINF_GETOPT_NOT_OPTION: 743 744 { 744 if (a rgs.size() == 0 && strCmd.isEmpty())745 if (aArgs.size() == 0 && strCmd.isEmpty()) 745 746 strCmd = ValueUnion.psz; 746 747 else 747 a rgs.push_back(Bstr(ValueUnion.psz).raw());748 aArgs.push_back(Bstr(ValueUnion.psz).raw()); 748 749 break; 749 750 } … … 837 838 ComPtr<IGuestProcess> pProcess; 838 839 rc = pGuestSession->ProcessCreate(Bstr(strCmd).raw(), 839 ComSafeArrayAsInParam(a rgs),840 ComSafeArrayAsInParam( env),840 ComSafeArrayAsInParam(aArgs), 841 ComSafeArrayAsInParam(aEnv), 841 842 ComSafeArrayAsInParam(aCreateFlags), 842 843 cMsTimeout, … … 2652 2653 */ 2653 2654 Utf8Str strSource; 2655 com::SafeArray<IN_BSTR> aArgs; 2654 2656 bool fVerbose = false; 2655 2657 bool fWaitStartOnly = false; … … 2684 2686 fWaitStartOnly = true; 2685 2687 break; 2688 2689 case VINF_GETOPT_NOT_OPTION: 2690 { 2691 if (aArgs.size() == 0 && strSource.isEmpty()) 2692 strSource = ValueUnion.psz; 2693 else 2694 aArgs.push_back(Bstr(ValueUnion.psz).raw()); 2695 break; 2696 } 2686 2697 2687 2698 default: … … 2731 2742 ComPtr<IProgress> pProgress; 2732 2743 CHECK_ERROR(guest, UpdateGuestAdditions(Bstr(strSource).raw(), 2744 ComSafeArrayAsInParam(aArgs), 2733 2745 /* Wait for whole update process to complete. */ 2734 2746 ComSafeArrayAsInParam(aUpdateFlags), -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r46430 r46524 490 490 #else 491 491 CGuest guest = session().GetConsole().GetGuest(); 492 QVector<KAdditionsUpdateFlag> flagsUpdate; 493 CProgress progressInstall = guest.UpdateGuestAdditions(strSource, flagsUpdate); 492 QVector<KAdditionsUpdateFlag> aFlagsUpdate; 493 QVector<QString> aArgs; 494 CProgress progressInstall = guest.UpdateGuestAdditions(strSource, 495 aArgs, aFlagsUpdate); 494 496 bool fResult = guest.isOk(); 495 497 if (fResult) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r46523 r46524 8582 8582 <attribute name="loggingLevel" type="wstring"> 8583 8583 <desc> 8584 Specifies the logging level in current use by VirtualBox. 8584 Specifies the logging level in current use by VirtualBox. 8585 8585 </desc> 8586 8586 </attribute> … … 11206 11206 <interface 11207 11207 name="IGuest" extends="$unknown" 11208 uuid="1 9c32350-0618-4ede-b0c3-2b4311bf0d9b"11208 uuid="1a1969c1-a583-4975-9810-1dd0f0e3a8ae" 11209 11209 wsmap="managed" 11210 11210 > … … 11699 11699 <param name="source" type="wstring" dir="in"> 11700 11700 <desc> 11701 Path to the Guest Additions .ISO file to use for the upate. 11701 Path to the Guest Additions .ISO file to use for the update. 11702 </desc> 11703 </param> 11704 <param name="arguments" type="wstring" dir="in" safearray="yes"> 11705 <desc> 11706 Optional command line arguments to use for the Guest Additions 11707 installer. Useful for retrofitting features which weren't installed 11708 before on the guest. 11702 11709 </desc> 11703 11710 </param> … … 20355 20362 </desc> 20356 20363 </interface> 20357 20364 20358 20365 <interface 20359 20366 name="IVideoCaptureChangedEvent" extends="IEvent" -
trunk/src/VBox/Main/include/GuestImpl.h
r46457 r46524 109 109 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemShared, ULONG *aMemCache, 110 110 ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal); 111 STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ComSafeArrayIn( AdditionsUpdateFlag_T, aFlags), IProgress **aProgress);111 STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), IProgress **aProgress); 112 112 113 113 public: -
trunk/src/VBox/Main/include/GuestSessionImpl.h
r45780 r46524 159 159 160 160 SessionTaskUpdateAdditions(GuestSession *pSession, 161 const Utf8Str &strSource, uint32_t uFlags); 161 const Utf8Str &strSource, const ProcessArguments &aArguments, 162 uint32_t uFlags); 162 163 163 164 virtual ~SessionTaskUpdateAdditions(void); … … 220 221 }; 221 222 223 int addProcessArguments(ProcessArguments &aArgumentsDest, 224 const ProcessArguments &aArgumentsSource); 222 225 int copyFileToGuest(GuestSession *pSession, PRTISOFSFILE pISO, 223 226 Utf8Str const &strFileSource, const Utf8Str &strFileDest, … … 230 233 * which will be used for the updating process. */ 231 234 Utf8Str mSource; 235 /** (Optional) installer command line arguments. */ 236 ProcessArguments mArguments; 232 237 /** Update flags. */ 233 238 uint32_t mFlags; -
trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
r45415 r46524 115 115 #endif /* VBOX_WITH_GUEST_CONTROL */ 116 116 117 STDMETHODIMP Guest::UpdateGuestAdditions(IN_BSTR aSource, ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), IProgress **aProgress) 117 STDMETHODIMP Guest::UpdateGuestAdditions(IN_BSTR aSource, ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), 118 ComSafeArrayIn(IN_BSTR, aArguments), IProgress **aProgress) 118 119 { 119 120 #ifndef VBOX_WITH_GUEST_CONTROL … … 139 140 if (!(fFlags & AdditionsUpdateFlag_WaitForUpdateStartOnly)) 140 141 return setError(E_INVALIDARG, tr("Unknown flags (%#x)"), aFlags); 142 } 143 144 int rc = VINF_SUCCESS; 145 146 ProcessArguments aArgs; 147 if (aArguments) 148 { 149 try 150 { 151 com::SafeArray<IN_BSTR> arguments(ComSafeArrayInArg(aArguments)); 152 for (size_t i = 0; i < arguments.size(); i++) 153 aArgs.push_back(Utf8Str(arguments[i])); 154 } 155 catch(std::bad_alloc &) 156 { 157 rc = VERR_NO_MEMORY; 158 } 141 159 } 142 160 … … 154 172 155 173 ComObjPtr<GuestSession> pSession; 156 int rc = sessionCreate(startupInfo, guestCreds, pSession); 174 if (RT_SUCCESS(rc)) 175 rc = sessionCreate(startupInfo, guestCreds, pSession); 157 176 if (RT_FAILURE(rc)) 158 177 { … … 188 207 ComObjPtr<Progress> pProgress; 189 208 SessionTaskUpdateAdditions *pTask = new SessionTaskUpdateAdditions(pSession /* GuestSession */, 190 Utf8Str(aSource), fFlags);209 Utf8Str(aSource), aArgs, fFlags); 191 210 rc = pSession->startTaskAsync(tr("Updating Guest Additions"), pTask, pProgress); 192 211 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r45572 r46524 840 840 841 841 SessionTaskUpdateAdditions::SessionTaskUpdateAdditions(GuestSession *pSession, 842 const Utf8Str &strSource, uint32_t uFlags) 842 const Utf8Str &strSource, 843 const ProcessArguments &aArguments, 844 uint32_t uFlags) 843 845 : GuestSessionTask(pSession) 844 846 { 845 847 mSource = strSource; 848 mArguments = aArguments; 846 849 mFlags = uFlags; 847 850 } … … 850 853 { 851 854 855 } 856 857 int SessionTaskUpdateAdditions::addProcessArguments(ProcessArguments &aArgumentsDest, 858 const ProcessArguments &aArgumentsSource) 859 { 860 int rc = VINF_SUCCESS; 861 862 try 863 { 864 /* Filter out arguments which already are in the destination to 865 * not end up having them specified twice. Not the fastest method on the 866 * planet but does the job. */ 867 ProcessArguments::const_iterator itSource = aArgumentsSource.begin(); 868 while (itSource != aArgumentsSource.end()) 869 { 870 bool fFound = false; 871 ProcessArguments::iterator itDest = aArgumentsDest.begin(); 872 while (itDest != aArgumentsDest.end()) 873 { 874 if ((*itDest).equalsIgnoreCase((*itSource))) 875 { 876 fFound = true; 877 break; 878 } 879 itDest++; 880 } 881 882 if (!fFound) 883 aArgumentsDest.push_back((*itSource)); 884 885 itSource++; 886 } 887 } 888 catch(std::bad_alloc &) 889 { 890 return VERR_NO_MEMORY; 891 } 892 893 return rc; 852 894 } 853 895 … … 1331 1373 * Windows taskbar. */ 1332 1374 siInstaller.mArguments.push_back(Utf8Str("/post_installstatus")); 1375 /* Add optional installer command line arguments from the API to the 1376 * installer's startup info. */ 1377 rc = addProcessArguments(siInstaller.mArguments, mArguments); 1378 AssertRC(rc); 1333 1379 /* If the caller does not want to wait for out guest update process to end, 1334 1380 * complete the progress object now so that the caller can do other work. */
Note:
See TracChangeset
for help on using the changeset viewer.

