diff --git a/sled-hardware/src/illumos/partitions.rs b/sled-hardware/src/illumos/partitions.rs index 1d89a76a02..5c129b410b 100644 --- a/sled-hardware/src/illumos/partitions.rs +++ b/sled-hardware/src/illumos/partitions.rs @@ -56,7 +56,6 @@ fn preferred_nvme_device_settings( } #[derive(Debug, thiserror::Error)] -#[cfg(target_os = "illumos")] pub enum NvmeFormattingError { #[error(transparent)] NvmeInit(#[from] libnvme::NvmeInitError), @@ -72,13 +71,6 @@ pub enum NvmeFormattingError { NoController(String), } -#[derive(Debug, thiserror::Error)] -#[cfg(not(target_os = "illumos"))] -pub enum NvmeFormattingError { - #[error("NVMe formatting is unsupported on this platform")] - UnsupportedPlatform, -} - // The expected layout of an M.2 device within the Oxide rack. // // Partitions beyond this "expected partition" array are ignored. @@ -225,7 +217,6 @@ fn internal_ensure_partition_layout( } } -#[cfg(target_os = "illumos")] fn ensure_size_and_formatting( log: &Logger, identity: &DiskIdentity, @@ -328,14 +319,6 @@ fn ensure_size_and_formatting( Ok(()) } -#[cfg(not(target_os = "illumos"))] -fn ensure_size_and_formatting( - log: &Logger, - identity: &DiskIdentity, -) -> Result<(), NvmeFormattingError> { - Ok(()) -} - #[cfg(test)] mod test { use super::*; diff --git a/sled-hardware/src/non_illumos/mod.rs b/sled-hardware/src/non_illumos/mod.rs index d8372dd8aa..8518aae495 100644 --- a/sled-hardware/src/non_illumos/mod.rs +++ b/sled-hardware/src/non_illumos/mod.rs @@ -6,10 +6,17 @@ use crate::disk::{ DiskPaths, DiskVariant, Partition, PooledDiskError, UnparsedDisk, }; use crate::{Baseboard, SledMode}; +use omicron_common::disk::DiskIdentity; use slog::Logger; use std::collections::HashSet; use tokio::sync::broadcast; +#[derive(Debug, thiserror::Error)] +pub enum NvmeFormattingError { + #[error("NVMe formatting is unsupported on this platform")] + UnsupportedPlatform, +} + /// An unimplemented, stub representation of the underlying hardware. /// /// This is intended for non-illumos systems to have roughly the same interface @@ -59,6 +66,7 @@ pub fn ensure_partition_layout( _log: &Logger, _paths: &DiskPaths, _variant: DiskVariant, + _identity: &DiskIdentity, ) -> Result, PooledDiskError> { unimplemented!("Accessing hardware unsupported on non-illumos"); }