[pve-devel] [PATCH v5 08/19] fix balloon consistency check (consider pending changes)

Dietmar Maurer dietmar at proxmox.com
Tue Nov 25 10:19:28 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 d6a70c0..a8841c2 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