Changeset 46788 in vbox
- Timestamp:
- Jun 25, 2013 5:39:02 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r46772 r46788 1643 1643 LIB_DDU = $(PATH_STAGE_LIB)/VBoxDDU.lib 1644 1644 endif 1645 if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), win.amd64 )1645 if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), win.amd64 linux.amd64) 1646 1646 VBOX_LIB_VMM_LAZY = $(PATH_STAGE_LIB)/VMMR3LazyImp$(VBOX_SUFF_LIB) 1647 1647 else -
trunk/include/VBox/vmm/pdmdev.h
r45965 r46788 3441 3441 DECLR3CALLBACKMEMBER(int, pfnCallR0,(PPDMDEVINS pDevIns, uint32_t uOperation, uint64_t u64Arg)); 3442 3442 3443 /** 3444 * Gets the reason for the most recent VM suspend. 3445 * 3446 * @returns The suspend reason. VMSUSPENDREASON_INVALID is returned if no 3447 * suspend has been made or if the pDevIns is invalid. 3448 * @param pDevIns The device instance. 3449 */ 3450 DECLR3CALLBACKMEMBER(VMSUSPENDREASON, pfnVMGetSuspendReason,(PPDMDEVINS pDevIns)); 3451 3452 /** 3453 * Gets the reason for the most recent VM resume. 3454 * 3455 * @returns The resume reason. VMRESUMEREASON_INVALID is returned if no 3456 * resume has been made or if the pDevIns is invalid. 3457 * @param pDevIns The device instance. 3458 */ 3459 DECLR3CALLBACKMEMBER(VMRESUMEREASON, pfnVMGetResumeReason,(PPDMDEVINS pDevIns)); 3460 3461 3443 3462 /** Space reserved for future members. 3444 3463 * @{ */ … … 3450 3469 DECLR3CALLBACKMEMBER(void, pfnReserved6,(void)); 3451 3470 DECLR3CALLBACKMEMBER(void, pfnReserved7,(void)); 3452 DECLR3CALLBACKMEMBER(void, pfnReserved8,(void));3453 DECLR3CALLBACKMEMBER(void, pfnReserved9,(void)); 3471 /*DECLR3CALLBACKMEMBER(void, pfnReserved8,(void)); 3472 DECLR3CALLBACKMEMBER(void, pfnReserved9,(void));*/ 3454 3473 /*DECLR3CALLBACKMEMBER(void, pfnReserved10,(void));*/ 3455 3474 /** @} */ … … 3627 3646 3628 3647 /** Current PDMDEVHLPR3 version number. */ 3629 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE(0xffe7, 12, 0)3648 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE(0xffe7, 12, 1) 3630 3649 3631 3650 … … 5084 5103 5085 5104 /** 5105 * @copydoc PDMDEVHLP::pfnVMGetSuspendReason 5106 */ 5107 DECLINLINE(VMSUSPENDREASON) PDMDevHlpVMGetSuspendReason(PPDMDEVINS pDevIns) 5108 { 5109 return pDevIns->pHlpR3->pfnVMGetSuspendReason(pDevIns); 5110 } 5111 5112 /** 5113 * @copydoc PDMDEVHLP::pfnVMGetResumeReason 5114 */ 5115 DECLINLINE(VMRESUMEREASON) PDMDevHlpVMGetResumeReason(PPDMDEVINS pDevIns) 5116 { 5117 return pDevIns->pHlpR3->pfnVMGetResumeReason(pDevIns); 5118 } 5119 5120 /** 5086 5121 * @copydoc PDMDEVHLPR3::pfnGetUVM 5087 5122 */ -
trunk/include/VBox/vmm/pdmdrv.h
r44528 r46788 1298 1298 PFNPDMBLKCACHEXFERENQUEUEDISCARDDRV pfnXferEnqueueDiscard, 1299 1299 const char *pcszId)); 1300 /** 1301 * Gets the reason for the most recent VM suspend. 1302 * 1303 * @returns The suspend reason. VMSUSPENDREASON_INVALID is returned if no 1304 * suspend has been made or if the pDrvIns is invalid. 1305 * @param pDrvIns The driver instance. 1306 */ 1307 DECLR3CALLBACKMEMBER(VMSUSPENDREASON, pfnVMGetSuspendReason,(PPDMDRVINS pDrvIns)); 1308 1309 /** 1310 * Gets the reason for the most recent VM resume. 1311 * 1312 * @returns The resume reason. VMRESUMEREASON_INVALID is returned if no 1313 * resume has been made or if the pDrvIns is invalid. 1314 * @param pDrvIns The driver instance. 1315 */ 1316 DECLR3CALLBACKMEMBER(VMRESUMEREASON, pfnVMGetResumeReason,(PPDMDRVINS pDrvIns)); 1317 1318 /** @name Space reserved for minor interface changes. 1319 * @{ */ 1320 DECLR3CALLBACKMEMBER(void, pfnReserved0,(PPDMDRVINS pDrvIns)); 1321 DECLR3CALLBACKMEMBER(void, pfnReserved1,(PPDMDRVINS pDrvIns)); 1322 DECLR3CALLBACKMEMBER(void, pfnReserved2,(PPDMDRVINS pDrvIns)); 1323 DECLR3CALLBACKMEMBER(void, pfnReserved3,(PPDMDRVINS pDrvIns)); 1324 DECLR3CALLBACKMEMBER(void, pfnReserved4,(PPDMDRVINS pDrvIns)); 1325 DECLR3CALLBACKMEMBER(void, pfnReserved5,(PPDMDRVINS pDrvIns)); 1326 DECLR3CALLBACKMEMBER(void, pfnReserved6,(PPDMDRVINS pDrvIns)); 1327 DECLR3CALLBACKMEMBER(void, pfnReserved7,(PPDMDRVINS pDrvIns)); 1328 DECLR3CALLBACKMEMBER(void, pfnReserved8,(PPDMDRVINS pDrvIns)); 1329 DECLR3CALLBACKMEMBER(void, pfnReserved9,(PPDMDRVINS pDrvIns)); 1330 /** @} */ 1300 1331 1301 1332 /** Just a safety precaution. */ … … 1303 1334 } PDMDRVHLPR3; 1304 1335 /** Current DRVHLP version number. */ 1305 #define PDM_DRVHLPR3_VERSION PDM_VERSION_MAKE(0xf0fb, 2, 0)1336 #define PDM_DRVHLPR3_VERSION PDM_VERSION_MAKE(0xf0fb, 3, 0) 1306 1337 1307 1338 #endif /* IN_RING3 */ … … 1778 1809 } 1779 1810 1811 /** 1812 * @copydoc PDMDRVHLP::pfnVMGetSuspendReason 1813 */ 1814 DECLINLINE(VMSUSPENDREASON) PDMDrvHlpVMGetSuspendReason(PPDMDRVINS pDrvIns) 1815 { 1816 return pDrvIns->pHlpR3->pfnVMGetSuspendReason(pDrvIns); 1817 } 1818 1819 /** 1820 * @copydoc PDMDRVHLP::pfnVMGetResumeReason 1821 */ 1822 DECLINLINE(VMRESUMEREASON) PDMDrvHlpVMGetResumeReason(PPDMDRVINS pDrvIns) 1823 { 1824 return pDrvIns->pHlpR3->pfnVMGetResumeReason(pDrvIns); 1825 } 1826 1827 1780 1828 /** Pointer to callbacks provided to the VBoxDriverRegister() call. */ 1781 1829 typedef struct PDMDRVREGCB *PPDMDRVREGCB; -
trunk/include/VBox/vmm/pdmusb.h
r44528 r46788 678 678 DECLR3CALLBACKMEMBER(void, pfnAsyncNotificationCompleted, (PPDMUSBINS pUsbIns)); 679 679 680 /** 681 * Gets the reason for the most recent VM suspend. 682 * 683 * @returns The suspend reason. VMSUSPENDREASON_INVALID is returned if no 684 * suspend has been made or if the pUsbIns is invalid. 685 * @param pUsbIns The driver instance. 686 */ 687 DECLR3CALLBACKMEMBER(VMSUSPENDREASON, pfnVMGetSuspendReason,(PPDMUSBINS pUsbIns)); 688 689 /** 690 * Gets the reason for the most recent VM resume. 691 * 692 * @returns The resume reason. VMRESUMEREASON_INVALID is returned if no 693 * resume has been made or if the pUsbIns is invalid. 694 * @param pUsbIns The driver instance. 695 */ 696 DECLR3CALLBACKMEMBER(VMRESUMEREASON, pfnVMGetResumeReason,(PPDMUSBINS pUsbIns)); 697 698 /** @name Space reserved for minor interface changes. 699 * @{ */ 700 DECLR3CALLBACKMEMBER(void, pfnReserved0,(PPDMUSBINS pUsbIns)); 701 DECLR3CALLBACKMEMBER(void, pfnReserved1,(PPDMUSBINS pUsbIns)); 702 DECLR3CALLBACKMEMBER(void, pfnReserved2,(PPDMUSBINS pUsbIns)); 703 DECLR3CALLBACKMEMBER(void, pfnReserved3,(PPDMUSBINS pUsbIns)); 704 DECLR3CALLBACKMEMBER(void, pfnReserved4,(PPDMUSBINS pUsbIns)); 705 DECLR3CALLBACKMEMBER(void, pfnReserved5,(PPDMUSBINS pUsbIns)); 706 DECLR3CALLBACKMEMBER(void, pfnReserved6,(PPDMUSBINS pUsbIns)); 707 DECLR3CALLBACKMEMBER(void, pfnReserved7,(PPDMUSBINS pUsbIns)); 708 DECLR3CALLBACKMEMBER(void, pfnReserved8,(PPDMUSBINS pUsbIns)); 709 DECLR3CALLBACKMEMBER(void, pfnReserved9,(PPDMUSBINS pUsbIns)); 710 /** @} */ 711 680 712 /** Just a safety precaution. */ 681 713 uint32_t u32TheEnd; … … 687 719 688 720 /** Current USBHLP version number. */ 689 #define PDM_USBHLP_VERSION PDM_VERSION_MAKE(0xeefe, 2, 0)721 #define PDM_USBHLP_VERSION PDM_VERSION_MAKE(0xeefe, 3, 0) 690 722 691 723 #endif /* IN_RING3 */ -
trunk/include/VBox/vmm/vmapi.h
r45618 r46788 332 332 } VMINITCOMPLETED; 333 333 334 335 /** Reason for VM resume. */ 336 typedef enum VMRESUMEREASON 337 { 338 VMRESUMEREASON_INVALID = 0, 339 /** User decided to do so. */ 340 VMRESUMEREASON_USER, 341 /** VM reconfiguration (like changing DVD). */ 342 VMRESUMEREASON_RECONFIG, 343 /** The host resumed. */ 344 VMRESUMEREASON_HOST_RESUME, 345 /** Restored state. */ 346 VMRESUMEREASON_STATE_RESTORED, 347 /** Snapshot / saved state. */ 348 VMRESUMEREASON_STATE_SAVED, 349 /** Teleported to a new box / instance. */ 350 VMRESUMEREASON_TELEPORTED, 351 /** Teleportation failed. */ 352 VMRESUMEREASON_TELEPORT_FAILED, 353 /** FTM temporarily suspended the VM. */ 354 VMRESUMEREASON_FTM_SYNC, 355 /** End of valid reasons. */ 356 VMRESUMEREASON_END, 357 /** Blow the type up to 32-bits. */ 358 VMRESUMEREASON_32BIT_HACK = 0x7fffffff 359 } VMRESUMEREASON; 360 361 /** Reason for VM suspend. */ 362 typedef enum VMSUSPENDREASON 363 { 364 VMSUSPENDREASON_INVALID = 0, 365 /** User decided to do so. */ 366 VMSUSPENDREASON_USER, 367 /** VM reconfiguration (like changing DVD). */ 368 VMSUSPENDREASON_RECONFIG, 369 /** The VM is suspending itself. */ 370 VMSUSPENDREASON_VM, 371 /** The Vm is suspending because of a runtime error. */ 372 VMSUSPENDREASON_RUNTIME_ERROR, 373 /** The host was suspended. */ 374 VMSUSPENDREASON_HOST_SUSPEND, 375 /** The host is running low on battery power. */ 376 VMSUSPENDREASON_HOST_BATTERY_LOW, 377 /** FTM is temporarily suspending the VM. */ 378 VMSUSPENDREASON_FTM_SYNC, 379 /** End of valid reasons. */ 380 VMSUSPENDREASON_END, 381 /** Blow the type up to 32-bits. */ 382 VMSUSPENDREASON_32BIT_HACK = 0x7fffffff 383 } VMSUSPENDREASON; 384 385 334 386 /** 335 387 * Progress callback. … … 353 405 PVM *ppVM, PUVM *ppUVM); 354 406 VMMR3DECL(int) VMR3PowerOn(PUVM pUVM); 355 VMMR3DECL(int) VMR3Suspend(PUVM pUVM); 356 VMMR3DECL(int) VMR3Resume(PUVM pUVM); 407 VMMR3DECL(int) VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason); 408 VMMR3DECL(VMSUSPENDREASON) VMR3GetSuspendReason(PUVM); 409 VMMR3DECL(int) VMR3Resume(PUVM pUVM, VMRESUMEREASON enmReason); 410 VMMR3DECL(VMRESUMEREASON) VMR3GetResumeReason(PUVM); 357 411 VMMR3DECL(int) VMR3Reset(PUVM pUVM); 358 412 VMMR3DECL(int) VMR3Save(PUVM pUVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r46775 r46788 3617 3617 /* disable the callback to prevent Console-level state change */ 3618 3618 pConsole->mVMStateChangeCallbackDisabled = true; 3619 int rc = VMR3Suspend(pUVM );3619 int rc = VMR3Suspend(pUVM, VMSUSPENDREASON_RECONFIG); 3620 3620 pConsole->mVMStateChangeCallbackDisabled = false; 3621 3621 AssertRCReturn(rc, rc); … … 3680 3680 /* disable the callback to prevent Console-level state change */ 3681 3681 pConsole->mVMStateChangeCallbackDisabled = true; 3682 rc = VMR3Resume(pUVM );3682 rc = VMR3Resume(pUVM, VMRESUMEREASON_RECONFIG); 3683 3683 pConsole->mVMStateChangeCallbackDisabled = false; 3684 3684 AssertRC(rc); … … 3866 3866 /* disable the callback to prevent Console-level state change */ 3867 3867 pConsole->mVMStateChangeCallbackDisabled = true; 3868 int rc = VMR3Suspend(pUVM );3868 int rc = VMR3Suspend(pUVM, VMSUSPENDREASON_RECONFIG); 3869 3869 pConsole->mVMStateChangeCallbackDisabled = false; 3870 3870 AssertRCReturn(rc, rc); … … 3929 3929 /* disable the callback to prevent Console-level state change */ 3930 3930 pConsole->mVMStateChangeCallbackDisabled = true; 3931 rc = VMR3Resume(pUVM );3931 rc = VMR3Resume(pUVM, VMRESUMEREASON_RECONFIG); 3932 3932 pConsole->mVMStateChangeCallbackDisabled = false; 3933 3933 AssertRC(rc); … … 4109 4109 /* disable the callback to prevent Console-level state change */ 4110 4110 pConsole->mVMStateChangeCallbackDisabled = true; 4111 int rc = VMR3Suspend(pUVM );4111 int rc = VMR3Suspend(pUVM, VMSUSPENDREASON_RECONFIG); 4112 4112 pConsole->mVMStateChangeCallbackDisabled = false; 4113 4113 AssertRCReturn(rc, rc); … … 4191 4191 /* disable the callback to prevent Console-level state change */ 4192 4192 pConsole->mVMStateChangeCallbackDisabled = true; 4193 rc = VMR3Resume(pUVM );4193 rc = VMR3Resume(pUVM, VMRESUMEREASON_RECONFIG); 4194 4194 pConsole->mVMStateChangeCallbackDisabled = false; 4195 4195 AssertRC(rc); … … 4533 4533 /* disable the callback to prevent Console-level state change */ 4534 4534 pThis->mVMStateChangeCallbackDisabled = true; 4535 int rc = VMR3Suspend(pUVM );4535 int rc = VMR3Suspend(pUVM, VMSUSPENDREASON_RECONFIG); 4536 4536 pThis->mVMStateChangeCallbackDisabled = false; 4537 4537 AssertRCReturn(rc, rc); … … 4569 4569 /* disable the callback to prevent Console-level state change */ 4570 4570 pThis->mVMStateChangeCallbackDisabled = true; 4571 rc = VMR3Resume(pUVM );4571 rc = VMR3Resume(pUVM, VMRESUMEREASON_RECONFIG); 4572 4572 pThis->mVMStateChangeCallbackDisabled = false; 4573 4573 AssertRC(rc); … … 5578 5578 /* disable the callback to prevent Console-level state change */ 5579 5579 mVMStateChangeCallbackDisabled = true; 5580 int vrc2 = VMR3Suspend(ptrVM.rawUVM() );5580 int vrc2 = VMR3Suspend(ptrVM.rawUVM(), VMSUSPENDREASON_RECONFIG); 5581 5581 mVMStateChangeCallbackDisabled = false; 5582 5582 AssertRCReturn(vrc2, E_FAIL); … … 5607 5607 /* disable the callback to prevent Console-level state change */ 5608 5608 mVMStateChangeCallbackDisabled = true; 5609 int vrc2 = VMR3Resume(ptrVM.rawUVM() );5609 int vrc2 = VMR3Resume(ptrVM.rawUVM(), VMRESUMEREASON_RECONFIG); 5610 5610 mVMStateChangeCallbackDisabled = false; 5611 5611 if (RT_FAILURE(vrc2)) … … 5649 5649 /* disable the callback to prevent Console-level state change */ 5650 5650 mVMStateChangeCallbackDisabled = true; 5651 int vrc2 = VMR3Suspend(ptrVM.rawUVM() );5651 int vrc2 = VMR3Suspend(ptrVM.rawUVM(), VMSUSPENDREASON_RECONFIG); 5652 5652 mVMStateChangeCallbackDisabled = false; 5653 5653 AssertRCReturn(vrc2, E_FAIL); … … 5683 5683 /* disable the callback to prevent Console-level state change */ 5684 5684 mVMStateChangeCallbackDisabled = true; 5685 int vrc2 = VMR3Resume(ptrVM.rawUVM() );5685 int vrc2 = VMR3Resume(ptrVM.rawUVM(), VMRESUMEREASON_RECONFIG); 5686 5686 mVMStateChangeCallbackDisabled = false; 5687 5687 AssertRC(vrc2); … … 5753 5753 5754 5754 /** @todo r=klaus make use of aReason */ 5755 int vrc = VMR3Suspend(ptrVM.rawUVM()); 5755 VMSUSPENDREASON enmReason = VMSUSPENDREASON_USER; 5756 if (aReason == Reason_HostSuspend) 5757 enmReason = VMSUSPENDREASON_HOST_SUSPEND; 5758 else if (aReason == Reason_HostBatteryLow) 5759 enmReason = VMSUSPENDREASON_HOST_BATTERY_LOW; 5760 int vrc = VMR3Suspend(ptrVM.rawUVM(), enmReason); 5756 5761 5757 5762 HRESULT hrc = S_OK; … … 5794 5799 LogRel(("Resuming VM execution, reason \"%s\"\n", Global::stringifyReason(aReason))); 5795 5800 5796 /** @todo r=klaus make use of aReason */5797 5801 int vrc; 5798 5802 if (VMR3GetStateU(ptrVM.rawUVM()) == VMSTATE_CREATED) … … 5807 5811 } 5808 5812 else 5809 vrc = VMR3Resume(ptrVM.rawUVM()); 5813 { 5814 VMRESUMEREASON enmReason = VMRESUMEREASON_USER; 5815 if (aReason == Reason_HostResume) 5816 enmReason = VMRESUMEREASON_HOST_RESUME; 5817 vrc = VMR3Resume(ptrVM.rawUVM(), enmReason); 5818 } 5810 5819 5811 5820 HRESULT rc = RT_SUCCESS(vrc) ? S_OK : … … 5858 5867 /* release the lock before a VMR3* call (EMT will call us back)! */ 5859 5868 alock.release(); 5860 int vrc = VMR3Suspend(ptrVM.rawUVM()); 5869 VMSUSPENDREASON enmReason = VMSUSPENDREASON_USER; 5870 if (aReason == Reason_HostSuspend) 5871 enmReason = VMSUSPENDREASON_HOST_SUSPEND; 5872 else if (aReason == Reason_HostBatteryLow) 5873 enmReason = VMSUSPENDREASON_HOST_BATTERY_LOW; 5874 int vrc = VMR3Suspend(ptrVM.rawUVM(), enmReason); 5861 5875 alock.acquire(); 5862 5876 … … 5967 5981 { 5968 5982 alock.release(); 5969 VMR3Resume(ptrVM.rawUVM() );5983 VMR3Resume(ptrVM.rawUVM(), VMRESUMEREASON_STATE_RESTORED); 5970 5984 alock.acquire(); 5971 5985 } … … 9090 9104 #endif 9091 9105 if (RT_SUCCESS(vrc)) 9092 vrc = VMR3Resume(pConsole->mpUVM );9106 vrc = VMR3Resume(pConsole->mpUVM, VMRESUMEREASON_STATE_RESTORED); 9093 9107 AssertLogRelRC(vrc); 9094 9108 } … … 9630 9644 SafeVMPtr ptrVM(that); 9631 9645 alock.release(); 9632 int vrc = VMR3Resume(ptrVM.rawUVM() );9646 int vrc = VMR3Resume(ptrVM.rawUVM(), VMRESUMEREASON_STATE_SAVED); 9633 9647 alock.acquire(); 9634 9648 if (RT_FAILURE(vrc)) … … 9688 9702 SafeVMPtr ptrVM(that); 9689 9703 alock.release(); 9690 int vrc = VMR3Resume(ptrVM.rawUVM() ); AssertLogRelRC(vrc);9704 int vrc = VMR3Resume(ptrVM.rawUVM(), VMRESUMEREASON_STATE_SAVED); AssertLogRelRC(vrc); 9691 9705 alock.acquire(); 9692 9706 if (RT_FAILURE(vrc)) … … 9747 9761 LogFlowFunc(("Saving the state to '%s'...\n", task->mSavedStateFile.c_str())); 9748 9762 9749 /** @todo r=klaus make use of task->mReason */9750 9763 bool fSuspenededBySave; 9751 9764 int vrc = VMR3Save(task->mpUVM, -
trunk/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
r46326 r46788 888 888 { 889 889 autoLock.release(); 890 int rc = VMR3Resume(pState->mpUVM );890 int rc = VMR3Resume(pState->mpUVM, VMRESUMEREASON_TELEPORT_FAILED); 891 891 AssertLogRelMsgRC(rc, ("VMR3Resume -> %Rrc\n", rc)); 892 892 autoLock.acquire(); … … 1413 1413 { 1414 1414 if (!strcmp(szCmd, "hand-over-resume")) 1415 vrc = VMR3Resume(pState->mpUVM );1415 vrc = VMR3Resume(pState->mpUVM, VMRESUMEREASON_TELEPORTED); 1416 1416 else 1417 1417 pState->mptrConsole->setMachineState(MachineState_Paused); -
trunk/src/VBox/VMM/VMMR3/FTM.cpp
r46420 r46788 638 638 bool fSuspended = false; 639 639 640 int rc = VMR3Suspend(pVM->pUVM );640 int rc = VMR3Suspend(pVM->pUVM, VMSUSPENDREASON_FTM_SYNC); 641 641 AssertRCReturn(rc, rc); 642 642 … … 668 668 AssertRCReturn(rc, rc); 669 669 670 rc = VMR3Resume(pVM->pUVM );670 rc = VMR3Resume(pVM->pUVM, VMRESUMEREASON_FTM_SYNC); 671 671 AssertRC(rc); 672 672 -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r46420 r46788 2215 2215 PDMDEV_ASSERT_DEVINS(pDevIns); 2216 2216 PVM pVM = pDevIns->Internal.s.pVMR3; 2217 VM_ASSERT_EMT(p DevIns->Internal.s.pVMR3);2217 VM_ASSERT_EMT(pVM); 2218 2218 LogFlow(("pdmR3DevHlp_CallR0: caller='%s'/%d: uOperation=%#x u64Arg=%#RX64\n", 2219 2219 pDevIns->pReg->szName, pDevIns->iInstance, uOperation, u64Arg)); … … 2256 2256 pDevIns->iInstance, rc)); 2257 2257 return rc; 2258 } 2259 2260 2261 /** @interface_method_impl{PDMDEVHLP,pfnVMGetSuspendReason} */ 2262 static DECLCALLBACK(VMSUSPENDREASON) pdmR3DevHlp_VMGetSuspendReason(PPDMDEVINS pDevIns) 2263 { 2264 PDMDEV_ASSERT_DEVINS(pDevIns); 2265 PVM pVM = pDevIns->Internal.s.pVMR3; 2266 VM_ASSERT_EMT(pVM); 2267 VMSUSPENDREASON enmReason = VMR3GetSuspendReason(pVM->pUVM); 2268 LogFlow(("pdmR3DevHlp_VMGetSuspendReason: caller='%s'/%d: returns %d\n", 2269 pDevIns->pReg->szName, pDevIns->iInstance, enmReason)); 2270 return enmReason; 2271 } 2272 2273 2274 /** @interface_method_impl{PDMDEVHLP,pfnVMGetResumeReason} */ 2275 static DECLCALLBACK(VMRESUMEREASON) pdmR3DevHlp_VMGetResumeReason(PPDMDEVINS pDevIns) 2276 { 2277 PDMDEV_ASSERT_DEVINS(pDevIns); 2278 PVM pVM = pDevIns->Internal.s.pVMR3; 2279 VM_ASSERT_EMT(pVM); 2280 VMRESUMEREASON enmReason = VMR3GetResumeReason(pVM->pUVM); 2281 LogFlow(("pdmR3DevHlp_VMGetResumeReason: caller='%s'/%d: returns %d\n", 2282 pDevIns->pReg->szName, pDevIns->iInstance, enmReason)); 2283 return enmReason; 2258 2284 } 2259 2285 … … 3256 3282 { 3257 3283 /* We own the IOM lock here and could cause a deadlock by waiting for a VCPU that is blocking on the IOM lock. */ 3258 rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3Suspend, 1, pVM->pUVM);3284 rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3Suspend, 2, pVM->pUVM, VMSUSPENDREASON_VM); 3259 3285 AssertRC(rc); 3260 3286 rc = VINF_EM_SUSPEND; 3261 3287 } 3262 3288 else 3263 rc = VMR3Suspend(pVM->pUVM );3289 rc = VMR3Suspend(pVM->pUVM, VMSUSPENDREASON_VM); 3264 3290 3265 3291 LogFlow(("pdmR3DevHlp_VMSuspend: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc)); … … 3281 3307 * Suspend the VM first then do the saving. 3282 3308 */ 3283 int rc = VMR3Suspend(pVM->pUVM );3309 int rc = VMR3Suspend(pVM->pUVM, VMSUSPENDREASON_VM); 3284 3310 if (RT_SUCCESS(rc)) 3285 3311 { … … 3494 3520 pdmR3DevHlp_LdrGetR0InterfaceSymbols, 3495 3521 pdmR3DevHlp_CallR0, 3496 0,3497 0,3522 pdmR3DevHlp_VMGetSuspendReason, 3523 pdmR3DevHlp_VMGetResumeReason, 3498 3524 0, 3499 3525 0, … … 3735 3761 pdmR3DevHlp_LdrGetR0InterfaceSymbols, 3736 3762 pdmR3DevHlp_CallR0, 3737 0,3738 0,3763 pdmR3DevHlp_VMGetSuspendReason, 3764 pdmR3DevHlp_VMGetResumeReason, 3739 3765 0, 3740 3766 0, -
trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp
r46493 r46788 1758 1758 1759 1759 1760 1761 /** @interface_method_impl{PDMDRVHLP,pfnVMGetSuspendReason} */ 1762 static DECLCALLBACK(VMSUSPENDREASON) pdmR3DrvHlp_VMGetSuspendReason(PPDMDRVINS pDrvIns) 1763 { 1764 PDMDRV_ASSERT_DRVINS(pDrvIns); 1765 PVM pVM = pDrvIns->Internal.s.pVMR3; 1766 VM_ASSERT_EMT(pVM); 1767 VMSUSPENDREASON enmReason = VMR3GetSuspendReason(pVM->pUVM); 1768 LogFlow(("pdmR3DrvHlp_VMGetSuspendReason: caller='%s'/%d: returns %d\n", 1769 pDrvIns->pReg->szName, pDrvIns->iInstance, enmReason)); 1770 return enmReason; 1771 } 1772 1773 1774 /** @interface_method_impl{PDMDRVHLP,pfnVMGetResumeReason} */ 1775 static DECLCALLBACK(VMRESUMEREASON) pdmR3DrvHlp_VMGetResumeReason(PPDMDRVINS pDrvIns) 1776 { 1777 PDMDRV_ASSERT_DRVINS(pDrvIns); 1778 PVM pVM = pDrvIns->Internal.s.pVMR3; 1779 VM_ASSERT_EMT(pVM); 1780 VMRESUMEREASON enmReason = VMR3GetResumeReason(pVM->pUVM); 1781 LogFlow(("pdmR3DrvHlp_VMGetResumeReason: caller='%s'/%d: returns %d\n", 1782 pDrvIns->pReg->szName, pDrvIns->iInstance, enmReason)); 1783 return enmReason; 1784 } 1785 1786 1760 1787 /** 1761 1788 * The driver helper structure. … … 1805 1832 pdmR3DrvHlp_FTSetCheckpoint, 1806 1833 pdmR3DrvHlp_BlkCacheRetain, 1834 pdmR3DrvHlp_VMGetSuspendReason, 1835 pdmR3DrvHlp_VMGetResumeReason, 1836 NULL, 1837 NULL, 1838 NULL, 1839 NULL, 1840 NULL, 1841 NULL, 1842 NULL, 1843 NULL, 1844 NULL, 1845 NULL, 1807 1846 PDM_DRVHLPR3_VERSION /* u32TheEnd */ 1808 1847 }; -
trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp
r44386 r46788 1465 1465 1466 1466 1467 /** @interface_method_impl{PDMUSBHLP,pfnVMGetSuspendReason} */ 1468 static DECLCALLBACK(VMSUSPENDREASON) pdmR3UsbHlp_VMGetSuspendReason(PPDMUSBINS pUsbIns) 1469 { 1470 PDMUSB_ASSERT_USBINS(pUsbIns); 1471 PVM pVM = pUsbIns->Internal.s.pVM; 1472 VM_ASSERT_EMT(pVM); 1473 VMSUSPENDREASON enmReason = VMR3GetSuspendReason(pVM->pUVM); 1474 LogFlow(("pdmR3UsbHlp_VMGetSuspendReason: caller='%s'/%d: returns %d\n", 1475 pUsbIns->pReg->szName, pUsbIns->iInstance, enmReason)); 1476 return enmReason; 1477 } 1478 1479 1480 /** @interface_method_impl{PDMUSBHLP,pfnVMGetResumeReason} */ 1481 static DECLCALLBACK(VMRESUMEREASON) pdmR3UsbHlp_VMGetResumeReason(PPDMUSBINS pUsbIns) 1482 { 1483 PDMUSB_ASSERT_USBINS(pUsbIns); 1484 PVM pVM = pUsbIns->Internal.s.pVM; 1485 VM_ASSERT_EMT(pVM); 1486 VMRESUMEREASON enmReason = VMR3GetResumeReason(pVM->pUVM); 1487 LogFlow(("pdmR3UsbHlp_VMGetResumeReason: caller='%s'/%d: returns %d\n", 1488 pUsbIns->pReg->szName, pUsbIns->iInstance, enmReason)); 1489 return enmReason; 1490 } 1491 1492 1467 1493 /** 1468 1494 * The USB device helper structure. … … 1488 1514 pdmR3UsbHlp_SetAsyncNotification, 1489 1515 pdmR3UsbHlp_AsyncNotificationCompleted, 1516 pdmR3UsbHlp_VMGetSuspendReason, 1517 pdmR3UsbHlp_VMGetResumeReason, 1518 NULL, 1519 NULL, 1520 NULL, 1521 NULL, 1522 NULL, 1523 NULL, 1524 NULL, 1525 NULL, 1526 NULL, 1527 NULL, 1490 1528 PDM_USBHLP_VERSION 1491 1529 }; -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r45786 r46788 1343 1343 static DECLCALLBACK(VBOXSTRICTRC) vmR3Suspend(PVM pVM, PVMCPU pVCpu, void *pvUser) 1344 1344 { 1345 LogFlow(("vmR3Suspend: pVM=%p pVCpu=%p/#%u\n", pVM, pVCpu, pVCpu->idCpu));1346 Assert(!pvUser); NOREF(pvUser);1345 VMSUSPENDREASON enmReason = (VMSUSPENDREASON)(uintptr_t)pvUser; 1346 LogFlow(("vmR3Suspend: pVM=%p pVCpu=%p/#%u enmReason=%d\n", pVM, pVCpu, pVCpu->idCpu, enmReason)); 1347 1347 1348 1348 /* … … 1358 1358 if (RT_FAILURE(rc)) 1359 1359 return rc; 1360 pVM->pUVM->vm.s.enmSuspendReason = enmReason; 1360 1361 } 1361 1362 … … 1391 1392 * code that has to be propagated up the call stack. 1392 1393 * 1393 * @param pUVM The VM to suspend. 1394 * @param pUVM The VM to suspend. 1395 * @param enmReason The reason for suspending. 1394 1396 * 1395 1397 * @thread Any thread. … … 1397 1399 * @vmstateto Suspending + Suspended or SuspendingExtLS + SuspendedExtLS 1398 1400 */ 1399 VMMR3DECL(int) VMR3Suspend(PUVM pUVM )1401 VMMR3DECL(int) VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason) 1400 1402 { 1401 1403 LogFlow(("VMR3Suspend: pUVM=%p\n", pUVM)); 1402 1404 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1405 AssertReturn(enmReason > VMSUSPENDREASON_INVALID && enmReason < VMSUSPENDREASON_END, VERR_INVALID_PARAMETER); 1403 1406 1404 1407 /* … … 1407 1410 */ 1408 1411 int rc = VMMR3EmtRendezvous(pUVM->pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_DESCENDING | VMMEMTRENDEZVOUS_FLAGS_STOP_ON_ERROR, 1409 vmR3Suspend, NULL);1412 vmR3Suspend, (void *)(uintptr_t)enmReason); 1410 1413 LogFlow(("VMR3Suspend: returns %Rrc\n", rc)); 1411 1414 return rc; … … 1414 1417 1415 1418 /** 1419 * Retrieves the reason for the most recent suspend. 1420 * 1421 * @returns Suspend reason. VMSUSPENDREASON_INVALID if no suspend has been done 1422 * or the handle is invalid. 1423 * @param pUVM The user mode VM handle. 1424 */ 1425 VMMR3DECL(VMSUSPENDREASON) VMR3GetSuspendReason(PUVM pUVM) 1426 { 1427 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VMSUSPENDREASON_INVALID); 1428 return pUVM->vm.s.enmSuspendReason; 1429 } 1430 1431 1432 /** 1416 1433 * EMT rendezvous worker for VMR3Resume. 1417 1434 * … … 1421 1438 * @param pVM Pointer to the VM. 1422 1439 * @param pVCpu Pointer to the VMCPU of the EMT. 1423 * @param pvUser Ignored.1440 * @param pvUser Reason. 1424 1441 */ 1425 1442 static DECLCALLBACK(VBOXSTRICTRC) vmR3Resume(PVM pVM, PVMCPU pVCpu, void *pvUser) 1426 1443 { 1427 LogFlow(("vmR3Resume: pVM=%p pVCpu=%p/#%u\n", pVM, pVCpu, pVCpu->idCpu));1428 Assert(!pvUser); NOREF(pvUser);1444 VMRESUMEREASON enmReason = (VMRESUMEREASON)(uintptr_t)pvUser; 1445 LogFlow(("vmR3Resume: pVM=%p pVCpu=%p/#%u enmReason=%d\n", pVM, pVCpu, pVCpu->idCpu, enmReason)); 1429 1446 1430 1447 /* … … 1437 1454 if (RT_FAILURE(rc)) 1438 1455 return rc; 1456 pVM->pUVM->vm.s.enmResumeReason = enmReason; 1439 1457 } 1440 1458 … … 1473 1491 * 1474 1492 * @param pVM The VM to resume. 1493 * @param enmReason The reason we're resuming. 1475 1494 * 1476 1495 * @thread Any thread. … … 1478 1497 * @vmstateto Running 1479 1498 */ 1480 VMMR3DECL(int) VMR3Resume(PUVM pUVM )1499 VMMR3DECL(int) VMR3Resume(PUVM pUVM, VMRESUMEREASON enmReason) 1481 1500 { 1482 1501 LogFlow(("VMR3Resume: pUVM=%p\n", pUVM)); … … 1484 1503 PVM pVM = pUVM->pVM; 1485 1504 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 1505 AssertReturn(enmReason > VMRESUMEREASON_INVALID && enmReason < VMRESUMEREASON_END, VERR_INVALID_PARAMETER); 1486 1506 1487 1507 /* … … 1490 1510 */ 1491 1511 int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_DESCENDING | VMMEMTRENDEZVOUS_FLAGS_STOP_ON_ERROR, 1492 vmR3Resume, NULL);1512 vmR3Resume, (void *)(uintptr_t)enmReason); 1493 1513 LogFlow(("VMR3Resume: returns %Rrc\n", rc)); 1494 1514 return rc; 1515 } 1516 1517 1518 /** 1519 * Retrieves the reason for the most recent resume. 1520 * 1521 * @returns Resume reason. VMRESUMEREASON_INVALID if no suspend has been 1522 * done or the handle is invalid. 1523 * @param pUVM The user mode VM handle. 1524 */ 1525 VMMR3DECL(VMRESUMEREASON) VMR3GetResumeReason(PUVM pUVM) 1526 { 1527 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VMRESUMEREASON_INVALID); 1528 return pUVM->vm.s.enmResumeReason; 1495 1529 } 1496 1530 … … 4052 4086 vmR3SetRuntimeErrorChangeState, NULL); 4053 4087 else if (fFlags & VMSETRTERR_FLAGS_SUSPEND) 4054 rc = VMR3Suspend(pUVM );4088 rc = VMR3Suspend(pUVM, VMSUSPENDREASON_RUNTIME_ERROR); 4055 4089 else 4056 4090 rc = VINF_SUCCESS; -
trunk/src/VBox/VMM/include/VMInternal.h
r44528 r46788 228 228 * and when debugging. */ 229 229 VMSTATE enmPrevVMState; 230 231 /** Reason for the most recent suspend operation. */ 232 VMSUSPENDREASON enmSuspendReason; 233 /** Reason for the most recent operation. */ 234 VMRESUMEREASON enmResumeReason; 230 235 231 236 /** Critical section for pAtError and pAtRuntimeError. */
Note:
See TracChangeset
for help on using the changeset viewer.