From f2028b23e25c8520f25a53771a1b261c4e991bb8 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 11 Jan 2021 15:37:34 +0100 Subject: Add hypervisor supporting space-shared VMs This change adds a new hypervisor implementation that supports virtual machine that have exclusive access to resources (e.g., CPU). --- .../main/kotlin/org/opendc/compute/core/virt/driver/VirtDriver.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'simulator/opendc-compute/opendc-compute-core/src') diff --git a/simulator/opendc-compute/opendc-compute-core/src/main/kotlin/org/opendc/compute/core/virt/driver/VirtDriver.kt b/simulator/opendc-compute/opendc-compute-core/src/main/kotlin/org/opendc/compute/core/virt/driver/VirtDriver.kt index 5ecfd357..68cc7b50 100644 --- a/simulator/opendc-compute/opendc-compute-core/src/main/kotlin/org/opendc/compute/core/virt/driver/VirtDriver.kt +++ b/simulator/opendc-compute/opendc-compute-core/src/main/kotlin/org/opendc/compute/core/virt/driver/VirtDriver.kt @@ -23,6 +23,7 @@ package org.opendc.compute.core.virt.driver import kotlinx.coroutines.flow.Flow +import org.opendc.compute.core.Flavor import org.opendc.compute.core.Server import org.opendc.compute.core.image.Image import org.opendc.compute.core.virt.HypervisorEvent @@ -39,6 +40,11 @@ public interface VirtDriver { */ public val events: Flow + /** + * Determine whether the specified [flavor] can still fit on this driver. + */ + public fun canFit(flavor: Flavor): Boolean + /** * Spawn the given [Image] on the compute resource of this driver. * @@ -50,7 +56,7 @@ public interface VirtDriver { public suspend fun spawn( name: String, image: Image, - flavor: org.opendc.compute.core.Flavor + flavor: Flavor ): Server public companion object Key : AbstractServiceKey(UUID.randomUUID(), "virtual-driver") -- cgit v1.2.3