Skip to content

Commit

Permalink
shut up clippy in a slightly more polite way
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Jun 21, 2024
1 parent c3c0622 commit a166187
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions sled-agent/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Uuid>,
}

impl Instance {
Expand All @@ -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<Uuid>,
ticket: InstanceTicket,
state: InstanceInitialState,
services: InstanceManagerServices,
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion sled-agent/src/instance_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a166187

Please sign in to comment.