Skip to content

Commit

Permalink
Use external libipcc repo
Browse files Browse the repository at this point in the history
  • Loading branch information
labbott committed Aug 26, 2024
1 parent 4a60d78 commit af9c200
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 300 deletions.
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 @@ -401,6 +401,7 @@ ispf = { git = "https://github.com/oxidecomputer/ispf" }
key-manager = { path = "key-manager" }
kstat-rs = "0.2.4"
libc = "0.2.156"
libipcc = { git = "https://github.com/oxidecomputer/libipcc", rev = "db2bee69e3981f11e5dada6c17392f80c2933255" }
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.

45 changes: 2 additions & 43 deletions ipcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,12 @@
//! 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 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;
}
}
use libipcc::{IpccError, handle::IpccHandle};
use thiserror::Error;

#[cfg(test)]
use proptest::arbitrary::any;
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

0 comments on commit af9c200

Please sign in to comment.