Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use external libipcc repo #6438

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ ispf = { git = "https://github.com/oxidecomputer/ispf" }
key-manager = { path = "key-manager" }
kstat-rs = "0.2.4"
libc = "0.2.158"
libipcc = { git = "https://github.com/oxidecomputer/libipcc", rev = "fdffa212373a8f92473ea5f411088912bf458d5f" }
libfalcon = { git = "https://github.com/oxidecomputer/falcon", rev = "e69694a1f7cc9fe31fab27f321017280531fb5f7" }
libnvme = { git = "https://github.com/oxidecomputer/libnvme", rev = "dd5bb221d327a1bc9287961718c3c10d6bd37da0" }
linear-map = "1.2.0"
Expand Down
3 changes: 1 addition & 2 deletions ipcc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ workspace = true

[dependencies]
ciborium.workspace = true
libc.workspace = true
omicron-common.workspace = true
serde.workspace = true
thiserror.workspace = true
uuid.workspace = true
omicron-workspace-hack.workspace = true
cfg-if.workspace = true
libipcc.workspace = true

[dev-dependencies]
omicron-common = { workspace = true, features = ["testing"] }
Expand Down
16 changes: 0 additions & 16 deletions ipcc/build.rs

This file was deleted.

83 changes: 0 additions & 83 deletions ipcc/src/ffi.rs

This file was deleted.

129 changes: 0 additions & 129 deletions ipcc/src/handle.rs

This file was deleted.

25 changes: 0 additions & 25 deletions ipcc/src/handle_stub.rs

This file was deleted.

43 changes: 1 addition & 42 deletions ipcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,13 @@
//! values are variously static, passed from the control plane to the SP
//! (through MGS) or set from userland via libipcc.

use cfg_if::cfg_if;
use libipcc::{IpccError, IpccHandle};
use omicron_common::update::ArtifactHash;
use serde::Deserialize;
use serde::Serialize;
use thiserror::Error;
use uuid::Uuid;

cfg_if! {
if #[cfg(target_os = "illumos")] {
mod ffi;
mod handle;
use handle::IpccHandle;
} else {
mod handle_stub;
use handle_stub::IpccHandle;
}
}

#[cfg(test)]
use proptest::arbitrary::any;
#[cfg(test)]
Expand Down Expand Up @@ -145,36 +134,6 @@ pub enum InstallinatorImageIdError {
DeserializationFailed(String),
}

#[derive(Error, Debug)]
pub enum IpccError {
#[error("Memory allocation error")]
NoMem(#[source] IpccErrorInner),
#[error("Invalid parameter")]
InvalidParam(#[source] IpccErrorInner),
#[error("Internal error occurred")]
Internal(#[source] IpccErrorInner),
#[error("Requested lookup key was not known to the SP")]
KeyUnknown(#[source] IpccErrorInner),
#[error("Value for the requested lookup key was too large for the supplied buffer")]
KeyBufTooSmall(#[source] IpccErrorInner),
#[error("Attempted to write to read-only key")]
KeyReadonly(#[source] IpccErrorInner),
#[error("Attempted write to key failed because the value is too long")]
KeyValTooLong(#[source] IpccErrorInner),
#[error("Compression or decompression failed")]
KeyZerr(#[source] IpccErrorInner),
#[error("Unknown libipcc error")]
UnknownErr(#[source] IpccErrorInner),
}

#[derive(Error, Debug)]
#[error("{context}: {errmsg} ({syserr})")]
pub struct IpccErrorInner {
pub context: String,
pub errmsg: String,
pub syserr: String,
}

/// These are the IPCC keys we can look up.
/// NB: These keys match the definitions found in libipcc (RFD 316) and should
/// match the values in `[ipcc::Key]` one-to-one.
Expand Down
Loading