VirtualBox

Changeset 106153 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Sep 25, 2024 5:53:27 PM (8 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164932
Message:

Main: Additions: Automatic Upgrade: Extra fix to prevent failure for Linux GAs and introduce removal of installer tmp files, bugref:10776.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r106142 r106153  
    27382738        {
    27392739            vrc = guestProc.wait(&vrcGuest);
    2740             /** @todo Linux Guest Additions terminate VBoxService when updating (via uninstall.sh),
    2741              *        which in turn terminates the Guest Control session this updater task was relying on.
    2742              *        This leads into a VERR_NOT_FOUND error, as the Guest Session is not around anymore.
    2743              *        Fend this off for now, but needs a clean(er) solution long-term. See @bugref{10776}. */
    2744             if (vrc == VERR_NOT_FOUND)
     2740            if (RT_SUCCESS(vrc))
     2741                vrc = guestProc.getTerminationStatus();
     2742            else if (vrc == VERR_NOT_FOUND)
     2743                /** @todo Linux Guest Additions terminate VBoxService when updating (via uninstall.sh),
     2744                 *        which in turn terminates the Guest Control session this updater task was relying on.
     2745                 *        This leads into a VERR_NOT_FOUND error, as the Guest Session is not around anymore.
     2746                 *        Fend this off for now, but needs a clean(er) solution long-term. See @bugref{10776}. */
    27452747                vrc = VINF_SUCCESS;
    27462748        }
    2747         if (RT_SUCCESS(vrc))
    2748             vrc = guestProc.getTerminationStatus();
    27492749    }
    27502750
     
    33763376                        if (pSession->i_isTerminated())
    33773377                        {
    3378                             ComObjPtr<GuestSession> pNewSession;
    3379 
    33803378                            LogRel(("Guest Additions Update: Old guest session has terminated, waiting updated guest services to start\n"));
    33813379
    3382                             /* Wait for VBoxService to restart. */
    3383                             vrc = waitForGuestSession(pSession->i_getParent(), osType, pNewSession);
    3384                             if (RT_SUCCESS(vrc))
    3385                             {
    3386                                 hrc = pNewSession->i_directoryRemove(strUpdateDir, DIRREMOVEREC_FLAG_RECURSIVE | DIRREMOVEREC_FLAG_CONTENT_AND_DIR, &vrc);
    3387                                 LogRel(("Cleanup Guest Additions update directory '%s', hrc=%Rrc, vrc=%Rrc\n",
    3388                                         strUpdateDir.c_str(), hrc, vrc));
    3389                                 pNewSession->Close();
    3390                             }
    3391                             else
     3380                            /* Wait for VBoxService to restart and re-establish guest session. */
     3381                            vrc = waitForGuestSession(pSession->i_getParent(), osType, pSession);
     3382                            if (RT_FAILURE(vrc))
    33923383                                hrc = setUpdateErrorMsg(VBOX_E_IPRT_ERROR,
    33933384                                                        Utf8StrFmt(tr("Guest services were not restarted, please reinstall Guest Additions manually")));
     
    34023393                    }
    34033394
     3395                    /* Remove temporary update files on the guest side before reporting completion. */
     3396                    if (!pSession->i_isTerminated())
     3397                    {
     3398                        hrc = pSession->i_directoryRemove(strUpdateDir, DIRREMOVEREC_FLAG_RECURSIVE | DIRREMOVEREC_FLAG_CONTENT_AND_DIR, &vrc);
     3399                        LogRel(("Cleanup Guest Additions update directory '%s', hrc=%Rrc, vrc=%Rrc\n",
     3400                                strUpdateDir.c_str(), hrc, vrc));
     3401                    }
     3402
    34043403                    if (RT_SUCCESS(vrc))
    34053404                    {
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