From 27cebc013fabda1534a1f62669e95f7df752af6b Mon Sep 17 00:00:00 2001 From: Mike Zeller Date: Tue, 18 Jun 2024 19:09:10 +0000 Subject: [PATCH] Bump libnvme crate rev --- Cargo.lock | 13 +++++++++---- Cargo.toml | 2 +- sled-hardware/src/illumos/mod.rs | 13 ++++++++----- sled-hardware/src/illumos/partitions.rs | 2 ++ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 37c6323f45..36263317eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -551,7 +551,7 @@ checksum = "1657dce144574f921af10a92876a96f0ca05dd830900598d21d91c8e4cf78f74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -4074,19 +4074,19 @@ dependencies = [ [[package]] name = "libnvme" version = "0.1.1" -source = "git+https://github.com/oxidecomputer/libnvme?rev=0eed4e4929fc2311326646e818e065823ac9a695#0eed4e4929fc2311326646e818e065823ac9a695" +source = "git+https://github.com/oxidecomputer/libnvme?rev=dd5bb221d327a1bc9287961718c3c10d6bd37da0#dd5bb221d327a1bc9287961718c3c10d6bd37da0" dependencies = [ "libnvme-sys", + "nvme", "thiserror", ] [[package]] name = "libnvme-sys" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/libnvme?rev=0eed4e4929fc2311326646e818e065823ac9a695#0eed4e4929fc2311326646e818e065823ac9a695" +source = "git+https://github.com/oxidecomputer/libnvme?rev=dd5bb221d327a1bc9287961718c3c10d6bd37da0#dd5bb221d327a1bc9287961718c3c10d6bd37da0" dependencies = [ "bitfield-struct", - "static_assertions", ] [[package]] @@ -5210,6 +5210,11 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "nvme" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/libnvme?rev=dd5bb221d327a1bc9287961718c3c10d6bd37da0#dd5bb221d327a1bc9287961718c3c10d6bd37da0" + [[package]] name = "nvpair" version = "0.5.0" diff --git a/Cargo.toml b/Cargo.toml index 9b9b39210b..c7b105ac44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -327,7 +327,7 @@ key-manager = { path = "key-manager" } kstat-rs = "0.2.4" libc = "0.2.155" libfalcon = { git = "https://github.com/oxidecomputer/falcon", rev = "e69694a1f7cc9fe31fab27f321017280531fb5f7" } -libnvme = { git = "https://github.com/oxidecomputer/libnvme", rev = "0eed4e4929fc2311326646e818e065823ac9a695" } +libnvme = { git = "https://github.com/oxidecomputer/libnvme", rev = "dd5bb221d327a1bc9287961718c3c10d6bd37da0" } linear-map = "1.2.0" macaddr = { version = "1.0.1", features = ["serde_std"] } maplit = "1.0.2" diff --git a/sled-hardware/src/illumos/mod.rs b/sled-hardware/src/illumos/mod.rs index 06214df18f..93db398840 100644 --- a/sled-hardware/src/illumos/mod.rs +++ b/sled-hardware/src/illumos/mod.rs @@ -66,10 +66,16 @@ enum Error { NvmeHandleInit(#[from] libnvme::NvmeInitError), #[error("libnvme error: {0}")] - NvmeError(#[from] libnvme::NvmeError), + Nvme(#[from] libnvme::NvmeError), + + #[error("libnvme controller error: {0}")] + NvmeController(#[from] libnvme::controller::NvmeControllerError), #[error("Unable to grab NVMe Controller lock")] NvmeControllerLocked, + + #[error("Failed to get NVMe Controller's firmware log page: {0}")] + FirmwareLogPage(#[from] libnvme::firmware::FirmwareLogPageError), } const GIMLET_ROOT_NODE_NAME: &str = "Oxide,Gimlet"; @@ -557,10 +563,7 @@ fn poll_blkdev_node( firmware_log_page.active_slot, firmware_log_page.next_active_slot, firmware_log_page.slot1_is_read_only, - firmware_log_page - .slot_iter() - .map(|s| s.map(String::to_string)) - .collect(), + firmware_log_page.slot_iter().map(|s| s.map(str::to_string)).collect(), ); let disk = UnparsedDisk::new( diff --git a/sled-hardware/src/illumos/partitions.rs b/sled-hardware/src/illumos/partitions.rs index 0308e842c0..1386d07866 100644 --- a/sled-hardware/src/illumos/partitions.rs +++ b/sled-hardware/src/illumos/partitions.rs @@ -75,6 +75,8 @@ pub enum NvmeFormattingError { NvmeInit(#[from] libnvme::NvmeInitError), #[error(transparent)] Nvme(#[from] libnvme::NvmeError), + #[error(transparent)] + NvmeController(#[from] libnvme::controller::NvmeControllerError), #[error("Device is missing expected LBA format")] LbaFormatMissing, #[error("Device has {0} active namespaces but we expected 1")]