VirtualBox

Ignore:
Timestamp:
Apr 11, 2013 11:11:42 AM (12 years ago)
Author:
vboxsync
Message:

GuestCtrl: Added abstract IGuestProcessIOEvent event, removed duplicate code, making the testdriver execution tests pass.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestControl/service.cpp

    r45417 r45482  
    103103    VBOXHGCMSVCPARM *mParms;
    104104    /** The standard constructor. */
    105     ClientConnection(void) : mHandle(0), mNumParms(0), mParms(NULL) {}
     105    ClientConnection(void)
     106        : mHandle(0), mNumParms(0), mParms(NULL) {}
    106107} ClientConnection;
    107108
     
    419420        }
    420421        else
    421             LogFlowFunc(("Client has not (yet) submitted enough parameters (%RU32) to at least peak for the next message\n",
     422            LogFlowFunc(("Warning: Client has not (yet) submitted enough parameters (%RU32, must be at least 2) to at least peak for the next message\n",
    422423                         pConnection->mNumParms));
    423424
     
    479480          mHostCmdRc(VINF_SUCCESS), mHostCmdTries(0),
    480481          mHostCmdTS(0),
    481           mIsPending(false) { }
     482          mIsPending(false),
     483          mPeekCount(0) { }
    482484
    483485    ClientState(PVBOXHGCMSVCHELPERS pSvcHelpers, uint32_t uClientID)
     
    487489          mHostCmdRc(VINF_SUCCESS), mHostCmdTries(0),
    488490          mHostCmdTS(0),
    489           mIsPending(false) { }
     491          mIsPending(false),
     492          mPeekCount(0){ }
    490493
    491494    void DequeueAll(void)
     
    765768
    766769        int rc;
     770        /* If the client is in pending mode, always send back
     771         * the peek result first. */
    767772        if (mIsPending)
    768773        {
    769             /* If the client is in pending mode, always send back
    770              * the peek result first. */
    771774            rc = pHostCmd->Peek(pConnection);
     775            mPeekCount++;
    772776        }
    773777        else
    774778        {
    775             /* Try assigning the host command to the client and store the
    776              * result code for later use. */
    777             rc = pHostCmd->Assign(pConnection);
    778             if (RT_FAILURE(rc)) /* If something failed, let the client peek (again). */
     779            if (!mPeekCount)
     780            {
    779781                rc = pHostCmd->Peek(pConnection);
     782                mPeekCount++;
     783            }
     784            else
     785            {
     786                /* Try assigning the host command to the client and store the
     787                 * result code for later use. */
     788                rc = pHostCmd->Assign(pConnection);
     789                if (RT_FAILURE(rc)) /* If something failed, let the client peek (again). */
     790                {
     791                    rc = pHostCmd->Peek(pConnection);
     792                    mPeekCount++;
     793                }
     794                else
     795                    mPeekCount = 0;
     796            }
    780797        }
    781798
     
    788805        mSvcHelpers->pfnCallComplete(pConnection->mHandle, rc);
    789806
    790         LogFlowFunc(("[Client %RU32] pConnection=%p, pHostCmd=%p, replyRc=%Rrc\n",
    791                      mID, pConnection, pHostCmd, rc));
     807        LogFlowFunc(("[Client %RU32] mPeekCount=%RU32, pConnection=%p, pHostCmd=%p, replyRc=%Rrc\n",
     808                     mID, mPeekCount, pConnection, pHostCmd, rc));
    792809        return rc;
    793810    }
     
    810827    /** Timestamp (us) of last host command processed. */
    811828    uint64_t mHostCmdTS;
    812     /** Flag indicating whether the client currently is pending. */
     829    /**
     830     * Flag indicating whether the client currently is pending.
     831     * This means the client waits for a new host command to reply
     832     * and won't return from the waiting call until a new host
     833     * command is available.
     834     */
    813835    bool mIsPending;
     836    /**
     837     * This is necessary for being compatible with older
     838     * Guest Additions. In case there are commands which only
     839     * have two (2) parameters and therefore would fit into the
     840     * GUEST_MSG_WAIT reply immediately, we now can make sure
     841     * that the client first gets back the GUEST_MSG_WAIT results
     842     * first.
     843     */
     844    uint32_t mPeekCount;
    814845    /** The client's pending connection. */
    815846    ClientConnection mPendingCon;
     
    13461377
    13471378                /*
    1348                  * The guest only wants skip the currently assigned messages.
     1379                 * The guest only wants skip the currently assigned messages. Neded
     1380                 * for dropping its assigned reference of the current assigned host
     1381                 * command in queue.
    13491382                 * Since VBox 4.3+.
    13501383                 */
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