Skip to content

Commit 125dca7

Browse files
committed
hypervisor: Fix clippy error on MSHV
This patch addresses this issue rust-lang/rust-bindgen#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 <[email protected]>
1 parent c8833d5 commit 125dca7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hypervisor/src/mshv/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,22 +393,22 @@ impl cpu::Vcpu for MshvVcpu {
393393
}
394394
hv_message_type_HVMSG_X64_CPUID_INTERCEPT => {
395395
let info = x.to_cpuid_info().unwrap();
396-
debug!("cpuid eax: {:x}", info.rax);
396+
debug!("cpuid eax: {:x}", { info.rax });
397397
Ok(cpu::VmExit::Ignore)
398398
}
399399
hv_message_type_HVMSG_X64_MSR_INTERCEPT => {
400400
let info = x.to_msr_info().unwrap();
401401
if info.header.intercept_access_type == 0 {
402-
debug!("msr read: {:x}", info.msr_number);
402+
debug!("msr read: {:x}", { info.msr_number });
403403
} else {
404-
debug!("msr write: {:x}", info.msr_number);
404+
debug!("msr write: {:x}", { info.msr_number });
405405
}
406406
Ok(cpu::VmExit::Ignore)
407407
}
408408
hv_message_type_HVMSG_X64_EXCEPTION_INTERCEPT => {
409409
//TODO: Handler for VMCALL here.
410410
let info = x.to_exception_info().unwrap();
411-
debug!("Exception Info {:?}", info.exception_vector);
411+
debug!("Exception Info {:?}", { info.exception_vector });
412412
Ok(cpu::VmExit::Ignore)
413413
}
414414
exit => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(

0 commit comments

Comments
 (0)