diff --git a/Cargo.lock b/Cargo.lock index a3f10c2432..1daba7ffda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1158,7 +1158,7 @@ dependencies = [ "resource", "runtime-spec", "strum 0.24.1", - "thiserror 1.0.69", + "thiserror 2.0.18", "tokio", ] @@ -1564,7 +1564,7 @@ dependencies = [ "lazy_static", "libc", "nix 0.31.3", - "thiserror 1.0.69", + "thiserror 2.0.18", "vm-memory", "vmm-sys-util 0.15.0", ] @@ -1573,7 +1573,7 @@ dependencies = [ name = "dbs-allocator" version = "0.1.1" dependencies = [ - "thiserror 1.0.69", + "thiserror 2.0.18", ] [[package]] @@ -1586,7 +1586,7 @@ dependencies = [ "memoffset 0.6.5", "nix 0.31.3", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "vm-memory", "vmm-sys-util 0.15.0", ] @@ -1604,7 +1604,7 @@ dependencies = [ "libc", "nix 0.31.3", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "vm-fdt", "vm-memory", ] @@ -1613,7 +1613,7 @@ dependencies = [ name = "dbs-device" version = "0.2.0" dependencies = [ - "thiserror 1.0.69", + "thiserror 2.0.18", ] [[package]] @@ -1664,7 +1664,7 @@ dependencies = [ "nix 0.31.3", "serde", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "vfio-bindings", "vfio-ioctls", "virtio-queue", @@ -1678,7 +1678,7 @@ dependencies = [ "dbs-utils", "dbs-virtio-devices", "log", - "thiserror 1.0.69", + "thiserror 2.0.18", "timerfd", ] @@ -1694,7 +1694,7 @@ dependencies = [ "serde", "serde_json", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "timerfd", "vmm-sys-util 0.15.0", ] @@ -1727,7 +1727,7 @@ dependencies = [ "serde", "serde_json", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "threadpool", "timerfd", "vhost", @@ -1948,7 +1948,7 @@ dependencies = [ "slog-term", "tdx", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "tracing", "vfio-bindings", "vfio-ioctls", @@ -3045,7 +3045,7 @@ dependencies = [ "tempfile", "test-utils", "tests_utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "tokio", "tracing", "ttrpc", @@ -3632,7 +3632,7 @@ dependencies = [ "strum_macros 0.26.4", "tempfile", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "tokio", "tokio-vsock 0.3.4", "toml", @@ -3731,7 +3731,7 @@ dependencies = [ "sys-info", "tempfile", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "tokio", "toml", "url", @@ -3802,7 +3802,7 @@ dependencies = [ "subprocess", "tempfile", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", ] [[package]] @@ -3857,7 +3857,7 @@ dependencies = [ "sysinfo", "tempfile", "test-utils", - "thiserror 1.0.69", + "thiserror 2.0.18", "tokio", "toml", ] @@ -5256,12 +5256,11 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "path-absolutize" -version = "1.2.1" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceeedc827d9a758b4641457683ced2f02d4252cc1bd8794c415ed20256114290" +checksum = "e4af381fe79fa195b4909485d99f73a80792331df0625188e707854f0b3383f5" dependencies = [ "path-dedot", - "slash-formatter", ] [[package]] @@ -5272,11 +5271,11 @@ checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" [[package]] name = "path-dedot" -version = "1.2.4" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c58ab1edb03f77d0bb3f08e4a179dd43ce9bc8eab9867ec53a78285ea3039b" +checksum = "07ba0ad7e047712414213ff67533e6dd477af0a4e1d14fb52343e53d30ea9397" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -5573,7 +5572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "059a34f111a9dee2ce1ac2826a68b24601c4298cfeb1a587c3cb493d5ab46f52" dependencies = [ "libc", - "nix 0.30.1", + "nix 0.31.3", ] [[package]] @@ -7397,7 +7396,7 @@ dependencies = [ "slog-scope", "slog-stdlog", "tempfile", - "thiserror 1.0.69", + "thiserror 2.0.18", "tokio", "unix_socket2", ] @@ -7502,12 +7501,6 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" -[[package]] -name = "slash-formatter" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7fb98e76e2022054673f3ebc43a4e12890ec6272530629df6237cafbb70569" - [[package]] name = "slog" version = "2.8.2" @@ -8932,7 +8925,7 @@ dependencies = [ "opentelemetry 0.17.0", "serde_json", "slog", - "thiserror 1.0.69", + "thiserror 2.0.18", "tokio", "tokio-vsock 0.3.4", ] diff --git a/Cargo.toml b/Cargo.toml index d5bd783028..46a796b950 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -199,7 +199,7 @@ strum = { version = "0.24.0", features = ["derive"] } strum_macros = "0.26.2" tdx = "0.1.1" tempfile = "3.19.1" -thiserror = "1.0.26" +thiserror = "2.0.18" tokio = "1.46.1" tokio-util = "0.7.17" tokio-vsock = "0.3.4" diff --git a/src/agent/rustjail/Cargo.toml b/src/agent/rustjail/Cargo.toml index 6240b3ce5f..6cfbbfdf0e 100644 --- a/src/agent/rustjail/Cargo.toml +++ b/src/agent/rustjail/Cargo.toml @@ -23,7 +23,7 @@ slog-scope.workspace = true scan_fmt.workspace = true safe-path.workspace = true regex.workspace = true -path-absolutize = "1.2.0" +path-absolutize = "3.1.1" anyhow = "1.0.32" cgroups.workspace = true rlimit = "0.5.3" diff --git a/src/dragonball/Cargo.toml b/src/dragonball/Cargo.toml index 42564ce87d..9317b13b07 100644 --- a/src/dragonball/Cargo.toml +++ b/src/dragonball/Cargo.toml @@ -43,7 +43,7 @@ serde_derive = "1.0.27" serde_json = "1.0.9" slog = "2.5.2" slog-scope = "4.4.0" -thiserror = "1" +thiserror = { workspace = true } tracing = "0.1.41" vmm-sys-util = { workspace = true } virtio-queue = { workspace = true, optional = true } diff --git a/src/dragonball/dbs_address_space/Cargo.toml b/src/dragonball/dbs_address_space/Cargo.toml index 8dff704448..302d7dd741 100644 --- a/src/dragonball/dbs_address_space/Cargo.toml +++ b/src/dragonball/dbs_address_space/Cargo.toml @@ -15,6 +15,6 @@ arc-swap = ">=0.4.8" libc = "0.2.39" nix = { workspace = true } lazy_static = "1" -thiserror = "1" +thiserror = { workspace = true } vmm-sys-util = { workspace = true } vm-memory = { workspace = true, features = ["backend-mmap", "backend-atomic"] } diff --git a/src/dragonball/dbs_allocator/Cargo.toml b/src/dragonball/dbs_allocator/Cargo.toml index c3c0f3c109..928a1607aa 100644 --- a/src/dragonball/dbs_allocator/Cargo.toml +++ b/src/dragonball/dbs_allocator/Cargo.toml @@ -11,4 +11,4 @@ keywords = ["dragonball"] readme = "README.md" [dependencies] -thiserror = "1.0" +thiserror = { workspace = true } diff --git a/src/dragonball/dbs_arch/Cargo.toml b/src/dragonball/dbs_arch/Cargo.toml index 1f7357671a..345404f015 100644 --- a/src/dragonball/dbs_arch/Cargo.toml +++ b/src/dragonball/dbs_arch/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" memoffset = "0.6" kvm-bindings = { workspace = true, features = ["fam-wrappers"] } kvm-ioctls = {workspace = true} -thiserror = "1" +thiserror = { workspace = true } vm-memory = { workspace = true } vmm-sys-util = {workspace = true} libc = ">=0.2.39" diff --git a/src/dragonball/dbs_boot/Cargo.toml b/src/dragonball/dbs_boot/Cargo.toml index 3914c51062..962c26274f 100644 --- a/src/dragonball/dbs_boot/Cargo.toml +++ b/src/dragonball/dbs_boot/Cargo.toml @@ -16,7 +16,7 @@ kvm-bindings = { workspace = true, features = ["fam-wrappers"] } kvm-ioctls = {workspace = true} lazy_static = "1" libc = "0.2.39" -thiserror = "1" +thiserror = { workspace = true } vm-memory = {workspace = true} vm-fdt = {workspace= true} diff --git a/src/dragonball/dbs_device/Cargo.toml b/src/dragonball/dbs_device/Cargo.toml index 594698ce29..c7d83a5027 100644 --- a/src/dragonball/dbs_device/Cargo.toml +++ b/src/dragonball/dbs_device/Cargo.toml @@ -11,4 +11,4 @@ keywords = ["dragonball", "secure-sandbox", "device", "resource"] readme = "README.md" [dependencies] -thiserror = "1" +thiserror = { workspace = true } diff --git a/src/dragonball/dbs_pci/Cargo.toml b/src/dragonball/dbs_pci/Cargo.toml index 2fe3ef7d54..8509dd43e1 100644 --- a/src/dragonball/dbs_pci/Cargo.toml +++ b/src/dragonball/dbs_pci/Cargo.toml @@ -12,7 +12,7 @@ readme = "README.md" [dependencies] log = "0.4.14" -thiserror = "1" +thiserror = { workspace = true } dbs-allocator = { workspace = true } dbs-boot = { workspace = true } dbs-device = { workspace = true } diff --git a/src/dragonball/dbs_pci/src/lib.rs b/src/dragonball/dbs_pci/src/lib.rs index ed700ffaa7..930653700d 100644 --- a/src/dragonball/dbs_pci/src/lib.rs +++ b/src/dragonball/dbs_pci/src/lib.rs @@ -93,7 +93,7 @@ pub enum Error { #[error("bar {0} already used")] BarInUse(usize), /// PCI BAR is invalid. - #[error("bar {0} invalid, max {}", NUM_BAR_REGS - 1)] + #[error("bar {0} invalid, max {max}", max = NUM_BAR_REGS - 1)] BarInvalid(usize), /// PCI BAR size is invalid. #[error("bar address {0} not a power of two")] @@ -102,13 +102,16 @@ pub enum Error { #[error("address {0} size {1} too big")] BarAddressInvalid(u64, u64), /// 64 bits MMIO PCI BAR is invalid. - #[error("64 bit bar {0} invalid, requires two regs, max {}", NUM_BAR_REGS - 1)] + #[error( + "64 bit bar {0} invalid, requires two regs, max {max}", + max = NUM_BAR_REGS - 1 + )] BarInvalid64(usize), /// 64 bits MMIO PCI BAR is in use. #[error("64bit bar {0} already used(requires two regs)")] BarInUse64(usize), /// PCI ROM BAR is invalid. - #[error("ROM bar {0} invalid, max {}", NUM_BAR_REGS - 1)] + #[error("ROM bar {0} invalid, max {max}", max = NUM_BAR_REGS - 1)] RomBarInvalid(usize), /// PCI ROM BAR is already in use. #[error("rom bar {0} already used")] diff --git a/src/dragonball/dbs_upcall/Cargo.toml b/src/dragonball/dbs_upcall/Cargo.toml index 290d81b268..6ac35162fb 100755 --- a/src/dragonball/dbs_upcall/Cargo.toml +++ b/src/dragonball/dbs_upcall/Cargo.toml @@ -12,7 +12,7 @@ readme = "README.md" [dependencies] log = "0.4.14" -thiserror = "1" +thiserror = { workspace = true } timerfd = "1.2.0" dbs-utils = { workspace = true } diff --git a/src/dragonball/dbs_utils/Cargo.toml b/src/dragonball/dbs_utils/Cargo.toml index 2b22c2f520..52f89481a3 100644 --- a/src/dragonball/dbs_utils/Cargo.toml +++ b/src/dragonball/dbs_utils/Cargo.toml @@ -16,7 +16,7 @@ event-manager = { workspace = true, features = [ "remote_endpoint" ] } libc = "0.2.39" log = "0.4.14" serde = { version = "1.0.27", features = ["derive", "rc"] } -thiserror = "1.0" +thiserror = { workspace = true } timerfd = "1.0" vmm-sys-util = {workspace = true} diff --git a/src/dragonball/dbs_virtio_devices/Cargo.toml b/src/dragonball/dbs_virtio_devices/Cargo.toml index 01878569f1..2b13dbc133 100644 --- a/src/dragonball/dbs_virtio_devices/Cargo.toml +++ b/src/dragonball/dbs_virtio_devices/Cargo.toml @@ -36,7 +36,7 @@ nydus-storage = "0.7.2" rlimit = "0.7.0" serde = "1.0.27" serde_json = "1.0.9" -thiserror = "1" +thiserror = { workspace = true } threadpool = "1" virtio-bindings = { workspace = true } virtio-queue = { workspace = true } diff --git a/src/dragonball/src/api/v1/machine_config.rs b/src/dragonball/src/api/v1/machine_config.rs index 7d78f3e443..242dc8d75f 100644 --- a/src/dragonball/src/api/v1/machine_config.rs +++ b/src/dragonball/src/api/v1/machine_config.rs @@ -59,8 +59,8 @@ pub enum VmConfigError { /// The hotplug memory size is invalid. The memory can only be an unsigned integer. #[error( - "the hotplug memory size '{0}' (MiB) is invalid, must be multiple of {}", - MEMORY_HOTPLUG_ALIGHMENT + "the hotplug memory size '{0}' (MiB) is invalid, must be multiple of {alignment}", + alignment = MEMORY_HOTPLUG_ALIGHMENT )] InvalidHotplugMemorySize(usize), diff --git a/src/libs/kata-sys-util/Cargo.toml b/src/libs/kata-sys-util/Cargo.toml index a4069c9d2e..3538cb3e6a 100644 --- a/src/libs/kata-sys-util/Cargo.toml +++ b/src/libs/kata-sys-util/Cargo.toml @@ -23,7 +23,7 @@ slog = "2.5.2" slog-scope = "4.4.0" subprocess = "0.2.8" rand = { version = "0.10.1", features = ["std", "std_rng", "thread_rng"] } -thiserror = "1.0.30" +thiserror = { workspace = true } hex = "0.4.3" pci-ids = "0.2.6" diff --git a/src/libs/kata-sys-util/src/pcilibs/pci_manager.rs b/src/libs/kata-sys-util/src/pcilibs/pci_manager.rs index 4e6d289ea7..3684c1e4d1 100644 --- a/src/libs/kata-sys-util/src/pcilibs/pci_manager.rs +++ b/src/libs/kata-sys-util/src/pcilibs/pci_manager.rs @@ -179,7 +179,6 @@ mod tests { use super::*; use std::fs; use std::io::Write; - use std::path::PathBuf; // domain number const TEST_PCI_DEV_DOMAIN: &str = "0000"; diff --git a/src/libs/kata-types/Cargo.toml b/src/libs/kata-types/Cargo.toml index 6713bd8663..94e58e9c01 100644 --- a/src/libs/kata-types/Cargo.toml +++ b/src/libs/kata-types/Cargo.toml @@ -23,7 +23,7 @@ serde = { version = "1.0.100", features = ["derive"] } slog = "2.5.2" slog-scope = "4.4.0" serde_json = "1.0.73" -thiserror = "1.0" +thiserror = { workspace = true } toml = "0.5.8" serde-enum-str = "0.5" sysinfo = "0.34.2" diff --git a/src/runtime-rs/crates/hypervisor/ch-config/Cargo.toml b/src/runtime-rs/crates/hypervisor/ch-config/Cargo.toml index d296b1a035..e9606fb614 100644 --- a/src/runtime-rs/crates/hypervisor/ch-config/Cargo.toml +++ b/src/runtime-rs/crates/hypervisor/ch-config/Cargo.toml @@ -16,7 +16,7 @@ serde = { workspace = true, features = ["rc", "derive"] } serde_json = { workspace = true } tokio = { workspace = true, features = ["sync", "rt"] } nix = { workspace = true } -thiserror = "2.0.18" +thiserror = { workspace = true } # Cloud Hypervisor public HTTP API functions # Note that the version specified is not necessarily the version of CH