diff --git a/bin/propolis-server/src/lib/migrate/destination.rs b/bin/propolis-server/src/lib/migrate/destination.rs index 30c928d1..9156a02b 100644 --- a/bin/propolis-server/src/lib/migrate/destination.rs +++ b/bin/propolis-server/src/lib/migrate/destination.rs @@ -350,7 +350,7 @@ impl RonV0 { }?; 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!( diff --git a/bin/propolis-server/src/lib/migrate/preamble.rs b/bin/propolis-server/src/lib/migrate/preamble.rs index 082735fc..6f028040 100644 --- a/bin/propolis-server/src/lib/migrate/preamble.rs +++ b/bin/propolis-server/src/lib/migrate/preamble.rs @@ -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 { + /// 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 { let VersionedInstanceSpec::V0(mut source_spec) = self.instance_spec; for disk in target_spec.disks.values() { let StorageBackend::Crucible(crucible) = &disk.backend_spec else {