[pve-devel] [PATCH qemu-server 3/3] cleanup balloon after start call

Dominik Csapak d.csapak at proxmox.com
Mon May 14 14:03:05 CEST 2018


the not definedness check is unecessary here, since it does not
do anything then, and to check balloon twice is also not necessary

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/QemuServer.pm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 2a07bce..648a5f8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4922,10 +4922,8 @@ sub vm_start {
 	    }
 
 	} else {
-	    if (!$statefile && (!defined($conf->{balloon}) || $conf->{balloon})) {
-		vm_mon_cmd_nocheck($vmid, "balloon", value => $conf->{balloon}*1024*1024)
-		    if $conf->{balloon};
-	    }
+	    vm_mon_cmd_nocheck($vmid, "balloon", value => $conf->{balloon}*1024*1024)
+		if !$statefile && $conf->{balloon};
 
 	    foreach my $opt (keys %$conf) {
 		next if $opt !~  m/^net\d+$/;
-- 
2.11.0





More information about the pve-devel mailing list