virtio-devices: reevaluate #[allow] attributes

Convert the still-needed #[allow]s to #[expect] so they warn if the
lints stop firing.

Part of #8326.

Signed-off-by: Tushar Khatri <hello@tusharkhatri.in>
This commit is contained in:
Tushar Khatri
2026-06-11 15:39:51 +00:00
committed by Rob Bradford
parent 712d42e6ac
commit 4f68b687aa
15 changed files with 19 additions and 19 deletions

View File

@@ -493,7 +493,7 @@ pub struct Balloon {
impl Balloon {
// Create a new virtio-balloon.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
size: u64,

View File

@@ -737,7 +737,7 @@ pub struct BlockState {
impl Block {
/// Create a new virtio block device that operates on the given file.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
disk_image: Box<dyn AsyncFullDiskFile>,

View File

@@ -131,7 +131,7 @@ impl Endpoint {
}
impl ConsoleEpollHandler {
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
fn new(
mem: GuestMemoryAtomic<GuestMemoryMmap>,
input_queue: Queue,

View File

@@ -746,7 +746,7 @@ pub struct Mem {
impl Mem {
// Create a new virtio-mem device.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
region: &Arc<GuestRegionMmap>,

View File

@@ -416,7 +416,7 @@ pub struct NetState {
impl Net {
/// Create a new virtio network device with the given TAP interface.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new_with_tap(
id: String,
taps: Vec<Tap>,
@@ -528,7 +528,7 @@ impl Net {
/// Create a new virtio network device with the given IP address and
/// netmask.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
if_name: Option<&str>,
@@ -576,7 +576,7 @@ impl Net {
)
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn from_tap_fds(
id: String,
fds: &[RawFd],

View File

@@ -282,7 +282,7 @@ pub struct PmemState {
}
impl Pmem {
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
disk: File,

View File

@@ -16,7 +16,7 @@ use crate::epoll_helper::EpollHelperError;
use crate::seccomp_filters::{Thread, get_seccomp_filter};
use crate::{ActivateError, VirtioInterrupt, mark_device_needs_reset};
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub(crate) fn spawn_virtio_thread<F>(
name: &str,
seccomp_action: &SeccompAction,

View File

@@ -418,7 +418,7 @@ pub struct VirtioPciDevice {
impl VirtioPciDevice {
/// Constructs a new PCI transport for the given virtio device.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
memory: GuestMemoryAtomic<GuestMemoryMmap>,

View File

@@ -71,7 +71,7 @@ pub struct Fs {
impl Fs {
/// Create a new virtio-fs device.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
path: &str,

View File

@@ -59,7 +59,7 @@ pub struct GenericVhostUser {
impl GenericVhostUser {
/// Create a new generic vhost-user device.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
path: &str,

View File

@@ -473,7 +473,7 @@ pub struct VhostUserCommon {
}
impl VhostUserCommon {
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn activate<T: VhostUserFrontendReqHandler>(
&mut self,
mem: GuestMemoryAtomic<GuestMemoryMmap>,

View File

@@ -49,7 +49,7 @@ pub struct Net {
impl Net {
/// Create a new vhost-user-net device
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
mac_addr: MacAddr,

View File

@@ -159,7 +159,7 @@ impl VhostUserHandle {
Ok((acked_features, acked_protocol_features.bits()))
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn setup_vhost_user<S: VhostUserFrontendReqHandler>(
&mut self,
mem: &GuestMemoryMmap,
@@ -352,7 +352,7 @@ impl VhostUserHandle {
Ok(())
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn reinitialize_vhost_user<S: VhostUserFrontendReqHandler>(
&mut self,
mem: &GuestMemoryMmap,

View File

@@ -366,7 +366,7 @@ where
{
/// Create a new virtio-vsock device with the given VM CID and vsock
/// backend.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
id: String,
cid: u32,

View File

@@ -205,7 +205,7 @@ pub mod unit_tests {
pub evset: Option<epoll::Events>,
}
impl TestBackend {
#[allow(clippy::new_without_default)]
#[expect(clippy::new_without_default)]
pub fn new() -> Self {
Self {
evfd: EventFd::new(EFD_NONBLOCK).unwrap(),
@@ -270,7 +270,7 @@ pub mod unit_tests {
}
impl TestContext {
#[allow(clippy::new_without_default)]
#[expect(clippy::new_without_default)]
pub fn new() -> Self {
const CID: u32 = 52;
const MEM_SIZE: usize = 1024 * 1024 * 128;