...
1
2
3 package hcs
4
5 import (
6 "github.com/Microsoft/hcsshim/internal/vm"
7 )
8
9 func (uvmb *utilityVMBuilder) SetMemoryLimit(memoryMB uint64) error {
10 uvmb.doc.VirtualMachine.ComputeTopology.Memory.SizeInMB = memoryMB
11 return nil
12 }
13
14 func (uvmb *utilityVMBuilder) SetMemoryConfig(config *vm.MemoryConfig) error {
15 memory := uvmb.doc.VirtualMachine.ComputeTopology.Memory
16 memory.AllowOvercommit = config.BackingType == vm.MemoryBackingTypeVirtual
17 memory.EnableDeferredCommit = config.DeferredCommit
18 memory.EnableHotHint = config.HotHint
19 memory.EnableColdHint = config.ColdHint
20 memory.EnableColdDiscardHint = config.ColdDiscardHint
21 return nil
22 }
23
24 func (uvmb *utilityVMBuilder) SetMMIOConfig(lowGapMB uint64, highBaseMB uint64, highGapMB uint64) error {
25 memory := uvmb.doc.VirtualMachine.ComputeTopology.Memory
26 memory.LowMMIOGapInMB = lowGapMB
27 memory.HighMMIOBaseInMB = highBaseMB
28 memory.HighMMIOGapInMB = highGapMB
29 return nil
30 }
31
View as plain text