From 652e30c97dff5d7308633a3371d88a62bceb9288 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Tue, 22 Jun 2021 08:11:07 -0700 Subject: [PATCH] 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 --- hypervisor/src/mshv/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index c903010c4..59de7e82f 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -393,22 +393,22 @@ impl cpu::Vcpu for MshvVcpu { } hv_message_type_HVMSG_X64_CPUID_INTERCEPT => { let info = x.to_cpuid_info().unwrap(); - debug!("cpuid eax: {:x}", info.rax); + debug!("cpuid eax: {:x}", { info.rax }); Ok(cpu::VmExit::Ignore) } hv_message_type_HVMSG_X64_MSR_INTERCEPT => { let info = x.to_msr_info().unwrap(); if info.header.intercept_access_type == 0 { - debug!("msr read: {:x}", info.msr_number); + debug!("msr read: {:x}", { info.msr_number }); } else { - debug!("msr write: {:x}", info.msr_number); + debug!("msr write: {:x}", { info.msr_number }); } Ok(cpu::VmExit::Ignore) } hv_message_type_HVMSG_X64_EXCEPTION_INTERCEPT => { //TODO: Handler for VMCALL here. let info = x.to_exception_info().unwrap(); - debug!("Exception Info {:?}", info.exception_vector); + debug!("Exception Info {:?}", { info.exception_vector }); Ok(cpu::VmExit::Ignore) } exit => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(