mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
hv: check vm state before creating a VM
If launch two UOS with same UUID by acrn-dm, current code path will return same VM instance to the acrn-dm, this will crash the two UOS. Check VM state and make sure it's in VM_STATE_INVALID state before creating a VM. Tracked-On: #2984 Signed-off-by: Cai Yulong <yulongc@hwtc.com.cn>
This commit is contained in:
committed by
ACRN System Integration
parent
fa47554054
commit
887d41683b
@@ -308,6 +308,7 @@ static void prepare_sos_vm_memmap(struct acrn_vm *vm)
|
||||
|
||||
/**
|
||||
* @pre vm_id < CONFIG_MAX_VM_NUM && vm_config != NULL && rtn_vm != NULL
|
||||
* @pre vm->state == VM_STATE_INVALID
|
||||
*/
|
||||
int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_vm **rtn_vm)
|
||||
{
|
||||
|
Reference in New Issue
Block a user