VirtualBox

Changeset 46788 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jun 25, 2013 5:39:02 PM (11 years ago)
Author:
vboxsync
Message:

VMM: Suspend and resume reasons.

Location:
trunk/include/VBox/vmm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r45965 r46788  
    34413441    DECLR3CALLBACKMEMBER(int, pfnCallR0,(PPDMDEVINS pDevIns, uint32_t uOperation, uint64_t u64Arg));
    34423442
     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
    34433462    /** Space reserved for future members.
    34443463     * @{ */
     
    34503469    DECLR3CALLBACKMEMBER(void, pfnReserved6,(void));
    34513470    DECLR3CALLBACKMEMBER(void, pfnReserved7,(void));
    3452     DECLR3CALLBACKMEMBER(void, pfnReserved8,(void));
    3453     DECLR3CALLBACKMEMBER(void, pfnReserved9,(void));
     3471    /*DECLR3CALLBACKMEMBER(void, pfnReserved8,(void));
     3472    DECLR3CALLBACKMEMBER(void, pfnReserved9,(void));*/
    34543473    /*DECLR3CALLBACKMEMBER(void, pfnReserved10,(void));*/
    34553474    /** @} */
     
    36273646
    36283647/** 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)
    36303649
    36313650
     
    50845103
    50855104/**
     5105 * @copydoc PDMDEVHLP::pfnVMGetSuspendReason
     5106 */
     5107DECLINLINE(VMSUSPENDREASON) PDMDevHlpVMGetSuspendReason(PPDMDEVINS pDevIns)
     5108{
     5109    return pDevIns->pHlpR3->pfnVMGetSuspendReason(pDevIns);
     5110}
     5111
     5112/**
     5113 * @copydoc PDMDEVHLP::pfnVMGetResumeReason
     5114 */
     5115DECLINLINE(VMRESUMEREASON) PDMDevHlpVMGetResumeReason(PPDMDEVINS pDevIns)
     5116{
     5117    return pDevIns->pHlpR3->pfnVMGetResumeReason(pDevIns);
     5118}
     5119
     5120/**
    50865121 * @copydoc PDMDEVHLPR3::pfnGetUVM
    50875122 */
  • trunk/include/VBox/vmm/pdmdrv.h

    r44528 r46788  
    12981298                                                  PFNPDMBLKCACHEXFERENQUEUEDISCARDDRV pfnXferEnqueueDiscard,
    12991299                                                  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    /** @}  */
    13001331
    13011332    /** Just a safety precaution. */
     
    13031334} PDMDRVHLPR3;
    13041335/** 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)
    13061337
    13071338#endif /* IN_RING3 */
     
    17781809}
    17791810
     1811/**
     1812 * @copydoc PDMDRVHLP::pfnVMGetSuspendReason
     1813 */
     1814DECLINLINE(VMSUSPENDREASON) PDMDrvHlpVMGetSuspendReason(PPDMDRVINS pDrvIns)
     1815{
     1816    return pDrvIns->pHlpR3->pfnVMGetSuspendReason(pDrvIns);
     1817}
     1818
     1819/**
     1820 * @copydoc PDMDRVHLP::pfnVMGetResumeReason
     1821 */
     1822DECLINLINE(VMRESUMEREASON) PDMDrvHlpVMGetResumeReason(PPDMDRVINS pDrvIns)
     1823{
     1824    return pDrvIns->pHlpR3->pfnVMGetResumeReason(pDrvIns);
     1825}
     1826
     1827
    17801828/** Pointer to callbacks provided to the VBoxDriverRegister() call. */
    17811829typedef struct PDMDRVREGCB *PPDMDRVREGCB;
  • trunk/include/VBox/vmm/pdmusb.h

    r44528 r46788  
    678678    DECLR3CALLBACKMEMBER(void, pfnAsyncNotificationCompleted, (PPDMUSBINS pUsbIns));
    679679
     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
    680712    /** Just a safety precaution. */
    681713    uint32_t                        u32TheEnd;
     
    687719
    688720/** 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)
    690722
    691723#endif /* IN_RING3 */
  • trunk/include/VBox/vmm/vmapi.h

    r45618 r46788  
    332332} VMINITCOMPLETED;
    333333
     334
     335/** Reason for VM resume. */
     336typedef 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. */
     362typedef 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
    334386/**
    335387 * Progress callback.
     
    353405                                   PVM *ppVM, PUVM *ppUVM);
    354406VMMR3DECL(int)          VMR3PowerOn(PUVM pUVM);
    355 VMMR3DECL(int)          VMR3Suspend(PUVM pUVM);
    356 VMMR3DECL(int)          VMR3Resume(PUVM pUVM);
     407VMMR3DECL(int)          VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason);
     408VMMR3DECL(VMSUSPENDREASON) VMR3GetSuspendReason(PUVM);
     409VMMR3DECL(int)          VMR3Resume(PUVM pUVM, VMRESUMEREASON enmReason);
     410VMMR3DECL(VMRESUMEREASON) VMR3GetResumeReason(PUVM);
    357411VMMR3DECL(int)          VMR3Reset(PUVM pUVM);
    358412VMMR3DECL(int)          VMR3Save(PUVM pUVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended);
Note: See TracChangeset for help on using the changeset viewer.

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