]> git.proxmox.com Git - qemu-server.git/commitdiff
enable balloon by default, unless explicitly disabled
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 19 Dec 2012 06:30:34 +0000 (07:30 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 19 Dec 2012 06:40:51 +0000 (07:40 +0100)
So that we can get memory stats from the guest.

PVE/QemuServer.pm

index 17f359a66a22276ae1c09f2e3e2ff43135d22cac..7cdd64794644b8448ae382a3a0b5146b16c53b63 100644 (file)
@@ -2344,8 +2344,11 @@ sub config_to_command {
        push @$devices, '-device', 'virtserialport,chardev=qga0,name=org.qemu.guest_agent.0';
     }
 
-    $pciaddr = print_pci_addr("balloon0", $bridges);
-    push @$devices, '-device', "virtio-balloon-pci,id=balloon0$pciaddr" if $conf->{balloon};
+    # enable balloon by default, unless explicitly disabled
+    if (!defined($conf->{balloon}) || $conf->{balloon}) {
+       $pciaddr = print_pci_addr("balloon0", $bridges);
+       push @$devices, '-device', "virtio-balloon-pci,id=balloon0$pciaddr";
+    }
 
     if ($conf->{watchdog}) {
        my $wdopts = parse_watchdog($conf->{watchdog});
@@ -2996,8 +2999,10 @@ sub vm_start {
        }
 
        # fixme: how do we handle that on migration?
-       if ($conf->{balloon}) {
-           vm_mon_cmd($vmid, "balloon", value => $conf->{balloon}*1024*1024);
+
+       if (!defined($conf->{balloon}) || $conf->{balloon}) {
+           vm_mon_cmd($vmid, "balloon", value => $conf->{balloon}*1024*1024) 
+               if $conf->{balloon};
            vm_mon_cmd($vmid, 'qom-set', 
                       path => "machine/peripheral/balloon0", 
                       property => "stats-polling-interval",