From 35ec0060fb73149e687655851a682f12486f0086 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 5 Sep 2022 20:23:45 +0200 Subject: refactor(sim/compute): Move interference logic into VmInterferenceMember This change updates the design of the VM interference model, where we move more of the logic into the `VmInterferenceMember` interface. This removes the dependency on the `VmInterferenceModel` for the hypervisor interface. --- .../src/main/kotlin/org/opendc/compute/simulator/SimHost.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opendc-compute/opendc-compute-simulator/src/main') diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt index 908353f0..628f324b 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt @@ -92,7 +92,7 @@ public class SimHost( * The hypervisor to run multiple workloads. */ private val hypervisor: SimHypervisor = hypervisorProvider - .create(engine, scalingGovernor = scalingGovernor, interferenceDomain = interferenceDomain) + .create(engine, scalingGovernor = scalingGovernor) /** * The virtual machines running on the hypervisor. @@ -144,7 +144,7 @@ public class SimHost( val guest = guests.computeIfAbsent(server) { key -> require(canFit(key)) { "Server does not fit" } - val interferenceKey = interferenceDomain?.createKey(key.name) + val interferenceKey = interferenceDomain?.getMember(key.name) val machine = hypervisor.newMachine(key.flavor.toMachineModel(), interferenceKey) val newGuest = Guest( scope.coroutineContext, -- cgit v1.2.3