In handle_resume(), wakeup_reason is updated before call
ops->ops->resume(). Because ops->ops->resume() needs to know the
latest wakeup reason.
Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Then, acrnctl could send command to monitor module of DM and call
functions defined in pm ops. One example is: acrnctl resume UOS
after UOS enter S3.
Also add general pm.c and move pm related function to this file.
Signed-off-by: Yan Like <like.yan@intel.com>
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
acrn-manager message structure has a flexible member
payload[0], that risks to out-of-boundary memory access,
and usage of uninitialized variable.
And the req/ack message pairs has various types, which
extend mngr_msg. mngr_send_msg() requires programmer cast
the type of input messages to struct mngr_msg, that is
inconvenient.
We replace payload[0] with an union, which contains all
payload data. So that type cast for mngr_send_msg() is no
longer needed. And we can avoid potential out-of-boundary
memory accessing and using of uninitialized variable
Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
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>
Adapt dm-monitor and acrnctl to use the helper functions and new message
definitions in acrn_mngr.h.
These jobs must be done in one commit to avoid build problems:
1. message transmission and callback registration code are moved
to libacrn-mngr.a, so old functions in dm-monitor could be removed to
make code clean;
2. remove unnecessary monior_msg.h;
3. minor changes to acrnctl accordingly.
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@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>
-memory was dereferenced after being freed:
MACRO 'LIST_FOREACH()' dereference
'client' for next list node after 'client'
was freed.
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
A monitor component will be added to acrn-dm, which crteats socket,
bind and listening at /run/acrn/vmname. Acrnctl & acrnd could conn
-ect to the socket for communication, using defined message, in
include/monitor_msg.h
For each defined message, a message handler callback could be
registered via monitor_add_msg_handler(). On received of a defined
message, a certain call back will be called. Each callback can only
see the message sender's socket-fd.
When acrn-dm want report something, not triggered by incoming message
it can send broadcast message, use monitor_broadcast().
Acked-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Yin, Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao, Yuhong <yuhong.tao@intel.com>