mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
tools: acrn-manager: fix a race condition on updating VM state
For a running or suspended VM, its state is updated in 2 steps. It is first set to VM_CREATED, then set to VM_STARTED/VM_PAUSED. IF one thread check a running/suspend VM, it may get wrong state VM_CREATED, while another thread is updating the VMs state. Tracked-On: #2716 Signed-off-by: Tao Yuhong <yuhong.tao@intel.com> Acked-by: Yan, Like <like.yan@intel.com>
This commit is contained in:
committed by
wenlingz
parent
d5ec844f86
commit
5d6f6ab798
@@ -38,6 +38,7 @@ struct vmmngr_struct *vmmngr_find(const char *vmname);
|
||||
struct vmmngr_struct {
|
||||
char name[MAX_NAME_LEN];
|
||||
unsigned long state;
|
||||
unsigned long state_tmp;
|
||||
unsigned long update; /* update count, remove a vm if no update for it */
|
||||
LIST_ENTRY(vmmngr_struct) list;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user