dm: monotor: bugfix: update wakeup reason before call recume() callback
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
@@ -168,6 +168,8 @@ static void handle_resume(struct mngr_msg *msg, int client_fd, void *param)
ack.msgid = msg->msgid;
ack.timestamp = msg->timestamp;
+ wakeup_reason = msg->data.reason;
+
LIST_FOREACH(ops, &vm_ops_head, list) {
if (ops->ops->resume) {
ret += ops->ops->resume(ops->arg);
@@ -181,8 +183,6 @@ static void handle_resume(struct mngr_msg *msg, int client_fd, void *param)
} else
ack.data.err = ret;
- wakeup_reason = msg->data.reason;
-
mngr_send_msg(client_fd, &ack, NULL, ACK_TIMEOUT);
}
