VirtualBox

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


Ignore:
Timestamp:
Nov 26, 2018 3:59:11 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126941
Message:

HGCM,VMMDev: Made the HGCM command/message completion callback return a status code so VMMDev can indicate that a guest call was cancelled and the service could implement a way of dealing with that, rather than just dropping information. Ran into this with SIGCHLD delivery interrupting GUEST_MSG_WAIT and dropping crucial HOST_SESSION_CLOSE close messages, causing the host to wait until sometime timed out and probably left stuff/processes behind.

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

Legend:

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

    r75541 r75740  
    4444 *                  or from HGCM.
    4545 * @param pMsgCore  Pointer to just processed message.
    46  */
    47 typedef DECLCALLBACK(void) HGCMMSGCALLBACK(int32_t result, HGCMMsgCore *pMsgCore);
     46 *
     47 * @return Restricted set of VBox status codes when guest call message:
     48 * @retval VINF_SUCCESS on success
     49 * @retval VERR_CANCELLED if the request was cancelled.
     50 * @retval VERR_ALREADY_RESET if the VM is resetting.
     51 * @retval VERR_NOT_AVAILABLE if HGCM has been disconnected from the VMMDev
     52 *         (shouldn't happen).
     53 */
     54typedef DECLCALLBACK(int) HGCMMSGCALLBACK(int32_t result, HGCMMsgCore *pMsgCore);
     55/** Pointer to a message completeion callback function. */
    4856typedef HGCMMSGCALLBACK *PHGCMMSGCALLBACK;
    4957
  • trunk/src/VBox/Main/src-client/HGCM.cpp

    r75574 r75740  
    895895
    896896
    897 static DECLCALLBACK(void) hgcmMsgCompletionCallback(int32_t result, HGCMMsgCore *pMsgCore)
     897static DECLCALLBACK(int) hgcmMsgCompletionCallback(int32_t result, HGCMMsgCore *pMsgCore)
    898898{
    899899    /* Call the VMMDev port interface to issue IRQ notification. */
     
    902902    LogFlow(("MAIN::hgcmMsgCompletionCallback: message %p\n", pMsgCore));
    903903
    904     if (pMsgHdr->pHGCMPort && !g_fResetting)
    905     {
    906         pMsgHdr->pHGCMPort->pfnCompleted(pMsgHdr->pHGCMPort, g_fSaveState? VINF_HGCM_SAVE_STATE: result, pMsgHdr->pCmd);
    907     }
     904    if (pMsgHdr->pHGCMPort)
     905    {
     906        if (!g_fResetting)
     907            return pMsgHdr->pHGCMPort->pfnCompleted(pMsgHdr->pHGCMPort,
     908                                                    g_fSaveState ? VINF_HGCM_SAVE_STATE : result, pMsgHdr->pCmd);
     909        return VERR_ALREADY_RESET; /* best I could find. */
     910    }
     911    return VERR_NOT_AVAILABLE;
    908912}
    909913
     
    17231727#ifdef VBOX_WITH_CRHGSMI
    17241728
    1725 static DECLCALLBACK(void) hgcmMsgFastCallCompletionCallback(int32_t result, HGCMMsgCore *pMsgCore)
     1729static DECLCALLBACK(int) hgcmMsgFastCallCompletionCallback(int32_t result, HGCMMsgCore *pMsgCore)
    17261730{
    17271731    /* Call the VMMDev port interface to issue IRQ notification. */
     
    17311735    if (pMsg->pfnCompletion)
    17321736        pMsg->pfnCompletion(result, pMsg->u32Function, &pMsg->Param, pMsg->pvCompletion);
     1737    return VINF_SUCCESS;
    17331738}
    17341739
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