Commit
2c0af7da which added the runtime memory changes functionality
had a small typo (wrong name); I've rewritten this to only compute the
delta once, for simplicity.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
self.be_proposed[constants.BE_MAXMEM]),
errors.ECODE_INVAL)
- if self.op.runtime_mem > current_memory:
+ delta = self.op.runtime_mem - current_memory
+ if delta > 0:
_CheckNodeFreeMemory(self, instance.primary_node,
"ballooning memory for instance %s" %
- instance.name,
- self.op.memory - current_memory,
- instance.hypervisor)
+ instance.name, delta, instance.hypervisor)
if self.op.disks and instance.disk_template == constants.DT_DISKLESS:
raise errors.OpPrereqError("Disk operations not supported for"