From 4f68b687aa02d39f60ca47e977159942430483c7 Mon Sep 17 00:00:00 2001 From: Tushar Khatri Date: Thu, 11 Jun 2026 15:39:51 +0000 Subject: [PATCH] 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 --- virtio-devices/src/balloon.rs | 2 +- virtio-devices/src/block.rs | 2 +- virtio-devices/src/console.rs | 2 +- virtio-devices/src/mem.rs | 2 +- virtio-devices/src/net.rs | 6 +++--- virtio-devices/src/pmem.rs | 2 +- virtio-devices/src/thread_helper.rs | 2 +- virtio-devices/src/transport/pci_device.rs | 2 +- virtio-devices/src/vhost_user/fs.rs | 2 +- virtio-devices/src/vhost_user/generic_vhost_user.rs | 2 +- virtio-devices/src/vhost_user/mod.rs | 2 +- virtio-devices/src/vhost_user/net.rs | 2 +- virtio-devices/src/vhost_user/vu_common_ctrl.rs | 4 ++-- virtio-devices/src/vsock/device.rs | 2 +- virtio-devices/src/vsock/mod.rs | 4 ++-- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/virtio-devices/src/balloon.rs b/virtio-devices/src/balloon.rs index cb1a37ba5..4d7bf0239 100644 --- a/virtio-devices/src/balloon.rs +++ b/virtio-devices/src/balloon.rs @@ -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, diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index 04831f871..de142525b 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -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, diff --git a/virtio-devices/src/console.rs b/virtio-devices/src/console.rs index 567ba6a71..30b84d578 100644 --- a/virtio-devices/src/console.rs +++ b/virtio-devices/src/console.rs @@ -131,7 +131,7 @@ impl Endpoint { } impl ConsoleEpollHandler { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] fn new( mem: GuestMemoryAtomic, input_queue: Queue, diff --git a/virtio-devices/src/mem.rs b/virtio-devices/src/mem.rs index f9880fddb..a59ec484c 100644 --- a/virtio-devices/src/mem.rs +++ b/virtio-devices/src/mem.rs @@ -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, diff --git a/virtio-devices/src/net.rs b/virtio-devices/src/net.rs index c26fba41c..cdcc59591 100644 --- a/virtio-devices/src/net.rs +++ b/virtio-devices/src/net.rs @@ -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, @@ -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], diff --git a/virtio-devices/src/pmem.rs b/virtio-devices/src/pmem.rs index 9f3b58099..001b5c372 100644 --- a/virtio-devices/src/pmem.rs +++ b/virtio-devices/src/pmem.rs @@ -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, diff --git a/virtio-devices/src/thread_helper.rs b/virtio-devices/src/thread_helper.rs index fc8e3ddb9..08614fc4d 100644 --- a/virtio-devices/src/thread_helper.rs +++ b/virtio-devices/src/thread_helper.rs @@ -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( name: &str, seccomp_action: &SeccompAction, diff --git a/virtio-devices/src/transport/pci_device.rs b/virtio-devices/src/transport/pci_device.rs index b8a12c156..6bbe9c6c1 100644 --- a/virtio-devices/src/transport/pci_device.rs +++ b/virtio-devices/src/transport/pci_device.rs @@ -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, diff --git a/virtio-devices/src/vhost_user/fs.rs b/virtio-devices/src/vhost_user/fs.rs index 7f1ae385c..708ff3da9 100644 --- a/virtio-devices/src/vhost_user/fs.rs +++ b/virtio-devices/src/vhost_user/fs.rs @@ -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, diff --git a/virtio-devices/src/vhost_user/generic_vhost_user.rs b/virtio-devices/src/vhost_user/generic_vhost_user.rs index 4d403c0cd..507ddd3d6 100644 --- a/virtio-devices/src/vhost_user/generic_vhost_user.rs +++ b/virtio-devices/src/vhost_user/generic_vhost_user.rs @@ -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, diff --git a/virtio-devices/src/vhost_user/mod.rs b/virtio-devices/src/vhost_user/mod.rs index 1974ca80d..1cb1fecd0 100644 --- a/virtio-devices/src/vhost_user/mod.rs +++ b/virtio-devices/src/vhost_user/mod.rs @@ -473,7 +473,7 @@ pub struct VhostUserCommon { } impl VhostUserCommon { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn activate( &mut self, mem: GuestMemoryAtomic, diff --git a/virtio-devices/src/vhost_user/net.rs b/virtio-devices/src/vhost_user/net.rs index e54e2c2bc..f37c5e0fe 100644 --- a/virtio-devices/src/vhost_user/net.rs +++ b/virtio-devices/src/vhost_user/net.rs @@ -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, diff --git a/virtio-devices/src/vhost_user/vu_common_ctrl.rs b/virtio-devices/src/vhost_user/vu_common_ctrl.rs index 23a37c335..9788484ca 100644 --- a/virtio-devices/src/vhost_user/vu_common_ctrl.rs +++ b/virtio-devices/src/vhost_user/vu_common_ctrl.rs @@ -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( &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( &mut self, mem: &GuestMemoryMmap, diff --git a/virtio-devices/src/vsock/device.rs b/virtio-devices/src/vsock/device.rs index b3b4bddf8..33755ddaa 100644 --- a/virtio-devices/src/vsock/device.rs +++ b/virtio-devices/src/vsock/device.rs @@ -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, diff --git a/virtio-devices/src/vsock/mod.rs b/virtio-devices/src/vsock/mod.rs index 616f0c18a..d18e61b0d 100644 --- a/virtio-devices/src/vsock/mod.rs +++ b/virtio-devices/src/vsock/mod.rs @@ -205,7 +205,7 @@ pub mod unit_tests { pub evset: Option, } 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;