You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(test): Eliminate mocking/cfg(not(test)) from vcpu/mod.rs
Separate the call to `KVM_RUN` from the handling of the result value.
This makes the handling of the `VcpuExit` unit-testable without needing
to hack in `cfg(not(test))` code that compiles out the `KVM_RUN` call at
compile time.
For this, separate the parts of KvmVcpu that the exit handler needs
mutable access to into a `Peripherals` structure, which is passed to
`handle_kvm_exit`. This is needed so that we can shared the `&mut` to
`kvm_vcpu` into `fd` and "the rest".
Co-Authored-By: Egor Lazarchuk <[email protected]>
Signed-off-by: Patrick Roy <[email protected]>
0 commit comments