Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
clh: Use MemUnit to create VM
Browse files Browse the repository at this point in the history
Provide memory in bytes using the new memory unit abstraction.

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
  • Loading branch information
jcvenegas committed Mar 25, 2020
1 parent b6a7d8d commit 2f94873
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virtcontainers/clh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 2f94873

Please sign in to comment.