mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: simplify LapicState
Both KVM and MSHV share the same layout. We can drop one level of indirection. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -298,18 +298,13 @@ impl From<FpuState> for kvm_fpu {
|
||||
|
||||
impl From<LapicState> for kvm_lapic_state {
|
||||
fn from(s: LapicState) -> Self {
|
||||
match s {
|
||||
LapicState::Kvm(s) => s,
|
||||
/* Needed in case other hypervisors are enabled */
|
||||
#[allow(unreachable_patterns)]
|
||||
_ => panic!("LapicState is not valid"),
|
||||
}
|
||||
Self { regs: s.regs }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<kvm_lapic_state> for LapicState {
|
||||
fn from(s: kvm_lapic_state) -> Self {
|
||||
LapicState::Kvm(s)
|
||||
Self { regs: s.regs }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user