diff --git a/sled-agent/src/instance.rs b/sled-agent/src/instance.rs index d408b3631fb..6e671791fbd 100644 --- a/sled-agent/src/instance.rs +++ b/sled-agent/src/instance.rs @@ -898,6 +898,9 @@ pub(crate) struct InstanceInitialState { pub hardware: InstanceHardware, pub vmm_runtime: VmmRuntimeState, pub propolis_addr: SocketAddr, + /// UUID of the migration in to this VMM, if the VMM is being created as the + /// target of an active migration. + pub migration_id: Option, } impl Instance { @@ -908,19 +911,15 @@ impl Instance { /// * `log`: Logger for dumping debug information. /// * `id`: UUID of the instance to be created. /// * `propolis_id`: UUID for the VMM to be created. - /// * `migration_id`: UUID of the migration in to this VMM, if the VMM is - /// being created as the target of an active migration. /// * `ticket`: A ticket that ensures this instance is a member of its /// instance manager's tracking table. /// * `state`: The initial state of this instance. /// * `services`: A set of instance manager-provided services. /// * `metadata`: Instance-related metadata used to track statistics. - #[allow(clippy::too_many_arguments)] // shut up clippy, i hate you pub(crate) fn new( log: Logger, id: InstanceUuid, propolis_id: PropolisUuid, - migration_id: Option, ticket: InstanceTicket, state: InstanceInitialState, services: InstanceManagerServices, @@ -929,11 +928,15 @@ impl Instance { info!(log, "initializing new Instance"; "instance_id" => %id, "propolis_id" => %propolis_id, - "migration_id" => ?migration_id, + "migration_id" => ?state.migration_id, "state" => ?state); let InstanceInitialState { - hardware, vmm_runtime, propolis_addr, .. + hardware, + vmm_runtime, + propolis_addr, + migration_id, + .. } = state; let InstanceManagerServices { diff --git a/sled-agent/src/instance_manager.rs b/sled-agent/src/instance_manager.rs index 20634a61dba..4d863883cc1 100644 --- a/sled-agent/src/instance_manager.rs +++ b/sled-agent/src/instance_manager.rs @@ -571,13 +571,13 @@ impl InstanceManagerRunner { hardware, vmm_runtime, propolis_addr, + migration_id: instance_runtime.migration_id, }; let instance = Instance::new( instance_log, instance_id, propolis_id, - instance_runtime.migration_id, ticket, state, services,