Changeset 44340 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jan 23, 2013 4:20:07 PM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r44322 r44340 15424 15424 <attribute name="VM" type="long long" readonly="yes" wsmap="suppress"> 15425 15425 <desc> 15426 Gets the VM handle. This is only for internal use while 15427 we carve the details of this interface. 15426 Gets the user-mode VM handle, with a reference. Must be passed to 15427 VMR3ReleaseUVM when done. This is only for internal use while we carve 15428 the details of this interface. 15428 15429 </desc> 15429 15430 </attribute> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r44191 r44340 544 544 bool fForceUnmount, 545 545 bool fHotplug, 546 P VM pVM,546 PUVM pUVM, 547 547 DeviceType_T *paLedDevType); 548 548 int configMedium(PCFGMNODE pLunL0, … … 560 560 HRESULT *phrc); 561 561 static DECLCALLBACK(int) reconfigureMediumAttachment(Console *pConsole, 562 P VM pVM,562 PUVM pUVM, 563 563 const char *pcszDevice, 564 564 unsigned uInstance, … … 573 573 HRESULT *phrc); 574 574 static DECLCALLBACK(int) changeRemovableMedium(Console *pThis, 575 P VM pVM,575 PUVM pUVM, 576 576 const char *pcszDevice, 577 577 unsigned uInstance, … … 592 592 bool fAttachDetach, bool fIgnoreConnectFailure); 593 593 594 static DECLCALLBACK(int) configGuestProperties(void *pvConsole, P VM pVM);594 static DECLCALLBACK(int) configGuestProperties(void *pvConsole, PUVM pUVM); 595 595 static DECLCALLBACK(int) configGuestControl(void *pvConsole); 596 596 static DECLCALLBACK(void) vmstateChangeCallback(PVM aVM, VMSTATE aState, … … 598 598 static DECLCALLBACK(int) unplugCpu(Console *pThis, PVM pVM, unsigned uCpu); 599 599 static DECLCALLBACK(int) plugCpu(Console *pThis, PVM pVM, unsigned uCpu); 600 HRESULT doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce, P VM pVM);600 HRESULT doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce, PUVM pUVM); 601 601 HRESULT doCPURemove(ULONG aCpu, PVM pVM); 602 602 HRESULT doCPUAdd(ULONG aCpu, PVM pVM); 603 603 604 HRESULT doNetworkAdapterChange(P VM pVM, const char *pszDevice, unsigned uInstance,604 HRESULT doNetworkAdapterChange(PUVM pUVM, const char *pszDevice, unsigned uInstance, 605 605 unsigned uLun, INetworkAdapter *aNetworkAdapter); 606 static DECLCALLBACK(int) changeNetworkAttachment(Console *pThis, P VM pVM, const char *pszDevice,606 static DECLCALLBACK(int) changeNetworkAttachment(Console *pThis, PUVM pUVM, const char *pszDevice, 607 607 unsigned uInstance, unsigned uLun, 608 608 INetworkAdapter *aNetworkAdapter); … … 615 615 HRESULT detachUSBDevice(const ComObjPtr<OUSBDevice> &aHostDevice); 616 616 617 static DECLCALLBACK(int) usbAttachCallback(Console *that, P VM pVM, IUSBDevice *aHostDevice, PCRTUUID aUuid,617 static DECLCALLBACK(int) usbAttachCallback(Console *that, PUVM pUVM, IUSBDevice *aHostDevice, PCRTUUID aUuid, 618 618 bool aRemote, const char *aAddress, void *pvRemoteBackend, USHORT aPortVersion, ULONG aMaskedIfs); 619 static DECLCALLBACK(int) usbDetachCallback(Console *that, P VM pVM, PCRTUUID aUuid);619 static DECLCALLBACK(int) usbDetachCallback(Console *that, PUVM pUVM, PCRTUUID aUuid); 620 620 #endif 621 621 622 622 static DECLCALLBACK(int) attachStorageDevice(Console *pThis, 623 P VM pVM,623 PUVM pUVM, 624 624 const char *pcszDevice, 625 625 unsigned uInstance, … … 628 628 IMediumAttachment *aMediumAtt); 629 629 static DECLCALLBACK(int) detachStorageDevice(Console *pThis, 630 P VM pVM,630 PUVM pUVM, 631 631 const char *pcszDevice, 632 632 unsigned uInstance, 633 633 StorageBus_T enmBus, 634 634 IMediumAttachment *aMediumAtt); 635 HRESULT doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, P VM pVM);636 HRESULT doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, P VM pVM);635 HRESULT doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM); 636 HRESULT doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM); 637 637 638 638 static DECLCALLBACK(int) fntTakeSnapshotWorker(RTTHREAD Thread, void *pvUser); … … 648 648 const char *pszErrorId, const char *pszFormat, va_list va); 649 649 650 HRESULT captureUSBDevices(P VM pVM);650 HRESULT captureUSBDevices(PUVM pUVM); 651 651 void detachAllUSBDevices(bool aDone); 652 652 -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r44288 r44340 157 157 mServerProgress(aServerProgress), 158 158 mpVM(NULL), 159 mpUVM(NULL), 159 160 mRC(E_FAIL), 160 161 mpSafeVMPtr(NULL) … … 168 169 mpSafeVMPtr = new Console::SafeVMPtr(aConsole); 169 170 if (mpSafeVMPtr->isOk()) 171 { 170 172 mpVM = mpSafeVMPtr->raw(); 173 mpUVM = mpSafeVMPtr->rawUVM(); 174 } 171 175 else 172 176 mRC = mpSafeVMPtr->rc(); … … 198 202 const ComPtr<IProgress> mServerProgress; 199 203 PVM mpVM; 204 PUVM mpUVM; 200 205 201 206 private: … … 2229 2234 alock.release(); 2230 2235 2231 int vrc = VMR3Reset(ptrVM );2236 int vrc = VMR3Reset(ptrVM.rawUVM()); 2232 2237 2233 2238 HRESULT rc = RT_SUCCESS(vrc) ? S_OK : … … 2255 2260 HRESULT Console::doCPURemove(ULONG aCpu, PVM pVM) 2256 2261 { 2262 PUVM pUVM = VMR3GetUVM(pVM); 2257 2263 HRESULT rc = S_OK; 2258 2264 … … 2297 2303 /* Notify the guest if possible. */ 2298 2304 uint32_t idCpuCore, idCpuPackage; 2299 vrc = VMR3GetCpuCoreAndPackageIdFromCpuId(p VM, aCpu, &idCpuCore, &idCpuPackage); AssertRC(vrc);2305 vrc = VMR3GetCpuCoreAndPackageIdFromCpuId(pUVM, aCpu, &idCpuCore, &idCpuPackage); AssertRC(vrc); 2300 2306 if (RT_SUCCESS(vrc)) 2301 2307 vrc = pVmmDevPort->pfnCpuHotUnplug(pVmmDevPort, idCpuCore, idCpuPackage); … … 2329 2335 */ 2330 2336 PVMREQ pReq; 2331 vrc = VMR3ReqCall (pVM, 0, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,2332 (PFNRT)Console::unplugCpu, 3,2333 this, pVM, aCpu);2337 vrc = VMR3ReqCallU(pUVM, 0, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 2338 (PFNRT)Console::unplugCpu, 3, 2339 this, pVM, aCpu); 2334 2340 if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc)) 2335 2341 { … … 2344 2350 { 2345 2351 /* Detach it from the VM */ 2346 vrc = VMR3HotUnplugCpu(p VM, aCpu);2352 vrc = VMR3HotUnplugCpu(pUVM, aCpu); 2347 2353 AssertRC(vrc); 2348 2354 } … … 2362 2368 /*static*/ DECLCALLBACK(int) Console::plugCpu(Console *pThis, PVM pVM, unsigned uCpu) 2363 2369 { 2370 PUVM pUVM = VMR3GetUVM(pVM); 2364 2371 LogFlowFunc(("pThis=%p uCpu=%u\n", pThis, uCpu)); 2365 2372 2366 2373 AssertReturn(pThis, VERR_INVALID_PARAMETER); 2367 2374 2368 int rc = VMR3HotPlugCpu(p VM, uCpu);2375 int rc = VMR3HotPlugCpu(pUVM, uCpu); 2369 2376 AssertRC(rc); 2370 2377 2371 PCFGMNODE pInst = CFGMR3GetChild(CFGMR3GetRoot (pVM), "Devices/acpi/0/");2378 PCFGMNODE pInst = CFGMR3GetChild(CFGMR3GetRootU(pUVM), "Devices/acpi/0/"); 2372 2379 AssertRelease(pInst); 2373 2380 /* nuke anything which might have been left behind. */ … … 2399 2406 HRESULT Console::doCPUAdd(ULONG aCpu, PVM pVM) 2400 2407 { 2408 PUVM pUVM = VMR3GetUVM(pVM); 2401 2409 HRESULT rc = S_OK; 2402 2410 … … 2435 2443 */ 2436 2444 PVMREQ pReq; 2437 int vrc = VMR3ReqCall (pVM, 0, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,2438 (PFNRT)Console::plugCpu, 3,2439 this, pVM, aCpu);2445 int vrc = VMR3ReqCallU(pUVM, 0, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 2446 (PFNRT)Console::plugCpu, 3, 2447 this, pVM, aCpu); 2440 2448 2441 2449 /* release the lock before a VMR3* call (EMT will call us back)! */ … … 2460 2468 /* Notify the guest if possible. */ 2461 2469 uint32_t idCpuCore, idCpuPackage; 2462 vrc = VMR3GetCpuCoreAndPackageIdFromCpuId(p VM, aCpu, &idCpuCore, &idCpuPackage); AssertRC(vrc);2470 vrc = VMR3GetCpuCoreAndPackageIdFromCpuId(pUVM, aCpu, &idCpuCore, &idCpuPackage); AssertRC(vrc); 2463 2471 if (RT_SUCCESS(vrc)) 2464 2472 vrc = pDevPort->pfnCpuHotPlug(pDevPort, idCpuCore, idCpuPackage); … … 2506 2514 alock.release(); 2507 2515 2508 int vrc = VMR3Suspend(ptrVM );2516 int vrc = VMR3Suspend(ptrVM.rawUVM()); 2509 2517 2510 2518 HRESULT hrc = S_OK; … … 2548 2556 if (RT_SUCCESS(vrc)) 2549 2557 { 2550 if (VMR3GetState (ptrVM) == VMSTATE_CREATED)2551 vrc = VMR3PowerOn(ptrVM ); /* (PowerUpPaused) */2558 if (VMR3GetStateU(ptrVM.rawUVM()) == VMSTATE_CREATED) 2559 vrc = VMR3PowerOn(ptrVM.rawUVM()); /* (PowerUpPaused) */ 2552 2560 else 2553 vrc = VMR3Resume(ptrVM );2561 vrc = VMR3Resume(ptrVM.rawUVM()); 2554 2562 } 2555 2563 … … 2785 2793 /* release the lock before a VMR3* call (EMT will call us back)! */ 2786 2794 alock.release(); 2787 int vrc = VMR3Suspend(ptrVM );2795 int vrc = VMR3Suspend(ptrVM.rawUVM()); 2788 2796 alock.acquire(); 2789 2797 … … 2893 2901 { 2894 2902 alock.release(); 2895 VMR3Resume(ptrVM );2903 VMR3Resume(ptrVM.rawUVM()); 2896 2904 alock.acquire(); 2897 2905 } … … 3660 3668 * @param aMediumAttachment The medium attachment with the new medium state. 3661 3669 * @param fForce Force medium chance, if it is locked or not. 3662 * @param p VMSafe VM handle.3670 * @param pUVM Safe VM handle. 3663 3671 * 3664 3672 * @note Locks this object for writing. 3665 3673 */ 3666 HRESULT Console::doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce, P VM pVM)3674 HRESULT Console::doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce, PUVM pUVM) 3667 3675 { 3668 3676 AutoCaller autoCaller(this); … … 3728 3736 */ 3729 3737 PVMREQ pReq; 3730 int vrc = VMR3ReqCall (pVM,3731 VMCPUID_ANY,3732 &pReq,3733 0 /* no wait! */,3734 VMREQFLAGS_VBOX_STATUS,3735 (PFNRT)Console::changeRemovableMedium,3736 8,3737 this,3738 pVM,3739 pszDevice,3740 uInstance,3741 enmBus,3742 fUseHostIOCache,3743 aMediumAttachment,3744 fForce);3738 int vrc = VMR3ReqCallU(pUVM, 3739 VMCPUID_ANY, 3740 &pReq, 3741 0 /* no wait! */, 3742 VMREQFLAGS_VBOX_STATUS, 3743 (PFNRT)Console::changeRemovableMedium, 3744 8, 3745 this, 3746 pUVM, 3747 pszDevice, 3748 uInstance, 3749 enmBus, 3750 fUseHostIOCache, 3751 aMediumAttachment, 3752 fForce); 3745 3753 3746 3754 /* release the lock before waiting for a result (EMT will call us back!) */ … … 3778 3786 * 3779 3787 * @param pThis Pointer to the Console object. 3780 * @param p VMThe VM handle.3788 * @param pUVM The VM handle. 3781 3789 * @param pcszDevice The PDM device name. 3782 3790 * @param uInstance The PDM device instance. … … 3793 3801 */ 3794 3802 DECLCALLBACK(int) Console::changeRemovableMedium(Console *pConsole, 3795 P VM pVM,3803 PUVM pUVM, 3796 3804 const char *pcszDevice, 3797 3805 unsigned uInstance, … … 3816 3824 */ 3817 3825 bool fResume; 3818 VMSTATE enmVMState = VMR3GetState (pVM);3826 VMSTATE enmVMState = VMR3GetStateU(pUVM); 3819 3827 switch (enmVMState) 3820 3828 { … … 3825 3833 /* disable the callback to prevent Console-level state change */ 3826 3834 pConsole->mVMStateChangeCallbackDisabled = true; 3827 int rc = VMR3Suspend(p VM);3835 int rc = VMR3Suspend(pUVM); 3828 3836 pConsole->mVMStateChangeCallbackDisabled = false; 3829 3837 AssertRCReturn(rc, rc); … … 3853 3861 /* Determine the base path for the device instance. */ 3854 3862 PCFGMNODE pCtlInst; 3855 pCtlInst = CFGMR3GetChildF(CFGMR3GetRoot (pVM), "Devices/%s/%u/", pcszDevice, uInstance);3863 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%u/", pcszDevice, uInstance); 3856 3864 AssertReturn(pCtlInst, VERR_INTERNAL_ERROR); 3857 3865 … … 3874 3882 fForce /* fForceUnmount */, 3875 3883 false /* fHotplug */, 3876 p VM,3884 pUVM, 3877 3885 NULL /* paLedDevType */); 3878 3886 /** @todo this dumps everything attached to this device instance, which … … 3888 3896 /* disable the callback to prevent Console-level state change */ 3889 3897 pConsole->mVMStateChangeCallbackDisabled = true; 3890 rc = VMR3Resume(p VM);3898 rc = VMR3Resume(pUVM); 3891 3899 pConsole->mVMStateChangeCallbackDisabled = false; 3892 3900 AssertRC(rc); … … 3894 3902 { 3895 3903 /* too bad, we failed. try to sync the console state with the VMM state */ 3896 vmstateChangeCallback( pVM, VMSTATE_SUSPENDED, enmVMState, pConsole);3904 vmstateChangeCallback(VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole); 3897 3905 } 3898 3906 /// @todo (r=dmik) if we failed with drive mount, then the VMR3Resume … … 3914 3922 * 3915 3923 * @param aMediumAttachment The medium attachment which is added. 3916 * @param p VMSafe VM handle.3924 * @param pUVM Safe VM handle. 3917 3925 * 3918 3926 * @note Locks this object for writing. 3919 3927 */ 3920 HRESULT Console::doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, P VM pVM)3928 HRESULT Console::doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM) 3921 3929 { 3922 3930 AutoCaller autoCaller(this); … … 3982 3990 */ 3983 3991 PVMREQ pReq; 3984 int vrc = VMR3ReqCall (pVM,3985 VMCPUID_ANY,3986 &pReq,3987 0 /* no wait! */,3988 VMREQFLAGS_VBOX_STATUS,3989 (PFNRT)Console::attachStorageDevice,3990 7,3991 this,3992 pVM,3993 pszDevice,3994 uInstance,3995 enmBus,3996 fUseHostIOCache,3997 aMediumAttachment);3992 int vrc = VMR3ReqCallU(pUVM, 3993 VMCPUID_ANY, 3994 &pReq, 3995 0 /* no wait! */, 3996 VMREQFLAGS_VBOX_STATUS, 3997 (PFNRT)Console::attachStorageDevice, 3998 7, 3999 this, 4000 pUVM, 4001 pszDevice, 4002 uInstance, 4003 enmBus, 4004 fUseHostIOCache, 4005 aMediumAttachment); 3998 4006 3999 4007 /* release the lock before waiting for a result (EMT will call us back!) */ … … 4032 4040 * 4033 4041 * @param pThis Pointer to the Console object. 4034 * @param p VMThe VM handle.4042 * @param pUVM The VM handle. 4035 4043 * @param pcszDevice The PDM device name. 4036 4044 * @param uInstance The PDM device instance. … … 4039 4047 */ 4040 4048 DECLCALLBACK(int) Console::attachStorageDevice(Console *pConsole, 4041 P VM pVM,4049 PUVM pUVM, 4042 4050 const char *pcszDevice, 4043 4051 unsigned uInstance, … … 4061 4069 */ 4062 4070 bool fResume; 4063 VMSTATE enmVMState = VMR3GetState (pVM);4071 VMSTATE enmVMState = VMR3GetStateU(pUVM); 4064 4072 switch (enmVMState) 4065 4073 { … … 4070 4078 /* disable the callback to prevent Console-level state change */ 4071 4079 pConsole->mVMStateChangeCallbackDisabled = true; 4072 int rc = VMR3Suspend(p VM);4080 int rc = VMR3Suspend(pUVM); 4073 4081 pConsole->mVMStateChangeCallbackDisabled = false; 4074 4082 AssertRCReturn(rc, rc); … … 4098 4106 /* Determine the base path for the device instance. */ 4099 4107 PCFGMNODE pCtlInst; 4100 pCtlInst = CFGMR3GetChildF(CFGMR3GetRoot (pVM), "Devices/%s/%u/", pcszDevice, uInstance);4108 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%u/", pcszDevice, uInstance); 4101 4109 AssertReturn(pCtlInst, VERR_INTERNAL_ERROR); 4102 4110 … … 4119 4127 false /* fForceUnmount */, 4120 4128 true /* fHotplug */, 4121 p VM,4129 pUVM, 4122 4130 NULL /* paLedDevType */); 4123 4131 /** @todo this dumps everything attached to this device instance, which … … 4133 4141 /* disable the callback to prevent Console-level state change */ 4134 4142 pConsole->mVMStateChangeCallbackDisabled = true; 4135 rc = VMR3Resume(p VM);4143 rc = VMR3Resume(pUVM); 4136 4144 pConsole->mVMStateChangeCallbackDisabled = false; 4137 4145 AssertRC(rc); … … 4139 4147 { 4140 4148 /* too bad, we failed. try to sync the console state with the VMM state */ 4141 vmstateChangeCallback( pVM, VMSTATE_SUSPENDED, enmVMState, pConsole);4149 vmstateChangeCallback(VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole); 4142 4150 } 4143 4151 /** @todo: if we failed with drive mount, then the VMR3Resume … … 4159 4167 * 4160 4168 * @param aMediumAttachment The medium attachment which is added. 4161 * @param p VMSafe VM handle.4169 * @param pUVM Safe VM handle. 4162 4170 * 4163 4171 * @note Locks this object for writing. 4164 4172 */ 4165 HRESULT Console::doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, P VM pVM)4173 HRESULT Console::doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM) 4166 4174 { 4167 4175 AutoCaller autoCaller(this); … … 4224 4232 */ 4225 4233 PVMREQ pReq; 4226 int vrc = VMR3ReqCall (pVM,4227 VMCPUID_ANY,4228 &pReq,4229 0 /* no wait! */,4230 VMREQFLAGS_VBOX_STATUS,4231 (PFNRT)Console::detachStorageDevice,4232 6,4233 this,4234 pVM,4235 pszDevice,4236 uInstance,4237 enmBus,4238 aMediumAttachment);4234 int vrc = VMR3ReqCallU(pUVM, 4235 VMCPUID_ANY, 4236 &pReq, 4237 0 /* no wait! */, 4238 VMREQFLAGS_VBOX_STATUS, 4239 (PFNRT)Console::detachStorageDevice, 4240 6, 4241 this, 4242 pUVM, 4243 pszDevice, 4244 uInstance, 4245 enmBus, 4246 aMediumAttachment); 4239 4247 4240 4248 /* release the lock before waiting for a result (EMT will call us back!) */ … … 4272 4280 * 4273 4281 * @param pThis Pointer to the Console object. 4274 * @param p VMThe VM handle.4282 * @param pUVM The VM handle. 4275 4283 * @param pcszDevice The PDM device name. 4276 4284 * @param uInstance The PDM device instance. … … 4279 4287 */ 4280 4288 DECLCALLBACK(int) Console::detachStorageDevice(Console *pConsole, 4281 P VM pVM,4289 PUVM pUVM, 4282 4290 const char *pcszDevice, 4283 4291 unsigned uInstance, … … 4300 4308 */ 4301 4309 bool fResume; 4302 VMSTATE enmVMState = VMR3GetState (pVM);4310 VMSTATE enmVMState = VMR3GetStateU(pUVM); 4303 4311 switch (enmVMState) 4304 4312 { … … 4309 4317 /* disable the callback to prevent Console-level state change */ 4310 4318 pConsole->mVMStateChangeCallbackDisabled = true; 4311 int rc = VMR3Suspend(p VM);4319 int rc = VMR3Suspend(pUVM); 4312 4320 pConsole->mVMStateChangeCallbackDisabled = false; 4313 4321 AssertRCReturn(rc, rc); … … 4337 4345 /* Determine the base path for the device instance. */ 4338 4346 PCFGMNODE pCtlInst; 4339 pCtlInst = CFGMR3GetChildF(CFGMR3GetRoot (pVM), "Devices/%s/%u/", pcszDevice, uInstance);4347 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%u/", pcszDevice, uInstance); 4340 4348 AssertReturn(pCtlInst, VERR_INTERNAL_ERROR); 4341 4349 … … 4363 4371 if (pLunL0) 4364 4372 { 4365 rc = PDMR3DeviceDetach( pVM, pcszDevice, uInstance, uLUN, 0);4373 rc = PDMR3DeviceDetach(VMR3GetVM(pUVM), pcszDevice, uInstance, uLUN, 0); 4366 4374 if (rc == VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN) 4367 4375 rc = VINF_SUCCESS; … … 4386 4394 /* disable the callback to prevent Console-level state change */ 4387 4395 pConsole->mVMStateChangeCallbackDisabled = true; 4388 rc = VMR3Resume(p VM);4396 rc = VMR3Resume(pUVM); 4389 4397 pConsole->mVMStateChangeCallbackDisabled = false; 4390 4398 AssertRC(rc); … … 4392 4400 { 4393 4401 /* too bad, we failed. try to sync the console state with the VMM state */ 4394 vmstateChangeCallback( pVM, VMSTATE_SUSPENDED, enmVMState, pConsole);4402 vmstateChangeCallback(VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole); 4395 4403 } 4396 4404 /** @todo: if we failed with drive mount, then the VMR3Resume … … 4474 4482 if (RT_SUCCESS(vrc) && changeAdapter) 4475 4483 { 4476 VMSTATE enmVMState = VMR3GetState (ptrVM);4484 VMSTATE enmVMState = VMR3GetStateU(ptrVM.rawUVM()); 4477 4485 if ( enmVMState == VMSTATE_RUNNING /** @todo LiveMigration: Forbid or deal correctly with the _LS variants */ 4478 4486 || enmVMState == VMSTATE_SUSPENDED) … … 4484 4492 } 4485 4493 4486 rc = doNetworkAdapterChange(ptrVM , pszAdapterName, ulInstance, 0, aNetworkAdapter);4494 rc = doNetworkAdapterChange(ptrVM.rawUVM(), pszAdapterName, ulInstance, 0, aNetworkAdapter); 4487 4495 4488 4496 if (fTraceEnabled && fCableConnected && pINetCfg) … … 4615 4623 * @returns COM status code. 4616 4624 * 4617 * @parma p VMThe VM handle (caller hold this safely).4625 * @parma pUVM The VM handle (caller hold this safely). 4618 4626 * @param pszDevice The PDM device name. 4619 4627 * @param uInstance The PDM device instance. … … 4621 4629 * @param aNetworkAdapter The network adapter whose attachment needs to be changed 4622 4630 */ 4623 HRESULT Console::doNetworkAdapterChange(P VM pVM,4631 HRESULT Console::doNetworkAdapterChange(PUVM pUVM, 4624 4632 const char *pszDevice, 4625 4633 unsigned uInstance, … … 4632 4640 AutoCaller autoCaller(this); 4633 4641 AssertComRCReturnRC(autoCaller.rc()); 4634 4635 /* Get the VM handle. */4636 SafeVMPtr ptrVM(this);4637 if (!ptrVM.isOk())4638 return ptrVM.rc();4639 4642 4640 4643 /* … … 4644 4647 */ 4645 4648 PVMREQ pReq; 4646 int vrc = VMR3ReqCall (pVM, 0 /*idDstCpu*/, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS,4647 (PFNRT)Console::changeNetworkAttachment, 6,4648 this, ptrVM.raw(), pszDevice, uInstance, uLun, aNetworkAdapter);4649 int vrc = VMR3ReqCallU(pUVM, 0 /*idDstCpu*/, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 4650 (PFNRT)Console::changeNetworkAttachment, 6, 4651 this, pUVM, pszDevice, uInstance, uLun, aNetworkAdapter); 4649 4652 4650 4653 if (vrc == VERR_TIMEOUT || RT_SUCCESS(vrc)) … … 4675 4678 * 4676 4679 * @param pThis Pointer to the Console object. 4677 * @param p VMThe VM handle.4680 * @param pUVM The VM handle. 4678 4681 * @param pszDevice The PDM device name. 4679 4682 * @param uInstance The PDM device instance. … … 4685 4688 */ 4686 4689 DECLCALLBACK(int) Console::changeNetworkAttachment(Console *pThis, 4687 P VM pVM,4690 PUVM pUVM, 4688 4691 const char *pszDevice, 4689 4692 unsigned uInstance, … … 4724 4727 */ 4725 4728 bool fResume; 4726 VMSTATE enmVMState = VMR3GetState (pVM);4729 VMSTATE enmVMState = VMR3GetStateU(pUVM); 4727 4730 switch (enmVMState) 4728 4731 { … … 4733 4736 /* disable the callback to prevent Console-level state change */ 4734 4737 pThis->mVMStateChangeCallbackDisabled = true; 4735 int rc = VMR3Suspend(p VM);4738 int rc = VMR3Suspend(pUVM); 4736 4739 pThis->mVMStateChangeCallbackDisabled = false; 4737 4740 AssertRCReturn(rc, rc); … … 4755 4758 PCFGMNODE pCfg = NULL; /* /Devices/Dev/.../Config/ */ 4756 4759 PCFGMNODE pLunL0 = NULL; /* /Devices/Dev/0/LUN#0/ */ 4757 PCFGMNODE pInst = CFGMR3GetChildF(CFGMR3GetRoot (pVM), "Devices/%s/%d/", pszDevice, uInstance);4760 PCFGMNODE pInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%d/", pszDevice, uInstance); 4758 4761 AssertRelease(pInst); 4759 4762 … … 4769 4772 /* disable the callback to prevent Console-level state change */ 4770 4773 pThis->mVMStateChangeCallbackDisabled = true; 4771 rc = VMR3Resume(p VM);4774 rc = VMR3Resume(pUVM); 4772 4775 pThis->mVMStateChangeCallbackDisabled = false; 4773 4776 AssertRC(rc); … … 4775 4778 { 4776 4779 /* too bad, we failed. try to sync the console state with the VMM state */ 4777 vmstateChangeCallback( pVM, VMSTATE_SUSPENDED, enmVMState, pThis);4780 vmstateChangeCallback(VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pThis); 4778 4781 } 4779 4782 /// @todo (r=dmik) if we failed with drive mount, then the VMR3Resume … … 4855 4858 if (ptrVM.isOk()) 4856 4859 { 4857 rc = doMediumChange(aMediumAttachment, !!aForce, ptrVM );4860 rc = doMediumChange(aMediumAttachment, !!aForce, ptrVM.rawUVM()); 4858 4861 ptrVM.release(); 4859 4862 } … … 4926 4929 { 4927 4930 /* No need to call in the EMT thread. */ 4928 rc = VMR3SetCpuExecutionCap(ptrVM , aExecutionCap);4931 rc = VMR3SetCpuExecutionCap(ptrVM.rawUVM(), aExecutionCap); 4929 4932 } 4930 4933 else … … 5389 5392 { 5390 5393 if (aRemove) 5391 rc = doStorageDeviceDetach(aMediumAttachment, ptrVM );5394 rc = doStorageDeviceDetach(aMediumAttachment, ptrVM.rawUVM()); 5392 5395 else 5393 rc = doStorageDeviceAttach(aMediumAttachment, ptrVM );5396 rc = doStorageDeviceAttach(aMediumAttachment, ptrVM.rawUVM()); 5394 5397 ptrVM.release(); 5395 5398 } … … 5712 5715 5713 5716 /* Pause the VM, as it might have pending IO on this drive */ 5714 VMSTATE enmVMState = VMR3GetState (ptrVM);5717 VMSTATE enmVMState = VMR3GetStateU(ptrVM.rawUVM()); 5715 5718 if (mMachineState == MachineState_DeletingSnapshotOnline) 5716 5719 { … … 5718 5721 /* disable the callback to prevent Console-level state change */ 5719 5722 mVMStateChangeCallbackDisabled = true; 5720 int vrc2 = VMR3Suspend(ptrVM );5723 int vrc2 = VMR3Suspend(ptrVM.rawUVM()); 5721 5724 mVMStateChangeCallbackDisabled = false; 5722 5725 AssertRCReturn(vrc2, E_FAIL); 5723 5726 } 5724 5727 5725 vrc = VMR3ReqCallWait (ptrVM,5726 VMCPUID_ANY,5727 (PFNRT)reconfigureMediumAttachment,5728 13,5729 this,5730 ptrVM.raw(),5731 pcszDevice,5732 uInstance,5733 enmBus,5734 fUseHostIOCache,5735 fBuiltinIOCache,5736 true /* fSetupMerge */,5737 aSourceIdx,5738 aTargetIdx,5739 aMediumAttachment,5740 mMachineState,5741 &rc);5728 vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), 5729 VMCPUID_ANY, 5730 (PFNRT)reconfigureMediumAttachment, 5731 13, 5732 this, 5733 ptrVM.rawUVM(), 5734 pcszDevice, 5735 uInstance, 5736 enmBus, 5737 fUseHostIOCache, 5738 fBuiltinIOCache, 5739 true /* fSetupMerge */, 5740 aSourceIdx, 5741 aTargetIdx, 5742 aMediumAttachment, 5743 mMachineState, 5744 &rc); 5742 5745 /* error handling is after resuming the VM */ 5743 5746 … … 5747 5750 /* disable the callback to prevent Console-level state change */ 5748 5751 mVMStateChangeCallbackDisabled = true; 5749 int vrc2 = VMR3Resume(ptrVM );5752 int vrc2 = VMR3Resume(ptrVM.rawUVM()); 5750 5753 mVMStateChangeCallbackDisabled = false; 5751 5754 if (RT_FAILURE(vrc2)) … … 5783 5786 5784 5787 /* Pause the VM, as it might have pending IO on this drive */ 5785 enmVMState = VMR3GetState (ptrVM);5788 enmVMState = VMR3GetStateU(ptrVM.rawUVM()); 5786 5789 if (mMachineState == MachineState_DeletingSnapshotOnline) 5787 5790 { … … 5789 5792 /* disable the callback to prevent Console-level state change */ 5790 5793 mVMStateChangeCallbackDisabled = true; 5791 int vrc2 = VMR3Suspend(ptrVM );5794 int vrc2 = VMR3Suspend(ptrVM.rawUVM()); 5792 5795 mVMStateChangeCallbackDisabled = false; 5793 5796 AssertRCReturn(vrc2, E_FAIL); … … 5799 5802 ComSafeArrayInArg(aChildrenToReparent)); 5800 5803 5801 vrc = VMR3ReqCallWait (ptrVM,5802 VMCPUID_ANY,5803 (PFNRT)reconfigureMediumAttachment,5804 13,5805 this,5806 ptrVM.raw(),5807 pcszDevice,5808 uInstance,5809 enmBus,5810 fUseHostIOCache,5811 fBuiltinIOCache,5812 false /* fSetupMerge */,5813 0 /* uMergeSource */,5814 0 /* uMergeTarget */,5815 aMediumAttachment,5816 mMachineState,5817 &rc);5804 vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), 5805 VMCPUID_ANY, 5806 (PFNRT)reconfigureMediumAttachment, 5807 13, 5808 this, 5809 ptrVM.rawUVM(), 5810 pcszDevice, 5811 uInstance, 5812 enmBus, 5813 fUseHostIOCache, 5814 fBuiltinIOCache, 5815 false /* fSetupMerge */, 5816 0 /* uMergeSource */, 5817 0 /* uMergeTarget */, 5818 aMediumAttachment, 5819 mMachineState, 5820 &rc); 5818 5821 /* error handling is after resuming the VM */ 5819 5822 … … 5823 5826 /* disable the callback to prevent Console-level state change */ 5824 5827 mVMStateChangeCallbackDisabled = true; 5825 int vrc2 = VMR3Resume(ptrVM );5828 int vrc2 = VMR3Resume(ptrVM.rawUVM()); 5826 5829 mVMStateChangeCallbackDisabled = false; 5827 5830 AssertRC(vrc2); … … 6198 6201 return a_Quiet 6199 6202 ? E_ACCESSDENIED 6200 : setError(E_ACCESSDENIED, tr("The virtual machine is waspowered off"));6203 : setError(E_ACCESSDENIED, tr("The virtual machine is powered off")); 6201 6204 6202 6205 /* … … 6207 6210 return a_Quiet 6208 6211 ? E_ACCESSDENIED 6209 : setError(E_ACCESSDENIED, tr("The virtual machine is waspowered off"));6212 : setError(E_ACCESSDENIED, tr("The virtual machine is powered off")); 6210 6213 6211 6214 PVM pVM = VMR3GetVM(pUVM); … … 6215 6218 return a_Quiet 6216 6219 ? E_ACCESSDENIED 6217 : setError(E_ACCESSDENIED, tr("The virtual machine is waspowered off"));6220 : setError(E_ACCESSDENIED, tr("The virtual machine is powered off")); 6218 6221 } 6219 6222 … … 6936 6939 LogFlowThisFunc(("Powering off the VM...\n")); 6937 6940 alock.release(); 6938 vrc = VMR3PowerOff( VMR3GetVM(pUVM));6941 vrc = VMR3PowerOff(pUVM); 6939 6942 #ifdef VBOX_WITH_EXTPACK 6940 6943 mptrExtPackManager->callAllVmPowerOffHooks(this, VMR3GetVM(pUVM)); … … 7004 7007 alock.release(); 7005 7008 7006 vrc = VMR3Destroy( VMR3GetVM(pUVM));7009 vrc = VMR3Destroy(pUVM); 7007 7010 7008 7011 /* take the lock again */ … … 7958 7961 Assert(portVersion == 1 || portVersion == 2); 7959 7962 7960 int vrc = VMR3ReqCallWait(ptrVM, 0 /* idDstCpu (saved state, see #6232) */, 7961 (PFNRT)usbAttachCallback, 9, 7962 this, ptrVM.raw(), aHostDevice, uuid.raw(), fRemote, Address.c_str(), pvRemoteBackend, portVersion, aMaskedIfs); 7963 int vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), 0 /* idDstCpu (saved state, see #6232) */, 7964 (PFNRT)usbAttachCallback, 9, 7965 this, ptrVM.rawUVM(), aHostDevice, uuid.raw(), fRemote, 7966 Address.c_str(), pvRemoteBackend, portVersion, aMaskedIfs); 7963 7967 7964 7968 if (RT_SUCCESS(vrc)) … … 7986 7990 { 7987 7991 case VERR_VUSB_NO_PORTS: 7988 hrc = setError(E_FAIL, 7989 tr("Failed to attach the USB device. (No available ports on the USB controller).")); 7992 hrc = setError(E_FAIL, tr("Failed to attach the USB device. (No available ports on the USB controller).")); 7990 7993 break; 7991 7994 case VERR_VUSB_USBFS_PERMISSION: 7992 hrc = setError(E_FAIL, 7993 tr("Not permitted to open the USB device, check usbfs options")); 7995 hrc = setError(E_FAIL, tr("Not permitted to open the USB device, check usbfs options")); 7994 7996 break; 7995 7997 default: 7996 hrc = setError(E_FAIL, 7997 tr("Failed to create a proxy device for the USB device. (Error: %Rrc)"), 7998 vrc); 7998 hrc = setError(E_FAIL, tr("Failed to create a proxy device for the USB device. (Error: %Rrc)"), vrc); 7999 7999 break; 8000 8000 } … … 8015 8015 //static 8016 8016 DECLCALLBACK(int) 8017 Console::usbAttachCallback(Console *that, PVM pVM, IUSBDevice *aHostDevice, PCRTUUID aUuid, bool aRemote, const char *aAddress, void *pvRemoteBackend, USHORT aPortVersion, ULONG aMaskedIfs) 8017 Console::usbAttachCallback(Console *that, PUVM pUVM, IUSBDevice *aHostDevice, PCRTUUID aUuid, bool aRemote, 8018 const char *aAddress, void *pvRemoteBackend, USHORT aPortVersion, ULONG aMaskedIfs) 8018 8019 { 8019 8020 LogFlowFuncEnter(); … … 8023 8024 AssertReturn(!that->isWriteLockOnCurrentThread(), VERR_GENERAL_FAILURE); 8024 8025 8025 int vrc = PDMR3USBCreateProxyDevice( pVM, aUuid, aRemote, aAddress, pvRemoteBackend,8026 int vrc = PDMR3USBCreateProxyDevice(VMR3GetVM(pUVM), aUuid, aRemote, aAddress, pvRemoteBackend, 8026 8027 aPortVersion == 1 ? VUSB_STDVER_11 : VUSB_STDVER_20, aMaskedIfs); 8027 8028 LogFlowFunc(("vrc=%Rrc\n", vrc)); … … 8073 8074 8074 8075 alock.release(); 8075 int vrc = VMR3ReqCallWait (ptrVM, 0 /* idDstCpu (saved state, see #6232) */,8076 (PFNRT)usbDetachCallback, 5,8077 this, ptrVM.raw(), pUuid);8076 int vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), 0 /* idDstCpu (saved state, see #6232) */, 8077 (PFNRT)usbDetachCallback, 5, 8078 this, ptrVM.rawUVM(), pUuid); 8078 8079 if (RT_SUCCESS(vrc)) 8079 8080 { … … 8091 8092 /** 8092 8093 * USB device detach callback used by DetachUSBDevice(). 8094 * 8093 8095 * Note that DetachUSBDevice() doesn't return until this callback is executed, 8094 8096 * so we don't use AutoCaller and don't care about reference counters of … … 8099 8101 //static 8100 8102 DECLCALLBACK(int) 8101 Console::usbDetachCallback(Console *that, P VM pVM, PCRTUUID aUuid)8103 Console::usbDetachCallback(Console *that, PUVM pUVM, PCRTUUID aUuid) 8102 8104 { 8103 8105 LogFlowFuncEnter(); … … 8107 8109 AssertReturn(!that->isWriteLockOnCurrentThread(), VERR_GENERAL_FAILURE); 8108 8110 8109 int vrc = PDMR3USBDetachDevice( pVM, aUuid);8111 int vrc = PDMR3USBDetachDevice(VMR3GetVM(pUVM), aUuid); 8110 8112 8111 8113 LogFlowFunc(("vrc=%Rrc\n", vrc)); … … 8493 8495 * Called at VM startup. 8494 8496 * 8495 * @param p VMThe VM handle.8497 * @param pUVM The VM handle. 8496 8498 */ 8497 HRESULT Console::captureUSBDevices(P VM pVM)8499 HRESULT Console::captureUSBDevices(PUVM pUVM) 8498 8500 { 8499 8501 LogFlowThisFunc(("\n")); … … 8506 8508 * capture devices */ 8507 8509 PPDMIBASE pBase; 8508 int vrc = PDMR3QueryLun( pVM, "usb-ohci", 0, 0, &pBase);8510 int vrc = PDMR3QueryLun(VMR3GetVM(pUVM), "usb-ohci", 0, 0, &pBase); 8509 8511 if (RT_SUCCESS(vrc)) 8510 8512 { … … 8871 8873 /* 8872 8874 * Create the VM 8873 */ 8874 PVM pVM; 8875 /* 8876 * release the lock since EMT will call Console. It's safe because 8877 * mMachineState is either Starting or Restoring state here. 8875 * 8876 * Note! Release the lock since EMT will call Console. It's safe because 8877 * mMachineState is either Starting or Restoring state here. 8878 8878 */ 8879 8879 alock.release(); 8880 8880 8881 PVM pVM; 8881 8882 vrc = VMR3Create(cCpus, 8882 8883 pConsole->mpVmm2UserMethods, … … 8885 8886 task->mConfigConstructor, 8886 8887 static_cast<Console *>(pConsole), 8887 &pVM );8888 &pVM, NULL); 8888 8889 8889 8890 alock.acquire(); … … 8955 8956 * Capture USB devices. 8956 8957 */ 8957 rc = pConsole->captureUSBDevices(pVM); 8958 if (FAILED(rc)) break; 8958 rc = pConsole->captureUSBDevices(pConsole->mpUVM); 8959 if (FAILED(rc)) 8960 break; 8959 8961 8960 8962 /* Load saved state? */ … … 8964 8966 task->mSavedStateFile.c_str())); 8965 8967 8966 vrc = VMR3LoadFromFile(p VM,8968 vrc = VMR3LoadFromFile(pConsole->mpUVM, 8967 8969 task->mSavedStateFile.c_str(), 8968 8970 Console::stateProgressCallback, … … 8981 8983 #endif 8982 8984 if (RT_SUCCESS(vrc)) 8983 vrc = VMR3Resume(p VM);8985 vrc = VMR3Resume(pConsole->mpUVM); 8984 8986 AssertLogRelRC(vrc); 8985 8987 } … … 8989 8991 if (RT_FAILURE(vrc)) 8990 8992 { 8991 int vrc2 = VMR3PowerOff(p VM); AssertLogRelRC(vrc2);8993 int vrc2 = VMR3PowerOff(pConsole->mpUVM); AssertLogRelRC(vrc2); 8992 8994 #ifdef VBOX_WITH_EXTPACK 8993 8995 pConsole->mptrExtPackManager->callAllVmPowerOffHooks(pConsole, pVM); … … 8999 9001 /* -> ConsoleImplTeleporter.cpp */ 9000 9002 bool fPowerOffOnFailure; 9001 rc = pConsole->teleporterTrg( VMR3GetUVM(pVM), pMachine, &task->mErrorMsg, task->mStartPaused,9003 rc = pConsole->teleporterTrg(pConsole->mpUVM, pMachine, &task->mErrorMsg, task->mStartPaused, 9002 9004 task->mProgress, &fPowerOffOnFailure); 9003 9005 if (FAILED(rc) && fPowerOffOnFailure) 9004 9006 { 9005 9007 ErrorInfoKeeper eik; 9006 int vrc2 = VMR3PowerOff(p VM); AssertLogRelRC(vrc2);9008 int vrc2 = VMR3PowerOff(pConsole->mpUVM); AssertLogRelRC(vrc2); 9007 9009 #ifdef VBOX_WITH_EXTPACK 9008 9010 pConsole->mptrExtPackManager->callAllVmPowerOffHooks(pConsole, pVM); … … 9065 9067 #endif 9066 9068 if (RT_SUCCESS(vrc)) 9067 vrc = VMR3PowerOn(p VM);9069 vrc = VMR3PowerOn(pConsole->mpUVM); 9068 9070 AssertLogRelRC(vrc); 9069 9071 } … … 9095 9097 */ 9096 9098 alock.release(); 9097 VMR3AtErrorDeregister(p VM, Console::genericVMSetErrorCallback, &task->mErrorMsg);9099 VMR3AtErrorDeregister(pConsole->mpUVM, Console::genericVMSetErrorCallback, &task->mErrorMsg); 9098 9100 /** @todo register another VMSetError callback? */ 9099 9101 alock.acquire(); … … 9196 9198 * 9197 9199 * @param pConsole Reference to the console object. 9198 * @param p VMThe VM handle.9200 * @param pUVM The VM handle. 9199 9201 * @param lInstance The instance of the controller. 9200 9202 * @param pcszDevice The name of the controller type. … … 9210 9212 /* static */ 9211 9213 DECLCALLBACK(int) Console::reconfigureMediumAttachment(Console *pConsole, 9212 P VM pVM,9214 PUVM pUVM, 9213 9215 const char *pcszDevice, 9214 9216 unsigned uInstance, … … 9223 9225 HRESULT *phrc) 9224 9226 { 9225 LogFlowFunc(("p VM=%p aMediumAtt=%p phrc=%p\n", pVM, aMediumAtt, phrc));9227 LogFlowFunc(("pUVM=%p aMediumAtt=%p phrc=%p\n", pUVM, aMediumAtt, phrc)); 9226 9228 9227 9229 int rc; … … 9241 9243 /* Determine the base path for the device instance. */ 9242 9244 PCFGMNODE pCtlInst; 9243 pCtlInst = CFGMR3GetChildF(CFGMR3GetRoot (pVM), "Devices/%s/%u/", pcszDevice, uInstance);9245 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%u/", pcszDevice, uInstance); 9244 9246 AssertReturn(pCtlInst, VERR_INTERNAL_ERROR); 9245 9247 … … 9260 9262 false /* fForceUnmount */, 9261 9263 false /* fHotplug */, 9262 p VM,9264 pUVM, 9263 9265 NULL /* paLedDevType */); 9264 9266 /** @todo this dumps everything attached to this device instance, which … … 9368 9370 alock.release(); 9369 9371 LogFlowFunc(("VMR3Save...\n")); 9370 vrc = VMR3Save(ptrVM ,9372 vrc = VMR3Save(ptrVM.rawUVM(), 9371 9373 strSavedStateFile.c_str(), 9372 9374 true /*fContinueAfterwards*/, … … 9449 9451 * isn't going to need the Console lock. 9450 9452 */ 9451 vrc = VMR3ReqCallWait (ptrVM,9452 VMCPUID_ANY,9453 (PFNRT)reconfigureMediumAttachment,9454 13,9455 that,9456 ptrVM.raw(),9457 pcszDevice,9458 lInstance,9459 enmBus,9460 fUseHostIOCache,9461 fBuiltinIOCache,9462 false /* fSetupMerge */,9463 0 /* uMergeSource */,9464 0 /* uMergeTarget */,9465 atts[i],9466 that->mMachineState,9467 &rc);9453 vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), 9454 VMCPUID_ANY, 9455 (PFNRT)reconfigureMediumAttachment, 9456 13, 9457 that, 9458 ptrVM.rawUVM(), 9459 pcszDevice, 9460 lInstance, 9461 enmBus, 9462 fUseHostIOCache, 9463 fBuiltinIOCache, 9464 false /* fSetupMerge */, 9465 0 /* uMergeSource */, 9466 0 /* uMergeTarget */, 9467 atts[i], 9468 that->mMachineState, 9469 &rc); 9468 9470 if (RT_FAILURE(vrc)) 9469 9471 throw setErrorStatic(E_FAIL, Console::tr("%Rrc"), vrc); … … 9522 9524 SafeVMPtr ptrVM(that); 9523 9525 alock.release(); 9524 int vrc = VMR3Resume(ptrVM );9526 int vrc = VMR3Resume(ptrVM.rawUVM()); 9525 9527 alock.acquire(); 9526 9528 if (RT_FAILURE(vrc)) … … 9580 9582 SafeVMPtr ptrVM(that); 9581 9583 alock.release(); 9582 int vrc = VMR3Resume(ptrVM ); AssertLogRelRC(vrc);9584 int vrc = VMR3Resume(ptrVM.rawUVM()); AssertLogRelRC(vrc); 9583 9585 alock.acquire(); 9584 9586 if (RT_FAILURE(vrc)) … … 9640 9642 9641 9643 bool fSuspenededBySave; 9642 int vrc = VMR3Save(task->mp VM,9644 int vrc = VMR3Save(task->mpUVM, 9643 9645 task->mSavedStateFile.c_str(), 9644 9646 false, /*fContinueAfterwards*/ -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r44191 r44340 707 707 int Console::configConstructorInner(PVM pVM, AutoWriteLock *pAlock) 708 708 { 709 VMMDev *pVMMDev = m_pVMMDev; 710 Assert(pVMMDev); 711 709 PUVM pUVM = VMR3GetUVM(pVM); 710 VMMDev *pVMMDev = m_pVMMDev; Assert(pVMMDev); 712 711 ComPtr<IMachine> pMachine = machine(); 713 712 … … 1795 1794 false /* fForceUnmount */, 1796 1795 false /* fHotplug */, 1797 p VM,1796 pUVM, 1798 1797 paLedDevType); 1799 1798 if (RT_FAILURE(rc)) … … 2659 2658 */ 2660 2659 2661 rc = configGuestProperties(this, p VM);2660 rc = configGuestProperties(this, pUVM); 2662 2661 #endif /* VBOX_WITH_GUEST_PROPS defined */ 2663 2662 … … 2835 2834 * Register VM state change handler. 2836 2835 */ 2837 int rc2 = VMR3AtStateRegister(p VM, Console::vmstateChangeCallback, this);2836 int rc2 = VMR3AtStateRegister(pUVM, Console::vmstateChangeCallback, this); 2838 2837 AssertRC(rc2); 2839 2838 if (RT_SUCCESS(rc)) … … 2843 2842 * Register VM runtime error handler. 2844 2843 */ 2845 rc2 = VMR3AtRuntimeErrorRegister(p VM, Console::setVMRuntimeErrorCallback, this);2844 rc2 = VMR3AtRuntimeErrorRegister(pUVM, Console::setVMRuntimeErrorCallback, this); 2846 2845 AssertRC(rc2); 2847 2846 if (RT_SUCCESS(rc)) … … 3120 3119 bool fForceUnmount, 3121 3120 bool fHotplug, 3122 P VM pVM,3121 PUVM pUVM, 3123 3122 DeviceType_T *paLedDevType) 3124 3123 { … … 3158 3157 /* Unmount existing media only for floppy and DVD drives. */ 3159 3158 PPDMIBASE pBase; 3160 rc = PDMR3QueryLun( pVM, pcszDevice, uInstance, uLUN, &pBase);3159 rc = PDMR3QueryLun(VMR3GetVM(pUVM), pcszDevice, uInstance, uLUN, &pBase); 3161 3160 if (RT_FAILURE(rc)) 3162 3161 { … … 3180 3179 } 3181 3180 3182 rc = PDMR3DeviceDetach( pVM, pcszDevice, uInstance, uLUN, fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG);3181 rc = PDMR3DeviceDetach(VMR3GetVM(pUVM), pcszDevice, uInstance, uLUN, fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG); 3183 3182 if (rc == VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN) 3184 3183 rc = VINF_SUCCESS; … … 3284 3283 const char *pszUnit; 3285 3284 uint64_t u64Print = formatDiskSize((uint64_t)i64Size, &pszUnit); 3286 setVMRuntimeErrorCallbackF( pVM, this, 0,3285 setVMRuntimeErrorCallbackF(VMR3GetVM(pUVM), this, 0, 3287 3286 "FatPartitionDetected", 3288 3287 N_("The medium '%ls' has a logical size of %RU64%s " … … 3316 3315 uint64_t u64PrintSiz = formatDiskSize((LONG64)i64Size, &pszUnitSiz); 3317 3316 uint64_t u64PrintMax = formatDiskSize(maxSize, &pszUnitMax); 3318 setVMRuntimeErrorCallbackF( pVM, this, 0,3317 setVMRuntimeErrorCallbackF(VMR3GetVM(pUVM), this, 0, 3319 3318 "FatPartitionDetected", /* <= not exact but ... */ 3320 3319 N_("The medium '%ls' has a logical size of %RU64%s " … … 3340 3339 const char *pszUnit; 3341 3340 uint64_t u64Print = formatDiskSize(i64Size, &pszUnit); 3342 setVMRuntimeErrorCallbackF( pVM, this, 0,3341 setVMRuntimeErrorCallbackF(VMR3GetVM(pUVM), this, 0, 3343 3342 "FatPartitionDetected", 3344 3343 #ifdef RT_OS_WINDOWS … … 3382 3381 || enmFsTypeFile == RTFSTYPE_XFS) 3383 3382 { 3384 setVMRuntimeErrorCallbackF( pVM, this, 0,3383 setVMRuntimeErrorCallbackF(VMR3GetVM(pUVM), this, 0, 3385 3384 "Ext4PartitionDetected", 3386 3385 N_("The host I/O cache for at least one controller is disabled " … … 3400 3399 && !mfSnapshotFolderExt4WarningShown) 3401 3400 { 3402 setVMRuntimeErrorCallbackF( pVM, this, 0,3401 setVMRuntimeErrorCallbackF(VMR3GetVM(pUVM), this, 0, 3403 3402 "Ext4PartitionDetected", 3404 3403 N_("The host I/O cache for at least one controller is disabled " … … 3475 3474 { 3476 3475 /* Attach the new driver. */ 3477 rc = PDMR3DeviceAttach( pVM, pcszDevice, uInstance, uLUN,3478 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/);3476 rc = PDMR3DeviceAttach(VMR3GetVM(pUVM), pcszDevice, uInstance, uLUN, 3477 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/); 3479 3478 AssertRCReturn(rc, rc); 3480 3479 … … 3849 3848 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3850 3849 3851 PVM pVM = VMR3GetVM(mpUVM); /* We're on an EMT, so this is safe. */3852 3853 3850 ComPtr<IMachine> pMachine = machine(); 3854 3851 … … 3875 3872 if (fAttachDetach) 3876 3873 { 3877 rc = PDMR3DeviceDetach( pVM, pszDevice, uInstance, uLun, 0 /*fFlags*/);3874 rc = PDMR3DeviceDetach(VMR3GetVM(mpUVM), pszDevice, uInstance, uLun, 0 /*fFlags*/); 3878 3875 if (rc == VINF_PDM_NO_DRIVER_ATTACHED_TO_LUN) 3879 3876 rc = VINF_SUCCESS; … … 4081 4078 { 4082 4079 case VERR_ACCESS_DENIED: 4083 return VMSetError( pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(4080 return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( 4084 4081 "Failed to open '/dev/net/tun' for read/write access. Please check the " 4085 4082 "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or " … … 4089 4086 default: 4090 4087 AssertMsgFailed(("Could not attach to host interface! Bad!\n")); 4091 return VMSetError( pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(4088 return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( 4092 4089 "Failed to initialize Host Interface Networking")); 4093 4090 } … … 4132 4129 // * hrc = aNetworkAdapter->Detach(); H(); 4133 4130 // */ 4134 // return VMSetError( pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,4131 // return VMSetError(VMR3GetVM(mpUVM), VERR_INTERNAL_ERROR, RT_SRC_POS, 4135 4132 // N_("Malformed host interface networking name '%ls'"), 4136 4133 // BridgedIfName.raw()); … … 4168 4165 { 4169 4166 AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: FindByName failed, rc=%Rhrc (0x%x)", hrc, hrc)); 4170 return VMSetError( pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,4167 return VMSetError(VMR3GetVM(mpUVM), VERR_INTERNAL_ERROR, RT_SRC_POS, 4171 4168 N_("Nonexistent host networking interface, name '%ls'"), 4172 4169 BridgedIfName.raw()); … … 4183 4180 if (eIfType != HostNetworkInterfaceType_Bridged) 4184 4181 { 4185 return VMSetError( pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,4182 return VMSetError(VMR3GetVM(mpUVM), VERR_INTERNAL_ERROR, RT_SRC_POS, 4186 4183 N_("Interface ('%ls') is not a Bridged Adapter interface"), 4187 4184 BridgedIfName.raw()); … … 4280 4277 { 4281 4278 case VERR_ACCESS_DENIED: 4282 return VMSetError( pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(4279 return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( 4283 4280 "Failed to open '/dev/%s' for read/write access. Please check the " 4284 4281 "permissions of that node, and that the net.link.tap.user_open " … … 4288 4285 default: 4289 4286 AssertMsgFailed(("Could not attach to tap interface! Bad!\n")); 4290 return VMSetError( pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(4287 return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( 4291 4288 "Failed to initialize Host Interface Networking")); 4292 4289 } … … 4316 4313 if (ioctl(iSock, SIOCGIFFLAGS, &Req) >= 0) 4317 4314 if ((Req.ifr_flags & IFF_UP) == 0) 4318 setVMRuntimeErrorCallbackF( pVM, this, 0, "BridgedInterfaceDown",4315 setVMRuntimeErrorCallbackF(VMR3GetVM(mpUVM), this, 0, "BridgedInterfaceDown", 4319 4316 "Bridged interface %s is down. Guest will not be able to use this interface", 4320 4317 pszBridgedIfName); … … 4539 4536 { 4540 4537 LogRel(("NetworkAttachmentType_HostOnly: FindByName failed, rc (0x%x)\n", rc)); 4541 return VMSetError( pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,4538 return VMSetError(VMR3GetVM(mpUVM), VERR_INTERNAL_ERROR, RT_SRC_POS, 4542 4539 N_("Nonexistent host networking interface, name '%ls'"), 4543 4540 HostOnlyName.raw()); … … 4564 4561 4565 4562 if (eIfType != HostNetworkInterfaceType_HostOnly) 4566 return VMSetError( pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,4563 return VMSetError(VMR3GetVM(mpUVM), VERR_INTERNAL_ERROR, RT_SRC_POS, 4567 4564 N_("Interface ('%ls') is not a Host-Only Adapter interface"), 4568 4565 HostOnlyName.raw()); … … 4763 4760 if (fAttachDetach) 4764 4761 { 4765 rc = PDMR3DriverAttach( pVM, pszDevice, uInstance, uLun, 0 /*fFlags*/, NULL /* ppBase */);4762 rc = PDMR3DriverAttach(VMR3GetVM(mpUVM), pszDevice, uInstance, uLun, 0 /*fFlags*/, NULL /* ppBase */); 4766 4763 //AssertRC(rc); 4767 4764 } … … 4915 4912 * the machine XML and set a couple of initial properties. 4916 4913 */ 4917 /* static */ int Console::configGuestProperties(void *pvConsole, P VM pVM)4914 /* static */ int Console::configGuestProperties(void *pvConsole, PUVM pUVM) 4918 4915 { 4919 4916 #ifdef VBOX_WITH_GUEST_PROPS … … 4947 4944 PFNDBGFHANDLEREXT pfnHandler = (PFNDBGFHANDLEREXT)(uintptr_t)Params[0].u.pointer.addr; 4948 4945 void *pService = (void*)Params[1].u.pointer.addr; 4949 DBGFR3InfoRegisterExternal( pVM, "guestprops", "Display the guest properties", pfnHandler, pService);4946 DBGFR3InfoRegisterExternal(VMR3GetVM(pUVM), "guestprops", "Display the guest properties", pfnHandler, pService); 4950 4947 } 4951 4948 } -
trunk/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
r40257 r44340 686 686 RTSocketRetain(pState->mhSocket); 687 687 void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(pState)); 688 vrc = VMR3Teleport( VMR3GetVM(pState->mpUVM),688 vrc = VMR3Teleport(pState->mpUVM, 689 689 pState->mcMsMaxDowntime, 690 690 &g_teleporterTcpOps, pvUser, … … 887 887 { 888 888 autoLock.release(); 889 int rc = VMR3Resume( VMR3GetVM(pState->mpUVM));889 int rc = VMR3Resume(pState->mpUVM); 890 890 AssertLogRelMsgRC(rc, ("VMR3Resume -> %Rrc\n", rc)); 891 891 autoLock.acquire(); … … 1338 1338 break; 1339 1339 1340 int vrc2 = VMR3AtErrorRegister U(pState->mpUVM,1341 1340 int vrc2 = VMR3AtErrorRegister(pState->mpUVM, 1341 Console::genericVMSetErrorCallback, &pState->mErrorText); AssertRC(vrc2); 1342 1342 RTSocketRetain(pState->mhSocket); /* For concurrent access by I/O thread and EMT. */ 1343 1343 pState->moffStream = 0; 1344 1344 1345 1345 void *pvUser2 = static_cast<void *>(static_cast<TeleporterState *>(pState)); 1346 vrc = VMR3LoadFromStream( VMR3GetVM(pState->mpUVM),1346 vrc = VMR3LoadFromStream(pState->mpUVM, 1347 1347 &g_teleporterTcpOps, pvUser2, 1348 1348 teleporterProgressCallback, pvUser2); 1349 1349 1350 1350 RTSocketRelease(pState->mhSocket); 1351 vrc2 = VMR3AtErrorDeregister( VMR3GetVM(pState->mpUVM), Console::genericVMSetErrorCallback, &pState->mErrorText); AssertRC(vrc2);1351 vrc2 = VMR3AtErrorDeregister(pState->mpUVM, Console::genericVMSetErrorCallback, &pState->mErrorText); AssertRC(vrc2); 1352 1352 1353 1353 if (RT_FAILURE(vrc)) … … 1412 1412 { 1413 1413 if (!strcmp(szCmd, "hand-over-resume")) 1414 vrc = VMR3Resume( VMR3GetVM(pState->mpUVM));1414 vrc = VMR3Resume(pState->mpUVM); 1415 1415 else 1416 1416 pState->mptrConsole->setMachineState(MachineState_Paused); -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r44130 r44340 223 223 uint32_t cyPNG = 0; 224 224 225 Console::SafeVMPtr p VM(that->mParent);226 if ( SUCCEEDED(pVM.rc()))225 Console::SafeVMPtr ptrVM(that->mParent); 226 if (ptrVM.isOk()) 227 227 { 228 228 /* Query RGB bitmap. */ … … 264 264 else 265 265 { 266 LogFunc(("Failed to get VM pointer 0x%x\n", p VM.rc()));266 LogFunc(("Failed to get VM pointer 0x%x\n", ptrVM.rc())); 267 267 } 268 268 … … 859 859 { 860 860 /* protect mpVM */ 861 Console::SafeVMPtr p VM (mParent);862 AssertComRC (p VM.rc());863 864 STAM_REG(p VM, &StatDisplayRefresh, STAMTYPE_PROFILE, "/PROF/Display/Refresh", STAMUNIT_TICKS_PER_CALL, "Time spent in EMT for display updates.");861 Console::SafeVMPtr ptrVM (mParent); 862 AssertComRC (ptrVM.rc()); 863 864 STAM_REG(ptrVM.raw(), &StatDisplayRefresh, STAMTYPE_PROFILE, "/PROF/Display/Refresh", STAMUNIT_TICKS_PER_CALL, "Time spent in EMT for display updates."); 865 865 stam = 1; 866 866 } … … 2069 2069 } 2070 2070 2071 STDMETHODIMP Display::SetFramebuffer (ULONG aScreenId, 2072 IFramebuffer *aFramebuffer) 2071 STDMETHODIMP Display::SetFramebuffer(ULONG aScreenId, IFramebuffer *aFramebuffer) 2073 2072 { 2074 2073 LogRelFlowFunc (("\n")); … … 2078 2077 2079 2078 AutoCaller autoCaller(this); 2080 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2079 if (FAILED(autoCaller.rc())) 2080 return autoCaller.rc(); 2081 2081 2082 2082 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2083 2083 2084 Console::SafeVMPtrQuiet p VM(mParent);2085 if (p VM.isOk())2084 Console::SafeVMPtrQuiet ptrVM(mParent); 2085 if (ptrVM.isOk()) 2086 2086 { 2087 2087 /* Must release the lock here because the changeFramebuffer will … … 2090 2090 2091 2091 /* send request to the EMT thread */ 2092 int vrc = VMR3ReqCallWait (pVM, VMCPUID_ANY,2093 (PFNRT) 2092 int vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), VMCPUID_ANY, 2093 (PFNRT)changeFramebuffer, 3, this, aFramebuffer, aScreenId); 2094 2094 2095 2095 alock.acquire(); … … 2323 2323 } 2324 2324 2325 static int displayTakeScreenshot(PVM pVM, Display *pDisplay, struct DRVMAINDISPLAY *pDrv, ULONG aScreenId, BYTE *address, ULONG width, ULONG height) 2325 static int displayTakeScreenshot(PUVM pUVM, Display *pDisplay, struct DRVMAINDISPLAY *pDrv, ULONG aScreenId, 2326 BYTE *address, ULONG width, ULONG height) 2326 2327 { 2327 2328 uint8_t *pu8Data = NULL; … … 2338 2339 it would be nice to have an accurate screenshot for the bug 2339 2340 report if the VM deadlocks. */ 2340 vrc = VMR3ReqPriorityCallWait (pVM, VMCPUID_ANY, (PFNRT)Display::displayTakeScreenshotEMT, 6,2341 pDisplay, aScreenId, &pu8Data, &cbData, &cx, &cy);2341 vrc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)Display::displayTakeScreenshotEMT, 6, 2342 pDisplay, aScreenId, &pu8Data, &cbData, &cx, &cy); 2342 2343 if (vrc != VERR_TRY_AGAIN) 2343 2344 { … … 2417 2418 CHECK_CONSOLE_DRV(mpDrv); 2418 2419 2419 Console::SafeVMPtr pVM(mParent); 2420 if (FAILED(pVM.rc())) return pVM.rc(); 2420 Console::SafeVMPtr ptrVM(mParent); 2421 if (!ptrVM.isOk()) 2422 return ptrVM.rc(); 2421 2423 2422 2424 HRESULT rc = S_OK; … … 2431 2433 alock.release(); 2432 2434 2433 int vrc = displayTakeScreenshot(p VM, this, mpDrv, aScreenId, address, width, height);2435 int vrc = displayTakeScreenshot(ptrVM.rawUVM(), this, mpDrv, aScreenId, address, width, height); 2434 2436 2435 2437 if (vrc == VERR_NOT_IMPLEMENTED) … … 2469 2471 CHECK_CONSOLE_DRV(mpDrv); 2470 2472 2471 Console::SafeVMPtr pVM(mParent); 2472 if (FAILED(pVM.rc())) return pVM.rc(); 2473 Console::SafeVMPtr ptrVM(mParent); 2474 if (!ptrVM.isOk()) 2475 return ptrVM.rc(); 2473 2476 2474 2477 HRESULT rc = S_OK; … … 2489 2492 return E_OUTOFMEMORY; 2490 2493 2491 int vrc = displayTakeScreenshot(p VM, this, mpDrv, aScreenId, pu8Data, width, height);2494 int vrc = displayTakeScreenshot(ptrVM.rawUVM(), this, mpDrv, aScreenId, pu8Data, width, height); 2492 2495 2493 2496 if (RT_SUCCESS(vrc)) … … 2545 2548 CHECK_CONSOLE_DRV(mpDrv); 2546 2549 2547 Console::SafeVMPtr pVM(mParent); 2548 if (FAILED(pVM.rc())) return pVM.rc(); 2550 Console::SafeVMPtr ptrVM(mParent); 2551 if (!ptrVM.isOk()) 2552 return ptrVM.rc(); 2549 2553 2550 2554 HRESULT rc = S_OK; … … 2565 2569 return E_OUTOFMEMORY; 2566 2570 2567 int vrc = displayTakeScreenshot(p VM, this, mpDrv, aScreenId, pu8Data, width, height);2571 int vrc = displayTakeScreenshot(ptrVM.rawUVM(), this, mpDrv, aScreenId, pu8Data, width, height); 2568 2572 2569 2573 if (RT_SUCCESS(vrc)) … … 2732 2736 CHECK_CONSOLE_DRV (mpDrv); 2733 2737 2734 Console::SafeVMPtr pVM(mParent); 2735 if (FAILED(pVM.rc())) return pVM.rc(); 2738 Console::SafeVMPtr ptrVM(mParent); 2739 if (!ptrVM.isOk()) 2740 return ptrVM.rc(); 2736 2741 2737 2742 /* Release lock because the call scheduled on EMT may also try to take it. */ … … 2742 2747 * dirty conversion work. 2743 2748 */ 2744 int rcVBox = VMR3ReqCallWait (pVM, VMCPUID_ANY, (PFNRT)Display::drawToScreenEMT, 7,2745 this, aScreenId, address, x, y, width, height);2749 int rcVBox = VMR3ReqCallWaitU(ptrVM.rawUVM(), VMCPUID_ANY, (PFNRT)Display::drawToScreenEMT, 7, 2750 this, aScreenId, address, x, y, width, height); 2746 2751 2747 2752 /* … … 2852 2857 CHECK_CONSOLE_DRV (mpDrv); 2853 2858 2854 Console::SafeVMPtr pVM(mParent); 2855 if (FAILED(pVM.rc())) return pVM.rc(); 2859 Console::SafeVMPtr ptrVM(mParent); 2860 if (!ptrVM.isOk()) 2861 return ptrVM.rc(); 2856 2862 2857 2863 HRESULT rc = S_OK; … … 2863 2869 2864 2870 /* pdm.h says that this has to be called from the EMT thread */ 2865 int rcVBox = VMR3ReqCallVoidWait (pVM, VMCPUID_ANY, (PFNRT)Display::InvalidateAndUpdateEMT,2866 1, this);2871 int rcVBox = VMR3ReqCallVoidWaitU(ptrVM.rawUVM(), VMCPUID_ANY, (PFNRT)Display::InvalidateAndUpdateEMT, 2872 1, this); 2867 2873 alock.acquire(); 2868 2874 … … 2979 2985 * time-critical method. 2980 2986 */ 2981 Console::SafeVMPtrQuiet p VM (mParent);2982 if (p VM.isOk())2983 VM_ASSERT_EMT (pVM.raw());2987 Console::SafeVMPtrQuiet ptrVM (mParent); 2988 if (ptrVM.isOk()) 2989 Assert(VM_IS_EMT(ptrVM.raw())); 2984 2990 #endif 2985 2991 -
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r43387 r44340 28 28 #include <VBox/vmm/csam.h> 29 29 #include <VBox/vmm/vm.h> 30 #include <VBox/vmm/uvm.h> 30 31 #include <VBox/vmm/tm.h> 31 32 #include <VBox/vmm/hm.h> … … 826 827 827 828 /** 828 * Hack for getting the VM handle.829 * Hack for getting the user mode VM handle (UVM). 829 830 * 830 831 * This is only temporary (promise) while prototyping the debugger. … … 834 835 * uintptr_t in COM, we're using the max integer. 835 836 * (No, ULONG is not pointer sized!) 836 */ 837 STDMETHODIMP MachineDebugger::COMGETTER(VM)(LONG64 *a_u64Vm) 838 { 839 CheckComArgOutPointerValid(a_u64Vm); 837 * @remarks The returned handle must be passed to VMR3ReleaseUVM()! 838 * @remarks Prior to 4.3 this returned PVM. 839 */ 840 STDMETHODIMP MachineDebugger::COMGETTER(VM)(LONG64 *a_i64Vm) 841 { 842 CheckComArgOutPointerValid(a_i64Vm); 840 843 841 844 AutoCaller autoCaller(this); … … 848 851 hrc = ptrVM.rc(); 849 852 if (SUCCEEDED(hrc)) 850 *a_u64Vm = (intptr_t)ptrVM.raw(); 853 { 854 VMR3RetainUVM(ptrVM.rawUVM()); 855 *a_i64Vm = (intptr_t)ptrVM.rawUVM(); 856 } 851 857 852 858 /*
Note:
See TracChangeset
for help on using the changeset viewer.