From c9750e52a10157f3838b934fed4f04fae69c539a Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 31 Oct 2022 15:02:37 +0100 Subject: feat(sim/compute): Add support for snapshotting workloads This change updates the interface of `SimWorkload` to support snapshotting workloads. We introduce a new method `snapshot()` to this interface which returns a new `SimWorkload` that can be started at a later point in time and on another `SimMachine`, which continues progress from the moment the workload was snapshotted. --- .../src/main/kotlin/org/opendc/compute/simulator/SimHost.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'opendc-compute') 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 b3e56f38..5eccc6ec 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 @@ -280,7 +280,7 @@ public class SimHost( val bootWorkload = bootModel.get() val hypervisor = hypervisor - val hypervisorWorkload = object : SimWorkload { + val hypervisorWorkload = object : SimWorkload by hypervisor { override fun onStart(ctx: SimMachineContext) { try { _bootTime = clock.instant() @@ -296,10 +296,6 @@ public class SimHost( throw cause } } - - override fun onStop(ctx: SimMachineContext) { - hypervisor.onStop(ctx) - } } val workload = if (bootWorkload != null) SimWorkloads.chain(bootWorkload, hypervisorWorkload) else hypervisorWorkload -- cgit v1.2.3