mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-01 21:44:22 +01:00
VMCache is a new function that creates VMs as caches before using it. It helps speed up new container creation. The function consists of a server and some clients communicating through Unix socket. The protocol is gRPC in protocols/cache/cache.proto. The VMCache server will create some VMs and cache them by factory cache. It will convert the VM to gRPC format and transport it when gets requestion from clients. Factory grpccache is the VMCache client. It will request gRPC format VM and convert it back to a VM. If VMCache function is enabled, kata-runtime will request VM from factory grpccache when it creates a new sandbox. VMCache has two options. vm_cache_number specifies the number of caches of VMCache: unspecified or == 0 --> VMCache is disabled > 0 --> will be set to the specified number vm_cache_endpoint specifies the address of the Unix socket. This commit just includes the core and the client of VMCache. Currently, VM cache still cannot work with VM templating and vsock. And just support qemu. Fixes: #52 Signed-off-by: Hui Zhu <teawater@hyper.sh>
58 lines
2.2 KiB
Go
58 lines
2.2 KiB
Go
// Copyright (c) 2018 Intel Corporation
|
|
// Copyright (c) 2018 HyperHQ Inc.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
// Note that some variables are "var" to allow them to be modified
|
|
// by the tests.
|
|
|
|
package katautils
|
|
|
|
var defaultHypervisorPath = "/usr/bin/qemu-lite-system-x86_64"
|
|
var defaultImagePath = "/usr/share/kata-containers/kata-containers.img"
|
|
var defaultKernelPath = "/usr/share/kata-containers/vmlinuz.container"
|
|
var defaultInitrdPath = "/usr/share/kata-containers/kata-containers-initrd.img"
|
|
var defaultFirmwarePath = ""
|
|
var defaultMachineAccelerators = ""
|
|
var defaultShimPath = "/usr/libexec/kata-containers/kata-shim"
|
|
var systemdUnitName = "kata-containers.target"
|
|
|
|
const defaultKernelParams = ""
|
|
const defaultMachineType = "pc"
|
|
|
|
const defaultVCPUCount uint32 = 1
|
|
const defaultMaxVCPUCount uint32 = 0
|
|
const defaultMemSize uint32 = 2048 // MiB
|
|
const defaultMemSlots uint32 = 10
|
|
const defaultMemOffset uint32 = 0 // MiB
|
|
const defaultBridgesCount uint32 = 1
|
|
const defaultInterNetworkingModel = "macvtap"
|
|
const defaultDisableBlockDeviceUse bool = false
|
|
const defaultBlockDeviceDriver = "virtio-scsi"
|
|
const defaultBlockDeviceCacheSet bool = false
|
|
const defaultBlockDeviceCacheDirect bool = false
|
|
const defaultBlockDeviceCacheNoflush bool = false
|
|
const defaultEnableIOThreads bool = false
|
|
const defaultEnableMemPrealloc bool = false
|
|
const defaultEnableHugePages bool = false
|
|
const defaultEnableSwap bool = false
|
|
const defaultEnableDebug bool = false
|
|
const defaultDisableNestingChecks bool = false
|
|
const defaultMsize9p uint32 = 8192
|
|
const defaultHotplugVFIOOnRootBus bool = false
|
|
const defaultEntropySource = "/dev/urandom"
|
|
const defaultGuestHookPath string = ""
|
|
|
|
const defaultVMCacheEndpoint string = "/var/run/kata-containers/cache.sock"
|
|
|
|
// Default config file used by stateless systems.
|
|
var defaultRuntimeConfiguration = "/usr/share/defaults/kata-containers/configuration.toml"
|
|
|
|
// Alternate config file that takes precedence over
|
|
// defaultRuntimeConfiguration.
|
|
var defaultSysConfRuntimeConfiguration = "/etc/kata-containers/configuration.toml"
|
|
|
|
var name = "kata"
|
|
var defaultProxyPath = "/usr/libexec/kata-containers/kata-proxy"
|
|
var defaultNetmonPath = "/usr/libexec/kata-containers/kata-netmon"
|