hypervisor: replace #[allow(dead_code)] with expect()

On-behalf-of: SAP philipp.schuster@sap.com
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
Philipp Schuster
2026-06-03 14:36:12 +02:00
committed by Rob Bradford
parent 9a60472ace
commit 179d56ca72
2 changed files with 7 additions and 2 deletions

View File

@@ -562,10 +562,12 @@ struct KvmDirtyLogSlot {
guest_memfd: u32,
}
#[allow(dead_code)]
struct KvmMemorySlot {
#[cfg_attr(not(feature = "sev_snp"), expect(dead_code))]
guest_memfd: OwnedFd,
#[cfg_attr(not(feature = "sev_snp"), expect(dead_code))]
guest_phys_addr: u64,
#[cfg_attr(not(feature = "sev_snp"), expect(dead_code))]
memory_size: u64,
}

View File

@@ -439,7 +439,6 @@ unsafe impl Send for Ghcb {}
unsafe impl Sync for Ghcb {}
/// Vcpu struct for Microsoft Hypervisor
#[allow(dead_code)]
pub struct MshvVcpu {
fd: VcpuFd,
vp_index: u8,
@@ -448,6 +447,10 @@ pub struct MshvVcpu {
#[cfg(target_arch = "x86_64")]
msrs: Vec<MsrEntry>,
vm_ops: Option<Arc<dyn vm::VmOps>>,
#[cfg_attr(
all(not(target_arch = "x86_64"), not(feature = "sev_snp")),
expect(dead_code)
)]
vm_fd: Arc<VmFd>,
#[cfg(feature = "sev_snp")]
ghcb: Option<Ghcb>,