mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-30 12:34:22 +01:00
Add vm factory support per design in the VM Factory plugin section. The vm factory controls how a new vm is created: 1. direct: vm is created directly 2. template: vm is created via vm template. A template vm is pre-created and saved. Later vm is just a clone of the template vm so that they readonly share a portion of initial memory (including kernel, initramfs and the kata agent). CPU and memory are hot plugged when necessary. 3. cache: vm is created via vm caches. A set of cached vm are pre-created and maintained alive. New vms are created by just picking a cached vm. CPU and memory are hot plugged when necessary. Fixes: #303 Signed-off-by: Peng Tao <bergwolf@gmail.com>
16 lines
324 B
Go
16 lines
324 B
Go
// Copyright (c) 2018 HyperHQ Inc.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package virtcontainers
|
|
|
|
// Factory controls how a new VM is created.
|
|
type Factory interface {
|
|
// GetVM gets a new VM from the factory.
|
|
GetVM(config VMConfig) (*VM, error)
|
|
|
|
// CloseFactory closes and cleans up the factory.
|
|
CloseFactory()
|
|
}
|