VirtualBox

Ticket #13722: ConsoleImpl.diff

File ConsoleImpl.diff, 7.7 KB (added by Frank Mehnert, 10 years ago)
  • src/VBox/Main/src-client/ConsoleImpl.cpp

     
    23272327    if (!ptrVM.isOk())
    23282328        return ptrVM.rc();
    23292329
    2330     /* release the lock before a VMR3* call (EMT will call us back)! */
     2330    /* release the lock before a VMR3* call (EMT might wait for it, @bugref{7648})! */
    23312331    alock.release();
    23322332
    23332333    int vrc = VMR3Reset(ptrVM.rawUVM());
     
    24332433        vrc = VMR3ReqCallU(pUVM, 0, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,
    24342434                           (PFNRT)unplugCpu, 3,
    24352435                           this, pUVM, (VMCPUID)aCpu);
    2436         if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc))
    2437         {
     2436   
     2437        /* release the lock before a VMR3* call (EMT might wait for it, @bugref{7648})! */
     2438        alock.release();
     2439
     2440        if (vrc == VERR_TIMEOUT)
    24382441            vrc = VMR3ReqWait(pReq, RT_INDEFINITE_WAIT);
    2439             AssertRC(vrc);
    2440             if (RT_SUCCESS(vrc))
    2441                 vrc = pReq->iStatus;
    2442         }
     2442        AssertRC(vrc);
     2443        if (RT_SUCCESS(vrc))
     2444            vrc = pReq->iStatus;
    24432445        VMR3ReqFree(pReq);
    24442446
    24452447        if (RT_SUCCESS(vrc))
     
    25402542                           (PFNRT)plugCpu, 3,
    25412543                           this, pUVM, aCpu);
    25422544
    2543     /* release the lock before a VMR3* call (EMT will call us back)! */
     2545    /* release the lock before a VMR3* call (EMT might wait for it, @bugref{7648})! */
    25442546    alock.release();
    25452547
    2546     if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc))
    2547     {
     2548    if (vrc == VERR_TIMEOUT)
    25482549        vrc = VMR3ReqWait(pReq, RT_INDEFINITE_WAIT);
    2549         AssertRC(vrc);
    2550         if (RT_SUCCESS(vrc))
    2551             vrc = pReq->iStatus;
    2552     }
     2550    AssertRC(vrc);
     2551    if (RT_SUCCESS(vrc))
     2552        vrc = pReq->iStatus;
    25532553    VMR3ReqFree(pReq);
    25542554
    2555     rc = RT_SUCCESS(vrc) ? S_OK :
    2556         setError(VBOX_E_VM_ERROR,
    2557                  tr("Could not add CPU to the machine (%Rrc)"),
    2558                  vrc);
    2559 
    25602555    if (RT_SUCCESS(vrc))
    25612556    {
    25622557        /* Notify the guest if possible. */
     
    25662561            vrc = pDevPort->pfnCpuHotPlug(pDevPort, idCpuCore, idCpuPackage);
    25672562        /** @todo warning if the guest doesn't support it */
    25682563    }
     2564    else
     2565        rc = setError(VBOX_E_VM_ERROR,
     2566                      tr("Could not add CPU to the machine (%Rrc)"),
     2567                      vrc);
    25692568
    25702569    LogFlowThisFunc(("mMachineState=%d, rc=%Rhrc\n", mMachineState, rc));
    25712570    LogFlowThisFuncLeave();
     
    37063705                           (PFNRT)changeRemovableMedium, 8,
    37073706                           this, pUVM, pszDevice, uInstance, enmBus, fUseHostIOCache, aMediumAttachment, fForce);
    37083707
    3709     /* release the lock before waiting for a result (EMT will call us back!) */
     3708    /* release the lock before waiting for a result (EMT might wait for it, @bugref{7648})! */
    37103709    alock.release();
    37113710
    3712     if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc))
    3713     {
     3711    if (vrc == VERR_TIMEOUT)
    37143712        vrc = VMR3ReqWait(pReq, RT_INDEFINITE_WAIT);
    3715         AssertRC(vrc);
    3716         if (RT_SUCCESS(vrc))
    3717             vrc = pReq->iStatus;
    3718     }
     3713    AssertRC(vrc);
     3714    if (RT_SUCCESS(vrc))
     3715        vrc = pReq->iStatus;
    37193716    VMR3ReqFree(pReq);
    37203717
    37213718    if (fResume)
     
    38993896                           (PFNRT)attachStorageDevice, 8,
    39003897                           this, pUVM, pszDevice, uInstance, enmBus, fUseHostIOCache, aMediumAttachment, fSilent);
    39013898
    3902     /* release the lock before waiting for a result (EMT will call us back!) */
     3899    /* release the lock before waiting for a result (EMT might wait for it, @bugref{7648})! */
    39033900    alock.release();
    39043901
    3905     if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc))
    3906     {
     3902    if (vrc == VERR_TIMEOUT)
    39073903        vrc = VMR3ReqWait(pReq, RT_INDEFINITE_WAIT);
    3908         AssertRC(vrc);
    3909         if (RT_SUCCESS(vrc))
    3910             vrc = pReq->iStatus;
    3911     }
     3904    AssertRC(vrc);
     3905    if (RT_SUCCESS(vrc))
     3906        vrc = pReq->iStatus;
    39123907    VMR3ReqFree(pReq);
    39133908
    39143909    if (fResume)
     
    40824077                           (PFNRT)detachStorageDevice, 7,
    40834078                           this, pUVM, pszDevice, uInstance, enmBus, aMediumAttachment, fSilent);
    40844079
    4085     /* release the lock before waiting for a result (EMT will call us back!) */
     4080    /* release the lock before waiting for a result (EMT might wait for it, @bugref{7648})! */
    40864081    alock.release();
    40874082
    4088     if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc))
    4089     {
     4083    if (vrc == VERR_TIMEOUT)
    40904084        vrc = VMR3ReqWait(pReq, RT_INDEFINITE_WAIT);
    4091         AssertRC(vrc);
    4092         if (RT_SUCCESS(vrc))
    4093             vrc = pReq->iStatus;
    4094     }
     4085    AssertRC(vrc);
     4086    if (RT_SUCCESS(vrc))
     4087        vrc = pReq->iStatus;
    40954088    VMR3ReqFree(pReq);
    40964089
    40974090    if (fResume)
     
    48414834     * here to make requests from under the lock in order to serialize them.
    48424835     */
    48434836    PVMREQ pReq;
    4844     int vrc = VMR3ReqCallU(pUVM, 0 /*idDstCpu*/, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,
    4845                            (PFNRT)changeNetworkAttachment, 6,
    4846                            this, pUVM, pszDevice, uInstance, uLun, aNetworkAdapter);
     4837    int vrc = VMR3ReqCallWaitU(pUVM, 0 /*idDstCpu*/,
     4838                               (PFNRT)changeNetworkAttachment, 6,
     4839                               this, pUVM, pszDevice, uInstance, uLun, aNetworkAdapter);
    48474840
    4848     if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc))
    4849     {
    4850         vrc = VMR3ReqWait(pReq, RT_INDEFINITE_WAIT);
    4851         AssertRC(vrc);
    4852         if (RT_SUCCESS(vrc))
    4853             vrc = pReq->iStatus;
    4854     }
    4855     VMR3ReqFree(pReq);
    4856 
    48574841    if (fResume)
    48584842        resumeAfterConfigChange(pUVM);
    48594843
     
    61346118    if (!ptrVM.isOk())
    61356119        return ptrVM.rc();
    61366120
    6137     /* release the lock before a VMR3* call (EMT will call us back)! */
     6121    /* release the lock before a VMR3* call (EMT might wait for it, @bugref{7648})! */
    61386122    alock.release();
    61396123
    61406124    LogFlowThisFunc(("Sending PAUSE request...\n"));
     
    61936177    if (!ptrVM.isOk())
    61946178        return ptrVM.rc();
    61956179
    6196     /* release the lock before a VMR3* call (EMT will call us back)! */
     6180    /* release the lock before a VMR3* call (EMT might wait for it, @bugref{7648})! */
    61976181    alock.release();
    61986182
    61996183    LogFlowThisFunc(("Sending RESUME request...\n"));
     
    62726256        if (!ptrVM.isOk())
    62736257            return ptrVM.rc();
    62746258
    6275         /* release the lock before a VMR3* call (EMT will call us back)! */
     6259        /* release the lock before a VMR3* call (EMT might wait for it, @bugref{7648})! */
    62766260        alock.release();
    62776261        VMSUSPENDREASON enmReason = VMSUSPENDREASON_USER;
    62786262        if (aReason == Reason_HostSuspend)
     
    74977481    {
    74987482        LogFlowThisFunc(("Shutdown HGCM...\n"));
    74997483
    7500         /* Leave the lock since EMT will call us back as addVMCaller() */
     7484        /* Leave the lock since EMT might wait for it and will call us back as addVMCaller() */
    75017485        alock.release();
    75027486
    75037487        m_pVMMDev->hgcmShutdown();
     
    88368820        rc = setError(E_FAIL,
    88378821            tr("General failure attaching to host interface"));
    88388822    }
    8839     LogFlowThisFunc(("rc=%d\n", rc));
     8823    LogFlowThisFunc(("rc=%Rhrc\n", rc));
    88408824    return rc;
    88418825}
    88428826
     
    99989982                 * don't release the lock since reconfigureMediumAttachment
    99999983                 * isn't going to need the Console lock.
    100009984                 */
     9985
     9986                /* TODO: do alock.release here as EMT might wait on it! See other places
     9987                 * where we do VMR3ReqCall requests. See @bugref{7648}. */
    100019988                vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), VMCPUID_ANY,
    100029989                                       (PFNRT)reconfigureMediumAttachment, 13,
    100039990                                       that, ptrVM.rawUVM(), pcszDevice, lInstance, enmBus, fUseHostIOCache,

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy