Ticket #13722: ConsoleImpl.diff
| File ConsoleImpl.diff, 7.7 KB (added by , 10 years ago) |
|---|
-
src/VBox/Main/src-client/ConsoleImpl.cpp
2327 2327 if (!ptrVM.isOk()) 2328 2328 return ptrVM.rc(); 2329 2329 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})! */ 2331 2331 alock.release(); 2332 2332 2333 2333 int vrc = VMR3Reset(ptrVM.rawUVM()); … … 2433 2433 vrc = VMR3ReqCallU(pUVM, 0, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 2434 2434 (PFNRT)unplugCpu, 3, 2435 2435 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) 2438 2441 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; 2443 2445 VMR3ReqFree(pReq); 2444 2446 2445 2447 if (RT_SUCCESS(vrc)) … … 2540 2542 (PFNRT)plugCpu, 3, 2541 2543 this, pUVM, aCpu); 2542 2544 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})! */ 2544 2546 alock.release(); 2545 2547 2546 if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc)) 2547 { 2548 if (vrc == VERR_TIMEOUT) 2548 2549 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; 2553 2553 VMR3ReqFree(pReq); 2554 2554 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 2560 2555 if (RT_SUCCESS(vrc)) 2561 2556 { 2562 2557 /* Notify the guest if possible. */ … … 2566 2561 vrc = pDevPort->pfnCpuHotPlug(pDevPort, idCpuCore, idCpuPackage); 2567 2562 /** @todo warning if the guest doesn't support it */ 2568 2563 } 2564 else 2565 rc = setError(VBOX_E_VM_ERROR, 2566 tr("Could not add CPU to the machine (%Rrc)"), 2567 vrc); 2569 2568 2570 2569 LogFlowThisFunc(("mMachineState=%d, rc=%Rhrc\n", mMachineState, rc)); 2571 2570 LogFlowThisFuncLeave(); … … 3706 3705 (PFNRT)changeRemovableMedium, 8, 3707 3706 this, pUVM, pszDevice, uInstance, enmBus, fUseHostIOCache, aMediumAttachment, fForce); 3708 3707 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})! */ 3710 3709 alock.release(); 3711 3710 3712 if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc)) 3713 { 3711 if (vrc == VERR_TIMEOUT) 3714 3712 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; 3719 3716 VMR3ReqFree(pReq); 3720 3717 3721 3718 if (fResume) … … 3899 3896 (PFNRT)attachStorageDevice, 8, 3900 3897 this, pUVM, pszDevice, uInstance, enmBus, fUseHostIOCache, aMediumAttachment, fSilent); 3901 3898 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})! */ 3903 3900 alock.release(); 3904 3901 3905 if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc)) 3906 { 3902 if (vrc == VERR_TIMEOUT) 3907 3903 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; 3912 3907 VMR3ReqFree(pReq); 3913 3908 3914 3909 if (fResume) … … 4082 4077 (PFNRT)detachStorageDevice, 7, 4083 4078 this, pUVM, pszDevice, uInstance, enmBus, aMediumAttachment, fSilent); 4084 4079 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})! */ 4086 4081 alock.release(); 4087 4082 4088 if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc)) 4089 { 4083 if (vrc == VERR_TIMEOUT) 4090 4084 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; 4095 4088 VMR3ReqFree(pReq); 4096 4089 4097 4090 if (fResume) … … 4841 4834 * here to make requests from under the lock in order to serialize them. 4842 4835 */ 4843 4836 PVMREQ pReq; 4844 int vrc = VMR3ReqCall U(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); 4847 4840 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 4857 4841 if (fResume) 4858 4842 resumeAfterConfigChange(pUVM); 4859 4843 … … 6134 6118 if (!ptrVM.isOk()) 6135 6119 return ptrVM.rc(); 6136 6120 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})! */ 6138 6122 alock.release(); 6139 6123 6140 6124 LogFlowThisFunc(("Sending PAUSE request...\n")); … … 6193 6177 if (!ptrVM.isOk()) 6194 6178 return ptrVM.rc(); 6195 6179 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})! */ 6197 6181 alock.release(); 6198 6182 6199 6183 LogFlowThisFunc(("Sending RESUME request...\n")); … … 6272 6256 if (!ptrVM.isOk()) 6273 6257 return ptrVM.rc(); 6274 6258 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})! */ 6276 6260 alock.release(); 6277 6261 VMSUSPENDREASON enmReason = VMSUSPENDREASON_USER; 6278 6262 if (aReason == Reason_HostSuspend) … … 7497 7481 { 7498 7482 LogFlowThisFunc(("Shutdown HGCM...\n")); 7499 7483 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() */ 7501 7485 alock.release(); 7502 7486 7503 7487 m_pVMMDev->hgcmShutdown(); … … 8836 8820 rc = setError(E_FAIL, 8837 8821 tr("General failure attaching to host interface")); 8838 8822 } 8839 LogFlowThisFunc(("rc=% d\n", rc));8823 LogFlowThisFunc(("rc=%Rhrc\n", rc)); 8840 8824 return rc; 8841 8825 } 8842 8826 … … 9998 9982 * don't release the lock since reconfigureMediumAttachment 9999 9983 * isn't going to need the Console lock. 10000 9984 */ 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}. */ 10001 9988 vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), VMCPUID_ANY, 10002 9989 (PFNRT)reconfigureMediumAttachment, 13, 10003 9990 that, ptrVM.rawUVM(), pcszDevice, lInstance, enmBus, fUseHostIOCache,

