From 17c4f4852fb0bf0918018fba54b981d9854d4195 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 20:32:31 +0000 Subject: [PATCH 1/4] Bump kvm-ioctls from 0.17.0 to 0.19.1 Bumps [kvm-ioctls](https://github.com/rust-vmm/kvm) from 0.17.0 to 0.19.1. - [Release notes](https://github.com/rust-vmm/kvm/releases) - [Changelog](https://github.com/rust-vmm/kvm/blob/v0.19.1/CHANGELOG.md) - [Commits](https://github.com/rust-vmm/kvm/compare/v0.17.0...v0.19.1) --- updated-dependencies: - dependency-name: kvm-ioctls dependency-version: 0.19.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Cargo.lock | 19 ++++++++++++++----- Cargo.toml | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf90565..815da6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "anstream" @@ -133,7 +133,7 @@ dependencies = [ "clap", "core_affinity", "enum_dispatch", - "kvm-bindings", + "kvm-bindings 0.8.1", "kvm-ioctls", "serde", "serde_json", @@ -201,14 +201,23 @@ dependencies = [ "vmm-sys-util", ] +[[package]] +name = "kvm-bindings" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4933174d0cc4b77b958578cd45784071cc5ae212c2d78fbd755aaaa6dfa71a" +dependencies = [ + "vmm-sys-util", +] + [[package]] name = "kvm-ioctls" -version = "0.17.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedae2ca4a531bebe311abaf9691f5cc14eaa21475243caa2e39c43bb872947d" +checksum = "e013ae7fcd2c6a8f384104d16afe7ea02969301ea2bb2a56e44b011ebc907cab" dependencies = [ "bitflags 2.5.0", - "kvm-bindings", + "kvm-bindings 0.10.0", "libc", "vmm-sys-util", ] diff --git a/Cargo.toml b/Cargo.toml index 26a39d8..81cda34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ serde_json = "1.0.117" core_affinity = "^0.8.1" [target.'cfg(target_os = "linux")'.dependencies] -kvm-ioctls = { version = "0.17", optional = true } +kvm-ioctls = { version = "0.19", optional = true } kvm-bindings = { version = "0.8", features = ["fam-wrappers"], optional = true } [features] From 821db3672ebd52fe8f3d2e7427431b18c5c4c9b9 Mon Sep 17 00:00:00 2001 From: Joshua Job Date: Wed, 16 Apr 2025 16:18:24 -0700 Subject: [PATCH 2/4] Updated kvm-ioctls to 0.21 with related kvm-bindings --- Cargo.lock | 21 ++++++--------------- Cargo.toml | 4 ++-- src/kvm.rs | 2 +- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 815da6b..2d1d9c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,7 +133,7 @@ dependencies = [ "clap", "core_affinity", "enum_dispatch", - "kvm-bindings 0.8.1", + "kvm-bindings", "kvm-ioctls", "serde", "serde_json", @@ -194,30 +194,21 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "kvm-bindings" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82e7e8725a39a0015e511a46cc1f7d90cecc180db1610c4d0d4339a9e48bd21" -dependencies = [ - "vmm-sys-util", -] - -[[package]] -name = "kvm-bindings" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4933174d0cc4b77b958578cd45784071cc5ae212c2d78fbd755aaaa6dfa71a" +checksum = "3b13baf7bdfda2e10bcb109fcb099ef40cff82374eb6b7cdcf4695bdec4e522c" dependencies = [ "vmm-sys-util", ] [[package]] name = "kvm-ioctls" -version = "0.19.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e013ae7fcd2c6a8f384104d16afe7ea02969301ea2bb2a56e44b011ebc907cab" +checksum = "083c460d5a272c2f22205973e319147b791d92a288d7d7a8d4c6194f95229440" dependencies = [ "bitflags 2.5.0", - "kvm-bindings 0.10.0", + "kvm-bindings", "libc", "vmm-sys-util", ] diff --git a/Cargo.toml b/Cargo.toml index 81cda34..3fbfdc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,8 @@ serde_json = "1.0.117" core_affinity = "^0.8.1" [target.'cfg(target_os = "linux")'.dependencies] -kvm-ioctls = { version = "0.19", optional = true } -kvm-bindings = { version = "0.8", features = ["fam-wrappers"], optional = true } +kvm-ioctls = { version = "0.21", optional = true } +kvm-bindings = { version = "0.11", features = ["fam-wrappers"], optional = true } [features] default = ["use_msr", "kvm"] diff --git a/src/kvm.rs b/src/kvm.rs index 0772193..1b47618 100644 --- a/src/kvm.rs +++ b/src/kvm.rs @@ -10,7 +10,7 @@ use std::error::Error; * Other structures such as CPUInfo will then make it accessible like the cpuid function */ pub struct KvmInfo { - cpuid_info: kvm_bindings::fam_wrappers::CpuId, + cpuid_info: kvm_bindings::CpuId, } impl KvmInfo { From 29a3b97d69ac54a9d72e5ad6511e5f985b15a7e8 Mon Sep 17 00:00:00 2001 From: Joshua Job Date: Wed, 16 Apr 2025 16:18:45 -0700 Subject: [PATCH 3/4] Fixed new compile error --- src/facts.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/facts.rs b/src/facts.rs index d14d00c..0f03637 100644 --- a/src/facts.rs +++ b/src/facts.rs @@ -113,7 +113,7 @@ impl FactSet { pub fn added_facts<'to>( &'to self, to: &'to Self, - ) -> NameIteration<'to, T, impl Iterator> { + ) -> NameIteration<'to, T, impl Iterator> { let name_iter = to.name_set.difference(&self.name_set); NameIteration { iter: name_iter, @@ -125,7 +125,7 @@ impl FactSet { pub fn removed_facts<'to>( &'to self, to: &'to Self, - ) -> NameIteration<'to, T, impl Iterator> { + ) -> NameIteration<'to, T, impl Iterator> { let name_iter = self.name_set.difference(&to.name_set); NameIteration { iter: name_iter, @@ -137,7 +137,7 @@ impl FactSet { pub fn changed_facts<'to>( &'to self, to: &'to Self, - ) -> ChangedIterator<'to, T, impl Iterator> { + ) -> ChangedIterator<'to, T, impl Iterator> { let name_iter = self.backing.keys(); ChangedIterator { iter: name_iter, From d8c48063a3b7ef48a23ea0dd1927ddaa7433cc2d Mon Sep 17 00:00:00 2001 From: Joshua Job Date: Wed, 16 Apr 2025 16:21:18 -0700 Subject: [PATCH 4/4] Fixed clippy warnings --- src/bitfield.rs | 14 +++++++------- src/layout.rs | 6 +++--- src/lib.rs | 2 +- src/msr.rs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/bitfield.rs b/src/bitfield.rs index 9414031..ff5030a 100644 --- a/src/bitfield.rs +++ b/src/bitfield.rs @@ -137,7 +137,7 @@ impl<'a, T: Bindable> Bound<'a, T> { } } -impl<'a> fmt::Display for Bound<'a, Flag> { +impl fmt::Display for Bound<'_, Flag> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -152,7 +152,7 @@ impl<'a> fmt::Display for Bound<'a, Flag> { } } -impl<'a> fmt::Display for Bound<'a, Int> { +impl fmt::Display for Bound<'_, Int> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -163,7 +163,7 @@ impl<'a> fmt::Display for Bound<'a, Int> { } } -impl<'a, B, R, T: From + From> Facter for Bound<'a, B> +impl + From> Facter for Bound<'_, B> where R: Default + Into, B: Bindable, @@ -176,7 +176,7 @@ where } } -impl<'a> fmt::Display for Bound<'a, X86Model> { +impl fmt::Display for Bound<'_, X86Model> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -187,7 +187,7 @@ impl<'a> fmt::Display for Bound<'a, X86Model> { } } -impl<'a> fmt::Display for Bound<'a, X86Family> { +impl fmt::Display for Bound<'_, X86Family> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -225,7 +225,7 @@ impl<'a> BoundField<'a> { } } -impl<'a> fmt::Display for BoundField<'a> { +impl fmt::Display for BoundField<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { match self { Self::Int(bound) => bound.fmt(f), @@ -236,7 +236,7 @@ impl<'a> fmt::Display for BoundField<'a> { } } -impl<'a, T: From + From> Facter for BoundField<'a> { +impl + From> Facter for BoundField<'_> { fn collect_fact(&self) -> GenericFact { match self { Self::Int(bound) => bound.collect_fact(), diff --git a/src/layout.rs b/src/layout.rs index 278014e..e6c0fb2 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -335,7 +335,7 @@ pub struct BoundLeaf<'a> { pub sub_leaves: Vec, } -impl<'a> BoundLeaf<'a> { +impl BoundLeaf<'_> { pub fn get_facts + From + From>(&self) -> Vec> { let mut facts = self.desc.get_facts(&self.sub_leaves); facts.iter_mut().for_each(|i| { @@ -345,13 +345,13 @@ impl<'a> BoundLeaf<'a> { } } -impl<'a, T: From + From + From> facts::Facter> for BoundLeaf<'a> { +impl + From + From> facts::Facter> for BoundLeaf<'_> { fn collect_facts(&self) -> Vec> { self.get_facts() } } -impl<'a> fmt::Display for BoundLeaf<'a> { +impl fmt::Display for BoundLeaf<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { self.desc.display_leaf(&self.sub_leaves, f) } diff --git a/src/lib.rs b/src/lib.rs index e0156bf..e7c3e16 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -95,7 +95,7 @@ impl CpuidDB for RunningCpuidDB { 0..=0x3FFFFFFF => leaf <= self.basic_max, 0x40000000..=0x4fffffff => self .hypervisor_max - .map_or(false, |max| leaf - 0x40000000 <= max), + .is_some_and(|max| leaf - 0x40000000 <= max), 0x80000000..=0x8fffffff => leaf - 0x80000000 <= self.extended_max, _ => false, } { diff --git a/src/msr.rs b/src/msr.rs index 41e598e..2a2cfb0 100644 --- a/src/msr.rs +++ b/src/msr.rs @@ -114,7 +114,7 @@ pub struct MSRValue<'a> { pub value: u64, } -impl<'a, T: From + From + From> facts::Facter> for MSRValue<'a> { +impl + From + From> facts::Facter> for MSRValue<'_> { fn collect_facts(&self) -> Vec> { let value = self.value.into(); self.desc @@ -130,7 +130,7 @@ impl<'a, T: From + From + From> facts::Facter> } } -impl<'a> fmt::Display for MSRValue<'a> { +impl fmt::Display for MSRValue<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { writeln!(f, "{} = {:#x}", self.desc, self.value)?; for field in &self.desc.fields {