Changeset 50736 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 10, 2014 2:44:56 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r50723 r50736 570 570 HRESULT removeSharedFolder(const Utf8Str &strName); 571 571 572 intsuspendBeforeConfigChange(PUVM pUVM, AutoWriteLock *pAlock, bool *pfResume);573 void resumeAfterConfigChange(PUVM pUVM);572 HRESULT suspendBeforeConfigChange(PUVM pUVM, AutoWriteLock *pAlock, bool *pfResume); 573 void resumeAfterConfigChange(PUVM pUVM); 574 574 575 575 static DECLCALLBACK(int) configConstructor(PUVM pUVM, PVM pVM, void *pvConsole); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r50723 r50736 3544 3544 * afterwards. 3545 3545 */ 3546 intConsole::suspendBeforeConfigChange(PUVM pUVM, AutoWriteLock *pAlock, bool *pfResume)3546 HRESULT Console::suspendBeforeConfigChange(PUVM pUVM, AutoWriteLock *pAlock, bool *pfResume) 3547 3547 { 3548 3548 *pfResume = false; … … 3569 3569 break; 3570 3570 default: 3571 return VERR_INVALID_STATE; 3572 } 3573 3574 return VINF_SUCCESS; 3571 return setErrorInternal(VBOX_E_INVALID_VM_STATE, 3572 COM_IIDOF(IConsole), 3573 getStaticComponentName(), 3574 Utf8StrFmt("Invalid state '%s' for changing medium", 3575 VMR3GetStateName(enmVMState)), 3576 false /*aWarning*/, 3577 true /*aLogIt*/); 3578 } 3579 3580 return S_OK; 3575 3581 } 3576 3582 … … 3672 3678 */ 3673 3679 bool fResume = false; 3674 int vrc = suspendBeforeConfigChange(pUVM, &alock, &fResume);3675 if ( RT_FAILURE(vrc))3676 return vrc;3680 rc = suspendBeforeConfigChange(pUVM, &alock, &fResume); 3681 if (FAILED(rc)) 3682 return rc; 3677 3683 3678 3684 /* … … 3682 3688 */ 3683 3689 PVMREQ pReq; 3684 vrc = VMR3ReqCallU(pUVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,3685 (PFNRT)changeRemovableMedium, 8,3686 this, pUVM, pszDevice, uInstance, enmBus, fUseHostIOCache, aMediumAttachment, fForce);3690 int vrc = VMR3ReqCallU(pUVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 3691 (PFNRT)changeRemovableMedium, 8, 3692 this, pUVM, pszDevice, uInstance, enmBus, fUseHostIOCache, aMediumAttachment, fForce); 3687 3693 3688 3694 /* release the lock before waiting for a result (EMT will call us back!) */ … … 3865 3871 */ 3866 3872 bool fResume = false; 3867 int vrc = suspendBeforeConfigChange(pUVM, &alock, &fResume);3868 if ( RT_FAILURE(vrc))3869 return vrc;3873 rc = suspendBeforeConfigChange(pUVM, &alock, &fResume); 3874 if (FAILED(rc)) 3875 return rc; 3870 3876 3871 3877 /* … … 3875 3881 */ 3876 3882 PVMREQ pReq; 3877 vrc = VMR3ReqCallU(pUVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,3878 (PFNRT)attachStorageDevice, 8,3879 this, pUVM, pszDevice, uInstance, enmBus, fUseHostIOCache, aMediumAttachment, fSilent);3883 int vrc = VMR3ReqCallU(pUVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 3884 (PFNRT)attachStorageDevice, 8, 3885 this, pUVM, pszDevice, uInstance, enmBus, fUseHostIOCache, aMediumAttachment, fSilent); 3880 3886 3881 3887 /* release the lock before waiting for a result (EMT will call us back!) */ … … 4057 4063 */ 4058 4064 bool fResume = false; 4059 int vrc = suspendBeforeConfigChange(pUVM, &alock, &fResume);4060 if ( RT_FAILURE(vrc))4061 return vrc;4065 rc = suspendBeforeConfigChange(pUVM, &alock, &fResume); 4066 if (FAILED(rc)) 4067 return rc; 4062 4068 4063 4069 /* … … 4067 4073 */ 4068 4074 PVMREQ pReq; 4069 vrc = VMR3ReqCallU(pUVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,4070 (PFNRT)detachStorageDevice, 7,4071 this, pUVM, pszDevice, uInstance, enmBus, aMediumAttachment, fSilent);4075 int vrc = VMR3ReqCallU(pUVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 4076 (PFNRT)detachStorageDevice, 7, 4077 this, pUVM, pszDevice, uInstance, enmBus, aMediumAttachment, fSilent); 4072 4078 4073 4079 /* release the lock before waiting for a result (EMT will call us back!) */ … … 4446 4452 */ 4447 4453 bool fResume = false; 4448 int vrc = suspendBeforeConfigChange(pUVM, NULL, &fResume);4449 if ( RT_FAILURE(vrc))4450 return vrc;4454 int rc = suspendBeforeConfigChange(pUVM, NULL, &fResume); 4455 if (FAILED(rc)) 4456 return rc; 4451 4457 4452 4458 /* … … 4456 4462 */ 4457 4463 PVMREQ pReq; 4458 vrc = VMR3ReqCallU(pUVM, 0 /*idDstCpu*/, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,4459 (PFNRT)changeNetworkAttachment, 6,4460 this, pUVM, pszDevice, uInstance, uLun, aNetworkAdapter);4464 int vrc = VMR3ReqCallU(pUVM, 0 /*idDstCpu*/, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 4465 (PFNRT)changeNetworkAttachment, 6, 4466 this, pUVM, pszDevice, uInstance, uLun, aNetworkAdapter); 4461 4467 4462 4468 if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc))
Note:
See TracChangeset
for help on using the changeset viewer.