mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 11:22:26 +00:00
This is required as the VcpuFd::run and VcpuFd::set_immediate_exit methods now take a &mut self. I explored alternative solutions: 1. Using RefCell for runtime interior mutability - the Vcpu trait is Sync and it's not possible to use RefCell with types that are Sync. 2. Using UnsafeCell - the mutable reference nature of ::run and and ::set_kvm_immediate_exit was added for a reason so it unwise to bypass this. 3. Adjusting the trait interface to expose the &mut self - this requires an Arc<Mutex<>> around the hypervisor::vcpu::Vcpu object and was very intrusive. Signed-off-by: Rob Bradford <rbradford@rivosinc.com>