mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
virtio-devices: Use #[allow(dead_code)] for unread structs
These structs are not read on the VMM side but are used in communication with the guest. As identified by the new beta clippy. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
e9ea9d63f8
commit
84f0f332b3
@ -75,6 +75,7 @@ const VIRTIO_IOMMU_PAGE_SIZE_MASK: u64 = (2 << 20) | (4 << 10);
|
|||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct VirtioIommuRange32 {
|
struct VirtioIommuRange32 {
|
||||||
start: u32,
|
start: u32,
|
||||||
end: u32,
|
end: u32,
|
||||||
@ -84,6 +85,7 @@ unsafe impl ByteValued for VirtioIommuRange32 {}
|
|||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct VirtioIommuRange64 {
|
struct VirtioIommuRange64 {
|
||||||
start: u64,
|
start: u64,
|
||||||
end: u64,
|
end: u64,
|
||||||
@ -93,13 +95,14 @@ unsafe impl ByteValued for VirtioIommuRange64 {}
|
|||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct VirtioIommuConfig {
|
struct VirtioIommuConfig {
|
||||||
page_size_mask: u64,
|
page_size_mask: u64,
|
||||||
input_range: VirtioIommuRange64,
|
input_range: VirtioIommuRange64,
|
||||||
domain_range: VirtioIommuRange32,
|
domain_range: VirtioIommuRange32,
|
||||||
probe_size: u32,
|
probe_size: u32,
|
||||||
bypass: u8,
|
bypass: u8,
|
||||||
reserved: [u8; 7],
|
_reserved: [u8; 7],
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ByteValued for VirtioIommuConfig {}
|
unsafe impl ByteValued for VirtioIommuConfig {}
|
||||||
@ -115,7 +118,7 @@ const VIRTIO_IOMMU_T_PROBE: u8 = 5;
|
|||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
struct VirtioIommuReqHead {
|
struct VirtioIommuReqHead {
|
||||||
type_: u8,
|
type_: u8,
|
||||||
reserved: [u8; 3],
|
_reserved: [u8; 3],
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ByteValued for VirtioIommuReqHead {}
|
unsafe impl ByteValued for VirtioIommuReqHead {}
|
||||||
@ -141,9 +144,10 @@ const VIRTIO_IOMMU_S_NOMEM: u8 = 8;
|
|||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct VirtioIommuReqTail {
|
struct VirtioIommuReqTail {
|
||||||
status: u8,
|
status: u8,
|
||||||
reserved: [u8; 3],
|
_reserved: [u8; 3],
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ByteValued for VirtioIommuReqTail {}
|
unsafe impl ByteValued for VirtioIommuReqTail {}
|
||||||
@ -154,7 +158,7 @@ unsafe impl ByteValued for VirtioIommuReqTail {}
|
|||||||
struct VirtioIommuReqAttach {
|
struct VirtioIommuReqAttach {
|
||||||
domain: u32,
|
domain: u32,
|
||||||
endpoint: u32,
|
endpoint: u32,
|
||||||
reserved: [u8; 8],
|
_reserved: [u8; 8],
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ByteValued for VirtioIommuReqAttach {}
|
unsafe impl ByteValued for VirtioIommuReqAttach {}
|
||||||
@ -165,7 +169,7 @@ unsafe impl ByteValued for VirtioIommuReqAttach {}
|
|||||||
struct VirtioIommuReqDetach {
|
struct VirtioIommuReqDetach {
|
||||||
domain: u32,
|
domain: u32,
|
||||||
endpoint: u32,
|
endpoint: u32,
|
||||||
reserved: [u8; 8],
|
_reserved: [u8; 8],
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ByteValued for VirtioIommuReqDetach {}
|
unsafe impl ByteValued for VirtioIommuReqDetach {}
|
||||||
@ -189,7 +193,7 @@ struct VirtioIommuReqMap {
|
|||||||
virt_start: u64,
|
virt_start: u64,
|
||||||
virt_end: u64,
|
virt_end: u64,
|
||||||
phys_start: u64,
|
phys_start: u64,
|
||||||
flags: u32,
|
_flags: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ByteValued for VirtioIommuReqMap {}
|
unsafe impl ByteValued for VirtioIommuReqMap {}
|
||||||
@ -201,7 +205,7 @@ struct VirtioIommuReqUnmap {
|
|||||||
domain: u32,
|
domain: u32,
|
||||||
virt_start: u64,
|
virt_start: u64,
|
||||||
virt_end: u64,
|
virt_end: u64,
|
||||||
reserved: [u8; 4],
|
_reserved: [u8; 4],
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ByteValued for VirtioIommuReqUnmap {}
|
unsafe impl ByteValued for VirtioIommuReqUnmap {}
|
||||||
@ -216,15 +220,17 @@ const VIRTIO_IOMMU_PROBE_T_MASK: u16 = 0xfff;
|
|||||||
/// PROBE request
|
/// PROBE request
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct VirtioIommuReqProbe {
|
struct VirtioIommuReqProbe {
|
||||||
endpoint: u32,
|
endpoint: u32,
|
||||||
reserved: [u64; 8],
|
_reserved: [u64; 8],
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl ByteValued for VirtioIommuReqProbe {}
|
unsafe impl ByteValued for VirtioIommuReqProbe {}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct VirtioIommuProbeProperty {
|
struct VirtioIommuProbeProperty {
|
||||||
type_: u16,
|
type_: u16,
|
||||||
length: u16,
|
length: u16,
|
||||||
@ -239,9 +245,10 @@ const VIRTIO_IOMMU_RESV_MEM_T_MSI: u8 = 1;
|
|||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
|
#[allow(dead_code)]
|
||||||
struct VirtioIommuProbeResvMem {
|
struct VirtioIommuProbeResvMem {
|
||||||
subtype: u8,
|
subtype: u8,
|
||||||
reserved: [u8; 3],
|
_reserved: [u8; 3],
|
||||||
start: u64,
|
start: u64,
|
||||||
end: u64,
|
end: u64,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user