mirror of
https://github.com/apple/container.git
synced 2026-09-12 10:45:42 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user