Make vmm create protocol async (#338)

The `vmm.create` call is already made within an async function. This PR
updates the protocol to allow other vmm implementations more flexibility
in `create`.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
Kathryn Baldauf
2025-10-17 14:54:57 -07:00
committed by GitHub
parent a14fd26a24
commit 09da9205c6
2 changed files with 2 additions and 2 deletions
@@ -364,7 +364,7 @@ extension LinuxContainer {
try await self.state.withLock { state in
try state.validateForCreate()
let vm = try self.vmm.create(container: self)
let vm = try await self.vmm.create(container: self)
try await vm.start()
do {
let relayManager = UnixSocketRelayManager(vm: vm)
@@ -16,5 +16,5 @@
/// A protocol to implement for virtual machine isolated containers.
public protocol VirtualMachineManager: Sendable {
func create(container: Container) throws -> any VirtualMachineInstance
func create(container: Container) async throws -> any VirtualMachineInstance
}