diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2023-04-17 09:14:22 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2023-04-17 09:14:22 +0000 |
commit | 825d2274b5622765aea851c7dd075a2f1c277bfb (patch) | |
tree | 6b7ee49569770c01804e21bdabf7ad90241345ac /src/VBox/Main/src-client | |
parent | bd0dc220fa7ef33c3d4d3cdd635a0ed29dd7e628 (diff) | |
download | VirtualBox-svn-825d2274b5622765aea851c7dd075a2f1c277bfb.tar.gz |
Guest Control/Main: Treat reported Guest Additions versions of "0.0.0" (or 0) through VMMDev as Guest Additions not being found or not ready (yet) within GuestSession::i_determineProtocolVersion() (via vmmdevUpdateGuestInfo[2]).
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@99416 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/Main/src-client')
-rw-r--r-- | src/VBox/Main/src-client/GuestCtrlImpl.cpp | 6 | ||||
-rw-r--r-- | src/VBox/Main/src-client/GuestSessionImpl.cpp | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/VBox/Main/src-client/GuestCtrlImpl.cpp b/src/VBox/Main/src-client/GuestCtrlImpl.cpp index 8f671f2302b..0fc09c36a34 100644 --- a/src/VBox/Main/src-client/GuestCtrlImpl.cpp +++ b/src/VBox/Main/src-client/GuestCtrlImpl.cpp @@ -458,10 +458,12 @@ HRESULT Guest::createSession(const com::Utf8Str &aUser, const com::Utf8Str &aPas VBOX_GUESTCTRL_MAX_SESSIONS); break; - /** @todo Add more errors here. */ + case VERR_NOT_FOUND: /* Returned by i_sessionCreate(). */ + hrc = setErrorBoth(VBOX_E_GSTCTL_GUEST_ERROR, vrc, tr("Guest Additions are not installed or not ready (yet)")); + break; default: - hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Could not create guest session: %Rrc"), vrc); + hrc = setErrorBoth(VBOX_E_GSTCTL_GUEST_ERROR, vrc, tr("Could not create guest session: %Rrc"), vrc); break; } } diff --git a/src/VBox/Main/src-client/GuestSessionImpl.cpp b/src/VBox/Main/src-client/GuestSessionImpl.cpp index 69e2ac91c3e..6cdefcfbac7 100644 --- a/src/VBox/Main/src-client/GuestSessionImpl.cpp +++ b/src/VBox/Main/src-client/GuestSessionImpl.cpp @@ -199,6 +199,7 @@ void GuestSession::FinalRelease(void) * yet. This needs to be done via the openSession() / openSessionAsync calls. * * @returns VBox status code. + * @retval VERR_NOT_FOUND if the Guest Additions were not found (or were not reported yet). * @param pGuest Guest object the guest session belongs to. * @param ssInfo Guest session startup info to use. * @param guestCreds Guest credentials to use for starting a guest session @@ -3534,10 +3535,10 @@ int GuestSession::i_shutdown(uint32_t fFlags, int *pvrcGuest) /** * Determines the protocol version (sets mData.mProtocolVersion). * - * This is called from the init method prior to to establishing a guest - * session. + * This is called from the init method prior to to establishing a guest session. * * @returns VBox status code. + * @retval VERR_NOT_FOUND if the Guest Additions were not found (or were not reported) yet. */ int GuestSession::i_determineProtocolVersion(void) { @@ -3548,6 +3549,8 @@ int GuestSession::i_determineProtocolVersion(void) ComObjPtr<Guest> pGuest = mParent; AssertReturn(!pGuest.isNull(), VERR_NOT_SUPPORTED); uint32_t uGaVersion = pGuest->i_getAdditionsVersion(); + if (!uGaVersion) /* If 0, there was no Guest Additions version detected (yet), or the VM is in reset state. */ + return VERR_NOT_FOUND; /* Everyone supports version one, if they support anything at all. */ mData.mProtocolVersion = 1; |