VirtualBox

Changeset 107966 in vbox


Ignore:
Timestamp:
Jan 28, 2025 3:01:40 PM (3 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167216
Message:

Main: Added optional file support to GuestSessionTaskUpdateAdditions::runFileOnGuest(). Prerequisite for adding the ARM64-based Guest Additions installer. bugref:10734

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestSessionImplTasks.h

    r107186 r107966  
    457457    int addProcessArguments(ProcessArguments &aArgumentsDest, const ProcessArguments &aArgumentsSource);
    458458    int copyFileToGuest(GuestSession *pSession, RTVFS hVfsIso, Utf8Str const &strFileSource, const Utf8Str &strFileDest, bool fOptional);
    459     int runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo, bool fSilent = false);
     459    int runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo, bool fSilent = false, bool fOptional = false);
    460460    HRESULT setUpdateErrorMsg(HRESULT hrc, const Utf8Str &strMsg);
    461461    HRESULT setUpdateErrorMsg(HRESULT hrc, const Utf8Str &strMsg, const GuestErrorInfo &guestErrorInfo);
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r107880 r107966  
    27172717 * @param   pSession            Guest session to use.
    27182718 * @param   procInfo            Guest process startup info to use.
    2719  * @param   fSilent             Whether to set progress into failure state in case of error.
     2719 * @param   fSilent             Whether to set progress into failure state in case of error. Defaults to \c false.
     2720 *                              Overrides \a fOptional.
     2721 * @param   fOptional           Whether the file to run is optional, i.e. can be missing (also its path).
     2722 *                              When set to \c false (non-optional), this will trigger an error if the file cannot be found.
     2723 *                              Defaults to \c false.
    27202724 */
    2721 int GuestSessionTaskUpdateAdditions::runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo, bool fSilent)
     2725int GuestSessionTaskUpdateAdditions::runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo,
     2726                                                    bool fSilent /* = false */, bool fOptional /* = false */)
    27222727{
    27232728    AssertPtrReturn(pSession, VERR_INVALID_POINTER);
     
    27722777
    27732778            }
     2779
    27742780            case VERR_GSTCTL_GUEST_ERROR:
     2781            {
     2782                if (   (   vrcGuest == VERR_FILE_NOT_FOUND
     2783                        || vrcGuest == VERR_PATH_NOT_FOUND)
     2784                    && fOptional)
     2785                {
     2786                    LogRel(("Guest Additions Update: File \"%s\" is absent, skipping\n", procInfo.mName.c_str()));
     2787                    vrc = VINF_SUCCESS;
     2788                    break;
     2789                }
     2790
    27752791                setUpdateErrorMsg(VBOX_E_GSTCTL_GUEST_ERROR, tr("Running update file on guest failed"),
    27762792                                  GuestErrorInfo(GuestErrorInfo::Type_Process, vrcGuest, cmdLine.c_str()));
    27772793                break;
     2794            }
    27782795
    27792796            case VERR_INVALID_STATE: /** @todo Special guest control vrc needed! */
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