mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-27 20:18:57 +00:00
initdata: add initdata annotation in hypervisor config
- Add Initdata annotation for hypervisor config, so that it can be passed when CreateVM Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>
This commit is contained in:
parent
ff498c55d1
commit
4d66ee1935
@ -542,6 +542,9 @@ func addHypervisorConfigOverrides(ocispec specs.Spec, config *vc.SandboxConfig,
|
||||
|
||||
config.HypervisorConfig.SGXEPCSize = size
|
||||
}
|
||||
if initdata, ok := ocispec.Annotations[vcAnnotations.Initdata]; ok {
|
||||
config.HypervisorConfig.Initdata = initdata
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -680,6 +680,9 @@ type HypervisorConfig struct {
|
||||
|
||||
// QgsPort defines Intel Quote Generation Service port exposed from the host
|
||||
QgsPort uint32
|
||||
|
||||
// Initdata defines the initdata passed into guest when CreateVM
|
||||
Initdata string
|
||||
}
|
||||
|
||||
// vcpu mapping from vcpu number to thread number
|
||||
|
@ -243,6 +243,9 @@ const (
|
||||
|
||||
// EnableRootlessHypervisor is a sandbox annotation to enable rootless hypervisor (only supported in QEMU currently).
|
||||
EnableRootlessHypervisor = kataAnnotHypervisorPrefix + "rootless"
|
||||
|
||||
// Initdata is the initdata passed in when CreateVM
|
||||
Initdata = kataConfAnnotationsPrefix + "runtime.cc_init_data"
|
||||
)
|
||||
|
||||
// Runtime related annotations
|
||||
|
@ -79,6 +79,7 @@ func (rh *remoteHypervisor) CreateVM(ctx context.Context, id string, network Net
|
||||
annotations[hypannotations.MachineType] = hypervisorConfig.HypervisorMachineType
|
||||
annotations[hypannotations.DefaultVCPUs] = strconv.FormatUint(uint64(hypervisorConfig.NumVCPUs()), 10)
|
||||
annotations[hypannotations.DefaultMemory] = strconv.FormatUint(uint64(hypervisorConfig.MemorySize), 10)
|
||||
annotations[hypannotations.Initdata] = hypervisorConfig.Initdata
|
||||
|
||||
req := &pb.CreateVMRequest{
|
||||
Id: id,
|
||||
|
Loading…
Reference in New Issue
Block a user