summaryrefslogtreecommitdiff
path: root/opendc
diff options
context:
space:
mode:
Diffstat (limited to 'opendc')
-rw-r--r--opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt13
1 files changed, 12 insertions, 1 deletions
diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt
index 2f1328ab..783a9138 100644
--- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt
+++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/hypervisor/HypervisorVirtDriver.kt
@@ -147,9 +147,10 @@ class HypervisorVirtDriver(
}
}
+ val granted = burst.clone()
// We run the total burst on the host processor. Note that this call may be cancelled at any moment in
// time, so not all of the burst may be executed.
- hostContext.run(burst, usage, deadline)
+ hostContext.run(granted, usage, deadline)
val end = simulationContext.clock.millis()
// No work was performed
@@ -180,6 +181,16 @@ class HypervisorVirtDriver(
vm.chan.send(Unit)
}
}
+
+ for (i in burst.indices) {
+ monitor.onSliceFinish(
+ end,
+ burst[i],
+ granted[i],
+ vms.size,
+ hostContext.server
+ )
+ }
}
this.call = call
call.invokeOnCompletion { this.call = null }