Skip to content

Commit

Permalink
Clean up bits for crucible in propolis-standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmooney committed Aug 14, 2023
1 parent 40d2fd5 commit 84eba28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 11 additions & 3 deletions bin/propolis-standalone/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ pub fn block_backend(
let creg = ChildRegister::new(&be, Some(path.to_string()));
(be, creg)
}
#[cfg(feature = "crucible")]
"crucible" => create_crucible_backend(log, be),
#[cfg(not(feature = "crucible"))]
"crucible" => panic!("crucible device specified in VM config, but propolis-standalone was not built with crucible support. rebuild propolis-standalone with the `crucible` feature enabled, or remove all crucible devices from your VM config"),
_ => {
panic!("unrecognized block dev type {}!", be.bdtype);
}
Expand Down Expand Up @@ -202,3 +199,14 @@ fn create_crucible_backend(
ChildRegister::new(&be, Some(be.get_uuid().unwrap().to_string()));
(be, creg)
}

#[cfg(not(feature = "crucible"))]
fn create_crucible_backend(
_log: &slog::Logger,
_be: &propolis_standalone_config::BlockDevice,
) -> (Arc<dyn block::Backend>, ChildRegister) {
panic!(
"Rebuild propolis-standalone with 'crucible' feature enabled in \
order to use the crucible block backend"
);
}
4 changes: 4 additions & 0 deletions xtask/src/task_clippy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ pub(crate) fn cmd_clippy(strict: bool) -> Result<()> {
failed |=
run_clippy(&["-p", "propolis-server", "--features", "mock-only"])?;

// Check standalone with crucible enabled
failed |=
run_clippy(&["-p", "propolis-standalone", "--features", "crucible"])?;

if failed {
bail!("Clippy failures detected")
}
Expand Down

0 comments on commit 84eba28

Please sign in to comment.