fix(vm.set): memoryMax should update resource set

This commit is contained in:
Julien Fontanet 2016-05-24 16:21:21 +02:00
parent ec100e1a91
commit f9109edcf1

View File

@ -415,6 +415,10 @@ set = $coroutine (params) ->
memoryMax = parseSize(params.memoryMax) memoryMax = parseSize(params.memoryMax)
if memoryMax > VM.memory.static[1] if memoryMax > VM.memory.static[1]
yield xapi.call 'VM.set_memory_static_max', memoryMax yield xapi.call 'VM.set_memory_static_max', memoryMax
if resourceSet?
yield @allocateLimitsInResourceSet({
memory: memory - VM.memory.dynamic[1]
}, resourceSet)
yield xapi.call 'VM.set_memory_dynamic_max', ref, "#{memoryMax}" yield xapi.call 'VM.set_memory_dynamic_max', ref, "#{memoryMax}"
if 'memoryStaticMax' of params if 'memoryStaticMax' of params
memoryStaticMax = parseSize(params.memoryStaticMax) memoryStaticMax = parseSize(params.memoryStaticMax)