Changeset 98690 in vbox for trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
- Timestamp:
- Feb 22, 2023 3:00:11 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155990
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r98526 r98690 2674 2674 2675 2675 /** 2676 * Helper function which checks Guest Additions installation status. 2677 * 2678 * @returns IPRT status code. 2679 * @param pSession Guest session to use. 2680 * @param osType Guest type. 2681 */ 2682 int GuestSessionTaskUpdateAdditions::checkGuestAdditionsStatus(GuestSession *pSession, eOSType osType) 2683 { 2684 int vrc = VINF_SUCCESS; 2685 #ifdef VBOX_WITH_GSTCTL_TOOLBOX_SUPPORT 2686 int hrc; 2687 2688 if (osType == eOSType_Linux) 2689 { 2690 const Utf8Str ksStatusScript = Utf8Str("/usr/sbin/rcvboxadd"); 2691 2692 /* Check if Guest Additions kernel modules were loaded. */ 2693 GuestProcessStartupInfo procInfo; 2694 procInfo.mFlags = ProcessCreateFlag_None; 2695 procInfo.mExecutable = Utf8Str("/bin/sh");; 2696 procInfo.mArguments.push_back(procInfo.mExecutable); /* Set argv0. */ 2697 procInfo.mArguments.push_back(ksStatusScript); 2698 procInfo.mArguments.push_back("status-kernel"); 2699 2700 vrc = runFileOnGuest(pSession, procInfo); 2701 if (RT_SUCCESS(vrc)) 2702 { 2703 /* Replace the last argument with corresponding value and check 2704 * if Guest Additions user services were started. */ 2705 procInfo.mArguments.pop_back(); 2706 procInfo.mArguments.push_back("status-user"); 2707 2708 vrc = runFileOnGuest(pSession, procInfo); 2709 if (RT_FAILURE(vrc)) 2710 hrc = setProgressErrorMsg(VBOX_E_GSTCTL_GUEST_ERROR, 2711 Utf8StrFmt(tr("Automatic update of Guest Additions has failed: " 2712 "files were installed, but user services were not reloaded automatically. " 2713 "Please consider rebooting the guest"))); 2714 } 2715 else 2716 hrc = setProgressErrorMsg(VBOX_E_GSTCTL_GUEST_ERROR, 2717 Utf8StrFmt(tr("Automatic update of Guest Additions has failed: " 2718 "files were installed, but kernel modules were not reloaded automatically. " 2719 "Please consider rebooting the guest"))); 2720 } 2721 #endif 2722 return vrc; 2723 } 2724 2725 /** 2676 2726 * Helper function which waits until Guest Additions services started. 2677 2727 * … … 2679 2729 * started on time. 2680 2730 * @param pGuest Guest interface to use. 2731 * @param osType Guest type. 2681 2732 */ 2682 int GuestSessionTaskUpdateAdditions::waitForGuestSession(ComObjPtr<Guest> pGuest )2733 int GuestSessionTaskUpdateAdditions::waitForGuestSession(ComObjPtr<Guest> pGuest, eOSType osType) 2683 2734 { 2684 2735 int vrc = VERR_GSTCTL_GUEST_ERROR; … … 2714 2765 if (RT_SUCCESS(vrc)) 2715 2766 { 2767 /* Make sure Guest Additions were reloaded on the guest side. */ 2768 vrc = checkGuestAdditionsStatus(pSession, osType); 2769 if (RT_SUCCESS(vrc)) 2770 LogRel(("Guest Additions were successfully reloaded after installation\n")); 2771 else 2772 LogRel(("Guest Additions were failed to reload after installation, please consider rebooting the guest\n")); 2773 2716 2774 vrc = pSession->Close(); 2717 2775 vrcRet = VINF_SUCCESS; … … 3228 3286 3229 3287 /* Wait for VBoxService to restart. */ 3230 vrc = waitForGuestSession(pSession->i_getParent() );3288 vrc = waitForGuestSession(pSession->i_getParent(), osType); 3231 3289 if (RT_FAILURE(vrc)) 3232 3290 hrc = setProgressErrorMsg(VBOX_E_IPRT_ERROR,
Note:
See TracChangeset
for help on using the changeset viewer.