mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-21 13:08:00 +00:00
clh: Use MemUnit to create VM
Provide memory in bytes using the new memory unit abstraction. Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
b6a7d8d63a
commit
2f948738e4
@ -214,7 +214,8 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
|
||||
clh.Logger().WithField("function", "createSandbox").WithError(err).Info("Sandbox not found creating ")
|
||||
|
||||
// Set initial memomory size of the virtual machine
|
||||
clh.vmconfig.Memory.Size = int64(clh.config.MemorySize) << utils.MibToBytesShift
|
||||
// Convert to int64 openApiClient only support int64
|
||||
clh.vmconfig.Memory.Size = int64((utils.MemUnit(clh.config.MemorySize) * utils.MiB).ToBytes())
|
||||
clh.vmconfig.Memory.File = "/dev/shm"
|
||||
// Set initial amount of cpu's for the virtual machine
|
||||
clh.vmconfig.Cpus = chclient.CpusConfig{
|
||||
|
Loading…
Reference in New Issue
Block a user