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
+25 -18
View File
@@ -270,7 +270,9 @@ pub enum ValidationError {
#[error("Invalid PCI segment aperture weight: {0}")]
InvalidPciSegmentApertureWeight(u32),
/// Invalid IOMMU address width in bits
#[error("IOMMU address width in bits ({0}) should be less than or equal to {MAX_IOMMU_ADDRESS_WIDTH_BITS}")]
#[error(
"IOMMU address width in bits ({0}) should be less than or equal to {MAX_IOMMU_ADDRESS_WIDTH_BITS}"
)]
InvalidIommuAddressWidthBits(u8),
/// Balloon too big
#[error("Ballon size ({0}) greater than RAM ({1})")]
@@ -1536,8 +1538,7 @@ impl RngConfig {
}
impl BalloonConfig {
pub const SYNTAX: &'static str =
"Balloon parameters \"size=<balloon_size>,deflate_on_oom=on|off,\
pub const SYNTAX: &'static str = "Balloon parameters \"size=<balloon_size>,deflate_on_oom=on|off,\
free_page_reporting=on|off\"";
pub fn parse(balloon: &str) -> Result<Self> {
@@ -1911,8 +1912,7 @@ impl DebugConsoleConfig {
}
impl DeviceConfig {
pub const SYNTAX: &'static str =
"Direct device assignment parameters \"path=<device_path>,iommu=on|off,id=<device_id>,pci_segment=<segment_id>\"";
pub const SYNTAX: &'static str = "Direct device assignment parameters \"path=<device_path>,iommu=on|off,id=<device_id>,pci_segment=<segment_id>\"";
pub fn parse(device: &str) -> Result<Self> {
let mut parser = OptionParser::new();
@@ -2206,7 +2206,9 @@ where
S: serde::Serializer,
{
if let Some(x) = x {
warn!("'RestoredNetConfig' contains FDs that can't be serialized correctly. Serializing them as invalid FDs.");
warn!(
"'RestoredNetConfig' contains FDs that can't be serialized correctly. Serializing them as invalid FDs."
);
let invalid_fds = vec![-1; x.len()];
s.serialize_some(&invalid_fds)
} else {
@@ -2222,7 +2224,9 @@ where
{
let invalid_fds: Option<Vec<i32>> = Option::deserialize(d)?;
if let Some(invalid_fds) = invalid_fds {
warn!("'RestoredNetConfig' contains FDs that can't be deserialized correctly. Deserializing them as invalid FDs.");
warn!(
"'RestoredNetConfig' contains FDs that can't be deserialized correctly. Deserializing them as invalid FDs."
);
Ok(Some(vec![-1; invalid_fds.len()]))
} else {
Ok(None)
@@ -3556,7 +3560,9 @@ mod tests {
);
assert_eq!(
NetConfig::parse("mac=de:ad:be:ef:12:34,host_mac=12:34:de:ad:be:ef,num_queues=4,queue_size=1024,iommu=on")?,
NetConfig::parse(
"mac=de:ad:be:ef:12:34,host_mac=12:34:de:ad:be:ef,num_queues=4,queue_size=1024,iommu=on"
)?,
NetConfig {
num_queues: 4,
queue_size: 1024,
@@ -4814,18 +4820,19 @@ mod tests {
)?,
FwCfgConfig {
items: Some(FwCfgItemList {
item_list: vec![FwCfgItem {
name: "opt/org.test/fw_cfg_test_item".to_string(),
file: PathBuf::from("/tmp/fw_cfg_test_item"),
},
FwCfgItem {
name: "opt/org.test/fw_cfg_test_item2".to_string(),
file: PathBuf::from("/tmp/fw_cfg_test_item2"),
}]
item_list: vec![
FwCfgItem {
name: "opt/org.test/fw_cfg_test_item".to_string(),
file: PathBuf::from("/tmp/fw_cfg_test_item"),
},
FwCfgItem {
name: "opt/org.test/fw_cfg_test_item2".to_string(),
file: PathBuf::from("/tmp/fw_cfg_test_item2"),
}
]
}),
..Default::default()
},
},
);
Ok(())
}