DM:monitor: add monitor_register_vm_ops()

monitor_vm_ops and its helpers is added to allow DM to register operations
, so thant vm manager could trigger the power state changes of VM.

Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Wang, Yu <yu1.wang@intel.com>
signed-off-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
yuhong.tao@intel.com
2018-05-30 02:44:13 +08:00
committed by lijinxia
parent eada59c934
commit 9af35baf5a
2 changed files with 194 additions and 0 deletions

View File

@@ -43,4 +43,19 @@
int monitor_init(struct vmctx *ctx);
void monitor_close(void);
struct monitor_vm_ops {
int (*stop) (void *arg);
int (*resume) (void *arg);
int (*suspend) (void *arg);
int (*pause) (void *arg);
int (*unpause) (void *arg);
int (*query) (void *arg);
};
int monitor_register_vm_ops(struct monitor_vm_ops *ops, void *arg,
const char *name);
/* helper functions for vm_ops callback developer */
unsigned get_wakeup_reason(void);
int set_wakeup_timer(time_t t);
#endif