mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
build: exempt arch from clippy::absolute_paths, use full paths
Suggested by phip1611 on #8446. This adds the repo's first clippy.toml, carving arch out of the absolute_paths deny from #7670. Glob imports and trait imports that must be in scope for method-call resolution (e.g. DeviceInfoForFdt for .irq()) are left as-is. Signed-off-by: Henry Hrvoje Tonkovac <htonkovac@gmail.com> Assisted-by: Claude:Opus-4.8
This commit is contained in:
committed by
Bo Chen
parent
a8a3a59544
commit
ae7c0dd9f1
+10
-12
@@ -10,8 +10,6 @@ use std::str::FromStr;
|
||||
use std::{fs, result};
|
||||
|
||||
use arch::CpuProfile;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
use arch::x86_64;
|
||||
use block::ImageType;
|
||||
pub use block::fcntl::LockGranularityChoice;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
@@ -174,7 +172,7 @@ pub struct PlatformConfig {
|
||||
impl PlatformConfig {
|
||||
/// Returns `None` if no SMBIOS-relevant platform fields are set, otherwise
|
||||
/// `Some` with a [`SmbiosConfig`] built from the populated fields.
|
||||
pub fn smbios_config(&self) -> Option<x86_64::SmbiosConfig> {
|
||||
pub fn smbios_config(&self) -> Option<arch::x86_64::SmbiosConfig> {
|
||||
let has_system = [
|
||||
&self.system_serial_number,
|
||||
&self.system_uuid,
|
||||
@@ -187,7 +185,7 @@ impl PlatformConfig {
|
||||
.iter()
|
||||
.any(|v| v.is_some());
|
||||
|
||||
let system = has_system.then_some(x86_64::SmbiosSystem {
|
||||
let system = has_system.then_some(arch::x86_64::SmbiosSystem {
|
||||
manufacturer: self.system_manufacturer.clone(),
|
||||
product_name: self.system_product_name.clone(),
|
||||
version: self.system_version.clone(),
|
||||
@@ -197,14 +195,14 @@ impl PlatformConfig {
|
||||
family: self.system_family.clone(),
|
||||
});
|
||||
|
||||
let chassis = self
|
||||
.chassis_asset_tag
|
||||
.clone()
|
||||
.map(|asset_tag| x86_64::SmbiosChassisConfig {
|
||||
asset_tag: Some(asset_tag),
|
||||
});
|
||||
let chassis =
|
||||
self.chassis_asset_tag
|
||||
.clone()
|
||||
.map(|asset_tag| arch::x86_64::SmbiosChassisConfig {
|
||||
asset_tag: Some(asset_tag),
|
||||
});
|
||||
|
||||
let smbios = x86_64::SmbiosConfig {
|
||||
let smbios = arch::x86_64::SmbiosConfig {
|
||||
system,
|
||||
chassis,
|
||||
oem_strings: self.oem_strings.clone().unwrap_or_default(),
|
||||
@@ -1321,7 +1319,7 @@ impl VmConfig {
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||
pub(crate) fn max_apic_id(&self) -> u32 {
|
||||
if let Some(topology) = &self.cpus.topology {
|
||||
x86_64::get_max_x2apic_id((
|
||||
arch::x86_64::get_max_x2apic_id((
|
||||
topology.threads_per_core,
|
||||
topology.cores_per_die,
|
||||
topology.dies_per_package,
|
||||
|
||||
Reference in New Issue
Block a user