[pve-devel] [PATCH v3 8/9] fix balloon consistency check (consider pending changes)
Dietmar Maurer
dietmar at proxmox.com
Mon Nov 17 10:47:24 CET 2014
Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
PVE/API2/Qemu.pm | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index a3dbb06..a1f0f41 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -945,10 +945,9 @@ my $update_vm_api = sub {
PVE::QemuServer::check_lock($conf) if !$skiplock;
- # fixme: wrong place? howto handle pending changes? @delete ?
if ($param->{memory} || defined($param->{balloon})) {
- my $maxmem = $param->{memory} || $conf->{memory} || $defaults->{memory};
- my $balloon = defined($param->{balloon}) ? $param->{balloon} : $conf->{balloon};
+ my $maxmem = $param->{memory} || $conf->{pending}->{memory} || $conf->{memory} || $defaults->{memory};
+ my $balloon = defined($param->{balloon}) ? $param->{balloon} : $conf->{pending}->{balloon} || $conf->{balloon};
die "balloon value too large (must be smaller than assigned memory)\n"
if $balloon && $balloon > $maxmem;
--
1.7.10.4
More information about the pve-devel
mailing list