mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-06 03:56:34 +00:00
clh: runtime: add disable_image_nvdimm support
Allow users to build using DEFDISABLEIMAGENVDIMM=true if they want to set disable_image_nvdimm=true in configuration-clh.toml. disable_image_nvdimm=false is the default config value. Also, use virtio-blk instead of nvdimm if disable_image_nvdimm=true in configuration-clh.toml. Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
parent
0dd9325264
commit
1aeef52bae
@ -220,6 +220,12 @@ block_device_driver = "virtio-blk"
|
|||||||
# Default 1
|
# Default 1
|
||||||
#hypervisor_loglevel = 1
|
#hypervisor_loglevel = 1
|
||||||
|
|
||||||
|
# If false and nvdimm is supported, use nvdimm device to plug guest image.
|
||||||
|
# Otherwise virtio-block device is used.
|
||||||
|
#
|
||||||
|
# nvdimm is not supported when `confidential_guest = true`.
|
||||||
|
disable_image_nvdimm = @DEFDISABLEIMAGENVDIMM@
|
||||||
|
|
||||||
# Enable hot-plugging of VFIO devices to a root-port.
|
# Enable hot-plugging of VFIO devices to a root-port.
|
||||||
# The default setting is "no-port"
|
# The default setting is "no-port"
|
||||||
#hot_plug_vfio = "root-port"
|
#hot_plug_vfio = "root-port"
|
||||||
|
@ -1095,6 +1095,7 @@ func newClhHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
|
|||||||
BlockDeviceCacheDirect: h.BlockDeviceCacheDirect,
|
BlockDeviceCacheDirect: h.BlockDeviceCacheDirect,
|
||||||
EnableIOThreads: h.EnableIOThreads,
|
EnableIOThreads: h.EnableIOThreads,
|
||||||
Msize9p: h.msize9p(),
|
Msize9p: h.msize9p(),
|
||||||
|
DisableImageNvdimm: h.DisableImageNvdimm,
|
||||||
ColdPlugVFIO: h.coldPlugVFIO(),
|
ColdPlugVFIO: h.coldPlugVFIO(),
|
||||||
HotPlugVFIO: h.hotPlugVFIO(),
|
HotPlugVFIO: h.hotPlugVFIO(),
|
||||||
PCIeRootPort: h.pcieRootPort(),
|
PCIeRootPort: h.pcieRootPort(),
|
||||||
|
@ -570,7 +570,10 @@ func (clh *cloudHypervisor) CreateVM(ctx context.Context, id string, network Net
|
|||||||
// Set initial amount of cpu's for the virtual machine
|
// Set initial amount of cpu's for the virtual machine
|
||||||
clh.vmconfig.Cpus = chclient.NewCpusConfig(int32(clh.config.NumVCPUs()), int32(clh.config.DefaultMaxVCPUs))
|
clh.vmconfig.Cpus = chclient.NewCpusConfig(int32(clh.config.NumVCPUs()), int32(clh.config.DefaultMaxVCPUs))
|
||||||
|
|
||||||
params, err := getNonUserDefinedKernelParams(hypervisorConfig.RootfsType, clh.config.ConfidentialGuest, !clh.config.ConfidentialGuest, clh.config.Debug, clh.config.ConfidentialGuest, clh.config.IOMMU)
|
disableNvdimm := (clh.config.DisableImageNvdimm || clh.config.ConfidentialGuest)
|
||||||
|
enableDax := !disableNvdimm
|
||||||
|
|
||||||
|
params, err := getNonUserDefinedKernelParams(hypervisorConfig.RootfsType, disableNvdimm, enableDax, clh.config.Debug, clh.config.ConfidentialGuest, clh.config.IOMMU)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -590,7 +593,7 @@ func (clh *cloudHypervisor) CreateVM(ctx context.Context, id string, network Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
if assetType == types.ImageAsset {
|
if assetType == types.ImageAsset {
|
||||||
if clh.config.ConfidentialGuest {
|
if clh.config.DisableImageNvdimm || clh.config.ConfidentialGuest {
|
||||||
disk := chclient.NewDiskConfig(assetPath)
|
disk := chclient.NewDiskConfig(assetPath)
|
||||||
disk.SetReadonly(true)
|
disk.SetReadonly(true)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user