Skip to content

Commit

Permalink
fix broken comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Nov 13, 2024
1 parent d4487db commit 7db1183
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bin/propolis-server/src/lib/migrate/destination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl<T: MigrateConn> RonV0<T> {
}?;
info!(self.log(), "Destination read Preamble: {:?}", preamble);

let spec = match preamble.get_amended_spec(ensure_ctx.instance_spec()) {
let spec = match preamble.amend_spec(ensure_ctx.instance_spec()) {
Ok(spec) => spec,
Err(e) => {
error!(
Expand Down
15 changes: 8 additions & 7 deletions bin/propolis-server/src/lib/migrate/preamble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ impl Preamble {
Preamble { instance_spec, blobs: Vec::new() }
}

/// Given the instance spec in this preamble (transmitted from the migration
/// source), replace any Crucible and viona backends with their
/// Consume the spec in this Preamble and produce an instance spec suitable
/// for initializing the target VM.
///
/// This check runs on the destination.
pub fn get_amended_spec(
self,
target_spec: &Spec,
) -> Result<Spec, MigrateError> {
/// This routine enumerates the disks and NICs in the `target_spec` and
/// looks for disks with a Crucible backend and NICs with a viona backend.
/// Any such backends will replace the corresponding backend entries in the
/// source spec. If the target spec contains a replacement backend that is
/// not present in the source spec, this routine fails.
pub fn amend_spec(self, target_spec: &Spec) -> Result<Spec, MigrateError> {
let VersionedInstanceSpec::V0(mut source_spec) = self.instance_spec;
for disk in target_spec.disks.values() {
let StorageBackend::Crucible(crucible) = &disk.backend_spec else {
Expand Down

0 comments on commit 7db1183

Please sign in to comment.