From 35dd6bcee549c12b586aba59317a49bd566040e4 Mon Sep 17 00:00:00 2001 From: Greg Colombo Date: Wed, 13 Nov 2024 00:03:11 +0000 Subject: [PATCH] fix broken comment --- .../src/lib/migrate/destination.rs | 2 +- bin/propolis-server/src/lib/migrate/preamble.rs | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/propolis-server/src/lib/migrate/destination.rs b/bin/propolis-server/src/lib/migrate/destination.rs index 30c928d16..9156a02b2 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 082735fc5..6f0280401 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 {