diff options
| author | Dante Niewenhuis <d.niewenhuis@hotmail.com> | 2023-11-14 13:28:02 +0100 |
|---|---|---|
| committer | Dante Niewenhuis <d.niewenhuis@hotmail.com> | 2023-11-14 13:32:46 +0100 |
| commit | d823cd1eb16d175fb778c9f6c9282aa16f1a25ff (patch) | |
| tree | 28f0461d8ccbac4db69e6ec748554b879b62f179 /opendc-compute/opendc-compute-simulator/src/main | |
| parent | 79c1818e116a7ac72d5210865a528538800bb794 (diff) | |
Updated TraceReader, Simulation now continues until all tasks are done
Diffstat (limited to 'opendc-compute/opendc-compute-simulator/src/main')
| -rw-r--r-- | opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/internal/Guest.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/internal/Guest.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/internal/Guest.kt index 02766cb1..354eb3d0 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/internal/Guest.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/internal/Guest.kt @@ -32,6 +32,7 @@ import org.opendc.compute.simulator.SimWorkloadMapper import org.opendc.simulator.compute.SimMachineContext import org.opendc.simulator.compute.kernel.SimHypervisor import org.opendc.simulator.compute.kernel.SimVirtualMachine +import org.opendc.simulator.compute.workload.SimWorkload import java.time.Duration import java.time.Instant import java.time.InstantSource @@ -169,7 +170,8 @@ internal class Guest( onStart() - val workload = mapper.createWorkload(server) + val workload: SimWorkload = mapper.createWorkload(server) + workload.setOffset(clock.millis()) val meta = mapOf("driver" to host, "server" to server) + server.meta ctx = machine.startWorkload(workload, meta) { cause -> onStop(if (cause != null) ServerState.ERROR else ServerState.TERMINATED) |
