mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 07:21:15 +00:00
hypervisor: Fix clippy error on MSHV
This patch addresses this issue https://github.com/rust-lang/rust-bindgen/pull/2064. While we access field of packed struct the compiler can generate the correct code to create a temporary variable to access the packed struct field. Access withing {} ensures that. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
parent
49e061d15b
commit
652e30c97d
@ -393,22 +393,22 @@ impl cpu::Vcpu for MshvVcpu {
|
|||||||
}
|
}
|
||||||
hv_message_type_HVMSG_X64_CPUID_INTERCEPT => {
|
hv_message_type_HVMSG_X64_CPUID_INTERCEPT => {
|
||||||
let info = x.to_cpuid_info().unwrap();
|
let info = x.to_cpuid_info().unwrap();
|
||||||
debug!("cpuid eax: {:x}", info.rax);
|
debug!("cpuid eax: {:x}", { info.rax });
|
||||||
Ok(cpu::VmExit::Ignore)
|
Ok(cpu::VmExit::Ignore)
|
||||||
}
|
}
|
||||||
hv_message_type_HVMSG_X64_MSR_INTERCEPT => {
|
hv_message_type_HVMSG_X64_MSR_INTERCEPT => {
|
||||||
let info = x.to_msr_info().unwrap();
|
let info = x.to_msr_info().unwrap();
|
||||||
if info.header.intercept_access_type == 0 {
|
if info.header.intercept_access_type == 0 {
|
||||||
debug!("msr read: {:x}", info.msr_number);
|
debug!("msr read: {:x}", { info.msr_number });
|
||||||
} else {
|
} else {
|
||||||
debug!("msr write: {:x}", info.msr_number);
|
debug!("msr write: {:x}", { info.msr_number });
|
||||||
}
|
}
|
||||||
Ok(cpu::VmExit::Ignore)
|
Ok(cpu::VmExit::Ignore)
|
||||||
}
|
}
|
||||||
hv_message_type_HVMSG_X64_EXCEPTION_INTERCEPT => {
|
hv_message_type_HVMSG_X64_EXCEPTION_INTERCEPT => {
|
||||||
//TODO: Handler for VMCALL here.
|
//TODO: Handler for VMCALL here.
|
||||||
let info = x.to_exception_info().unwrap();
|
let info = x.to_exception_info().unwrap();
|
||||||
debug!("Exception Info {:?}", info.exception_vector);
|
debug!("Exception Info {:?}", { info.exception_vector });
|
||||||
Ok(cpu::VmExit::Ignore)
|
Ok(cpu::VmExit::Ignore)
|
||||||
}
|
}
|
||||||
exit => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
|
exit => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
|
||||||
|
Loading…
Reference in New Issue
Block a user