summaryrefslogtreecommitdiff
path: root/opendc/opendc-compute/src
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-04-03 09:15:11 +0200
committerGeorgios Andreadis <info@gandreadis.com>2020-04-03 09:15:11 +0200
commit2da0b5bfc37febca2183374f74eece0b230f054e (patch)
tree4fbe33316cfd6a5fff3903475aedab201c2eed7c /opendc/opendc-compute/src
parent3fa3ad3af752b72ef792c2a4314e363f2586e59e (diff)
Filter on vms updated events
Diffstat (limited to 'opendc/opendc-compute/src')
-rw-r--r--opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt
index cc03d5f5..b4626def 100644
--- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt
+++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/virt/driver/SimpleVirtDriver.kt
@@ -50,6 +50,7 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
@@ -90,7 +91,7 @@ class SimpleVirtDriver(
override val events: Flow<HypervisorEvent> = eventFlow
init {
- events.onEach {
+ events.filter { it is HypervisorEvent.VmsUpdated }.onEach {
val imagesRunning = vms.map { it.server.image }.toSet()
vms.forEach {
val performanceModel =