From c9ceaa5e0fa431df8a7bab95510329480391614b Mon Sep 17 00:00:00 2001 From: mulhern Date: Fri, 3 Jan 2025 09:54:32 -0500 Subject: [PATCH] Print the integrity spec when printing the metadata Signed-off-by: mulhern --- src/engine/strat_engine/pool/inspection.rs | 25 +++++++++++++++++----- src/engine/types/mod.rs | 9 ++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/engine/strat_engine/pool/inspection.rs b/src/engine/strat_engine/pool/inspection.rs index ab2bfd6911..01ac2b7c52 100644 --- a/src/engine/strat_engine/pool/inspection.rs +++ b/src/engine/strat_engine/pool/inspection.rs @@ -10,7 +10,10 @@ use std::{ use devicemapper::Sectors; use crate::{ - engine::{strat_engine::serde_structs::PoolSave, types::DevUuid}, + engine::{ + strat_engine::serde_structs::PoolSave, + types::{DevUuid, ValidatedIntegritySpec}, + }, stratis::{StratisError, StratisResult}, }; @@ -535,7 +538,9 @@ impl fmt::Display for FlexDevice { } // Calculate map of device UUIDs to data device representation from metadata. -fn data_devices(metadata: &PoolSave) -> StratisResult> { +fn data_devices( + metadata: &PoolSave, +) -> StratisResult<(HashMap, Option)> { let data_tier_metadata = &metadata.backstore.data_tier; let data_tier_devs = &data_tier_metadata.blockdev.devs; @@ -570,7 +575,7 @@ fn data_devices(metadata: &PoolSave) -> StratisResult for ValidatedIntegritySpec { }) } } + +impl Display for ValidatedIntegritySpec { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + writeln!(f, "Allocate Superblock: {}", self.allocate_superblock)?; + writeln!(f, "Tag Specification: {}", self.tag_spec.as_ref())?; + writeln!(f, "Journal Size: {}", self.journal_size)?; + writeln!(f, "Block Size: {}", self.block_size) + } +}