From 9dcd0c37f396a79575d10f39b30e516fed4dade6 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 23 Jun 2020 13:12:44 +0100 Subject: [PATCH] vmm: cpu: Clear the "kill" flag on vCPU to support reuse After the vCPU has been ejected and the thread shutdown it is useful to clear the "kill" flag so that if the vCPU is reused it does not immediately exit upon thread recreation. Signed-off-by: Rob Bradford --- vmm/src/cpu.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index f8e5ac724..237cd1ec7 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -900,6 +900,10 @@ impl CpuManager { state.signal_thread(); state.join_thread()?; state.handle = None; + + // Once the thread has exited, clear the "kill" so that it can reused + state.kill.store(false, Ordering::SeqCst); + Ok(()) }