From d75a0ccbd111e9e49063d795110f29e060b53b00 Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Thu, 30 Jan 2025 16:33:10 +0000 Subject: [PATCH] dragonball: Allow test-mock feature Clippy fails with: ``` warning: unexpected `cfg` condition value: `test-mock` --> /root/go/src/github.com/kata-containers/kata-containers/src/dragonball/src/dbs_pci/src/vfio.rs:1929:17 | 1929 | #[cfg(all(test, feature = "test-mock"))] | ^^^^^^^^^^^^^^^^^^^^^ help: remove the condition | = note: no expected values for `feature` = help: consider adding `test-mock` as a feature in `Cargo.toml` ``` So add it as an expected cfg in the linter to skip this Signed-off-by: stevenhorsman --- src/dragonball/Cargo.toml | 7 ++++++- src/dragonball/src/dbs_pci/Cargo.toml | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/dragonball/Cargo.toml b/src/dragonball/Cargo.toml index 3b45ca4dc1..88902ebd51 100644 --- a/src/dragonball/Cargo.toml +++ b/src/dragonball/Cargo.toml @@ -50,7 +50,7 @@ vm-memory = { version = "0.10.0", features = ["backend-mmap"] } crossbeam-channel = "0.5.6" fuse-backend-rs = "0.10.5" vfio-bindings = { version = "0.3.0", optional = true } -vfio-ioctls = { version = "0.1.0", optional = true } +vfio-ioctls = { version = "0.1.0", optional = true } [dev-dependencies] slog-async = "2.7.0" @@ -81,3 +81,8 @@ vhost-user-fs = ["dbs-virtio-devices/vhost-user-fs"] vhost-user-net = ["dbs-virtio-devices/vhost-user-net"] vhost-user-blk = ["dbs-virtio-devices/vhost-user-blk"] host-device = ["dep:vfio-bindings", "dep:vfio-ioctls", "dep:dbs-pci"] + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = [ + 'cfg(feature, values("test-mock"))', +] } diff --git a/src/dragonball/src/dbs_pci/Cargo.toml b/src/dragonball/src/dbs_pci/Cargo.toml index 7dfc8c9344..70aa2a0be1 100644 --- a/src/dragonball/src/dbs_pci/Cargo.toml +++ b/src/dragonball/src/dbs_pci/Cargo.toml @@ -9,14 +9,18 @@ homepage = "https://github.com/openanolis/dragonball-sandbox" repository = "https://github.com/openanolis/dragonball-sandbox/tree/main/crates/dbs-pci" keywords = ["dragonball", "secure-sandbox", "devices", "pci"] readme = "README.md" - + [dependencies] log = "0.4.14" thiserror = "1" dbs-allocator = { path = "../dbs_allocator" } dbs-boot = { path = "../dbs_boot" } dbs-device = { path = "../dbs_device" } -dbs-interrupt = { path = "../dbs_interrupt", features = ["kvm-irq", "kvm-legacy-irq", "kvm-msi-irq"] } +dbs-interrupt = { path = "../dbs_interrupt", features = [ + "kvm-irq", + "kvm-legacy-irq", + "kvm-msi-irq", +] } downcast-rs = "1.2.0" byteorder = "1.4.3" vm-memory = "0.10.0" @@ -28,4 +32,9 @@ libc = "0.2.39" [dev-dependencies] dbs-arch = { path = "../dbs_arch" } -kvm-ioctls = "0.12.0" \ No newline at end of file +kvm-ioctls = "0.12.0" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = [ + 'cfg(feature, values("test-mock"))', +] }