build: treewide: fmt for edition 2024

`cargo +nightly fmt`

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster
2025-08-12 12:59:23 +02:00
committed by Bo Chen
parent 061351d82d
commit 363273111a
121 changed files with 781 additions and 663 deletions

View File

@@ -25,20 +25,20 @@ use std::time::Instant;
use std::{cmp, result, str, thread};
use anyhow::anyhow;
#[cfg(target_arch = "x86_64")]
use arch::layout::{KVM_IDENTITY_MAP_START, KVM_TSS_START};
#[cfg(feature = "tdx")]
use arch::x86_64::tdx::TdvfSection;
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
use arch::x86_64::MAX_SUPPORTED_CPUS_LEGACY;
#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))]
use arch::PciSpaceInfo;
use arch::{get_host_cpu_phys_bits, EntryPoint, NumaNode, NumaNodes};
#[cfg(target_arch = "x86_64")]
use arch::layout::{KVM_IDENTITY_MAP_START, KVM_TSS_START};
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
use arch::x86_64::MAX_SUPPORTED_CPUS_LEGACY;
#[cfg(feature = "tdx")]
use arch::x86_64::tdx::TdvfSection;
use arch::{EntryPoint, NumaNode, NumaNodes, get_host_cpu_phys_bits};
use devices::AcpiNotificationFlags;
#[cfg(target_arch = "aarch64")]
use devices::interrupt_controller;
#[cfg(feature = "fw_cfg")]
use devices::legacy::fw_cfg::FwCfgItem;
use devices::AcpiNotificationFlags;
#[cfg(all(target_arch = "aarch64", feature = "guest_debug"))]
use gdbstub_arch::aarch64::reg::AArch64CoreRegs as CoreRegs;
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
@@ -46,17 +46,17 @@ use gdbstub_arch::x86::reg::X86_64CoreRegs as CoreRegs;
#[cfg(target_arch = "aarch64")]
use hypervisor::arch::aarch64::regs::AARCH64_PMU_IRQ;
use hypervisor::{HypervisorVmError, VmOps};
use libc::{termios, SIGWINCH};
use libc::{SIGWINCH, termios};
use linux_loader::cmdline::Cmdline;
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
use linux_loader::elf;
use linux_loader::loader::KernelLoader;
#[cfg(target_arch = "x86_64")]
use linux_loader::loader::bzimage::BzImage;
#[cfg(target_arch = "x86_64")]
use linux_loader::loader::elf::PvhBootCapability::PvhEntryPresent;
#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))]
use linux_loader::loader::pe::Error::InvalidImageMagicNumber;
use linux_loader::loader::KernelLoader;
use seccompiler::SeccompAction;
use serde::{Deserialize, Serialize};
use thiserror::Error;
@@ -69,12 +69,12 @@ use vm_memory::{
};
use vm_migration::protocol::{MemoryRangeTable, Request, Response};
use vm_migration::{
snapshot_from_id, Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable,
Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable, snapshot_from_id,
};
use vmm_sys_util::eventfd::EventFd;
use vmm_sys_util::sock_ctrl_msg::ScmSocket;
use crate::config::{add_to_config, ValidationError};
use crate::config::{ValidationError, add_to_config};
use crate::console_devices::{ConsoleDeviceError, ConsoleInfo};
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
use crate::coredump::{
@@ -94,7 +94,7 @@ use crate::memory_manager::{
use crate::migration::get_vm_snapshot;
#[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
use crate::migration::url_to_file;
use crate::migration::{url_to_path, SNAPSHOT_CONFIG_FILE, SNAPSHOT_STATE_FILE};
use crate::migration::{SNAPSHOT_CONFIG_FILE, SNAPSHOT_STATE_FILE, url_to_path};
#[cfg(feature = "fw_cfg")]
use crate::vm_config::FwCfgConfig;
use crate::vm_config::{
@@ -102,8 +102,8 @@ use crate::vm_config::{
PmemConfig, UserDeviceConfig, VdpaConfig, VmConfig, VsockConfig,
};
use crate::{
cpu, GuestMemoryMmap, PciDeviceInfo, CPU_MANAGER_SNAPSHOT_ID, DEVICE_MANAGER_SNAPSHOT_ID,
MEMORY_MANAGER_SNAPSHOT_ID,
CPU_MANAGER_SNAPSHOT_ID, DEVICE_MANAGER_SNAPSHOT_ID, GuestMemoryMmap,
MEMORY_MANAGER_SNAPSHOT_ID, PciDeviceInfo, cpu,
};
/// Errors associated with VM management
@@ -1315,10 +1315,7 @@ impl Vm {
return Self::load_igvm(igvm, memory_manager, cpu_manager);
}
}
match (
&payload.firmware,
&payload.kernel,
) {
match (&payload.firmware, &payload.kernel) {
(Some(firmware), None) => {
let firmware = File::open(firmware).map_err(Error::FirmwareFile)?;
Self::load_kernel(firmware, None, memory_manager)
@@ -1328,7 +1325,9 @@ impl Vm {
let cmdline = Self::generate_cmdline(payload)?;
Self::load_kernel(kernel, Some(cmdline), memory_manager)
}
_ => unreachable!("Unsupported boot configuration: programming error from 'PayloadConfigError::validate()'"),
_ => unreachable!(
"Unsupported boot configuration: programming error from 'PayloadConfigError::validate()'"
),
}
}
@@ -1346,7 +1345,9 @@ impl Vm {
let kernel = File::open(kernel).map_err(Error::KernelFile)?;
Self::load_kernel(kernel, memory_manager)
}
_ => unreachable!("Unsupported boot configuration: programming error from 'PayloadConfigError::validate()'"),
_ => unreachable!(
"Unsupported boot configuration: programming error from 'PayloadConfigError::validate()'"
),
}
}