We don't need to set balloon value and polling interval when a vm is coming 
from a livemigrate.
(Values are keep in guest memory)

So with autoballooning, this avoid to set the ballon size at ballon_min value 
when the vm is migrated

Signed-off-by: Alexandre Derumier <aderum...@odiso.com>
---
 PVE/QemuServer.pm |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a599219..a7ffb8a 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2986,16 +2986,16 @@ sub vm_start {
            $capabilities->{state} = JSON::true;
            eval { vm_mon_cmd_nocheck($vmid, "migrate-set-capabilities", 
capabilities => [$capabilities]); };
        }
-
-       # fixme: how do we handle that on migration?
-
-       if (!defined($conf->{balloon}) || $conf->{balloon}) {
-           vm_mon_cmd_nocheck($vmid, "balloon", value => 
$conf->{balloon}*1024*1024) 
-               if $conf->{balloon};
-           vm_mon_cmd_nocheck($vmid, 'qom-set', 
-                      path => "machine/peripheral/balloon0", 
-                      property => "stats-polling-interval", 
-                      value => 2);
+       else{
+
+           if (!defined($conf->{balloon}) || $conf->{balloon}) {
+               vm_mon_cmd_nocheck($vmid, "balloon", value => 
$conf->{balloon}*1024*1024) 
+                   if $conf->{balloon};
+               vm_mon_cmd_nocheck($vmid, 'qom-set', 
+                           path => "machine/peripheral/balloon0", 
+                           property => "stats-polling-interval", 
+                           value => 2);
+           }
        }
     });
 }
-- 
1.7.10.4

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to