hv: move out pause_vm from shutdown_vm

now it will call pause_vm in shutdown_vm,
move it out from shutdown_vm to reduce coupling.
Tracked-On: #4320
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi 2020-01-02 14:07:23 +08:00 committed by wenlingz
parent fc5292e354
commit fe929d0a10
3 changed files with 2 additions and 3 deletions

View File

@ -160,7 +160,7 @@ static inline void enter_s5(struct acrn_vm *vm, uint32_t pm1a_cnt_val, uint32_t
if (is_sos_vm(vm)) {
save_s5_reg_val(pm1a_cnt_val, pm1b_cnt_val);
}
pause_vm(vm);
(void)shutdown_vm(vm);
}

View File

@ -584,8 +584,6 @@ int32_t shutdown_vm(struct acrn_vm *vm)
struct acrn_vm_config *vm_config = NULL;
int32_t ret = 0;
pause_vm(vm);
/* Only allow shutdown paused vm */
if (vm->state == VM_PAUSED) {
vm->state = VM_POWERED_OFF;

View File

@ -39,6 +39,7 @@ void triple_fault_shutdown_vm(struct acrn_vcpu *vcpu)
struct acrn_vm *pl_vm = get_vm_from_vmid(vm_id);
if (!is_poweroff_vm(pl_vm) && is_postlaunched_vm(pl_vm) && !is_rt_vm(pl_vm)) {
pause_vm(pl_vm);
(void)shutdown_vm(pl_vm);
}
}