From c6d472b623ea11c9dd0e4822f71464824dbed70c 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 | 11 ++++++++--- Cargo.toml | 2 +- sled-hardware/src/illumos/mod.rs | 13 ++++++++----- sled-hardware/src/illumos/partitions.rs | 2 ++ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3d25093add..31509f89c35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4067,19 +4067,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=62278f56d67913b9bd60a9cc66a1b4ff3eb1675d#62278f56d67913b9bd60a9cc66a1b4ff3eb1675d" 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=62278f56d67913b9bd60a9cc66a1b4ff3eb1675d#62278f56d67913b9bd60a9cc66a1b4ff3eb1675d" dependencies = [ "bitfield-struct", - "static_assertions", ] [[package]] @@ -5203,6 +5203,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=62278f56d67913b9bd60a9cc66a1b4ff3eb1675d#62278f56d67913b9bd60a9cc66a1b4ff3eb1675d" + [[package]] name = "nvpair" version = "0.5.0" diff --git a/Cargo.toml b/Cargo.toml index ca33ac8e44e..0d070fcb949 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -315,7 +315,7 @@ key-manager = { path = "key-manager" } kstat-rs = "0.2.3" 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 = "62278f56d67913b9bd60a9cc66a1b4ff3eb1675d" } 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 06214df18fb..93db3988403 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 0308e842c03..1386d078660 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")]