mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-01 17:35:19 +00:00
vm: If a VCPU thread errors out then exit the hypervisor
Currently when the VCPU thread exits on an error the VMM continues to run with no way of shutting down the main thread. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
98f81c36ec
commit
451502b50b
@ -1781,6 +1781,7 @@ impl<'a> Vm<'a> {
|
||||
|
||||
let vcpu_thread_barrier = vcpu_thread_barrier.clone();
|
||||
|
||||
let exit_evt = self.devices.exit_evt.try_clone().unwrap();
|
||||
self.vcpus.push(
|
||||
thread::Builder::new()
|
||||
.name(format!("cloud-hypervisor_vcpu{}", vcpu.id))
|
||||
@ -1802,6 +1803,7 @@ impl<'a> Vm<'a> {
|
||||
vcpu_thread_barrier.wait();
|
||||
|
||||
while vcpu.run().is_ok() {}
|
||||
exit_evt.write(1).unwrap();
|
||||
})
|
||||
.map_err(Error::VcpuSpawn)?,
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user