From: Dominik Csapak Date: Mon, 14 May 2018 12:03:04 +0000 (+0200) Subject: fix logic of deleting balloon X-Git-Url: https://git.proxmox.com/?p=qemu-server.git;a=commitdiff_plain;h=75b51053cc1cc09b5bc9cb9821ce03c51b8b24eb fix logic of deleting balloon Deleting the balloon config entry means resetting it to its default. This means having a balloon device but not actually doing any ballooning with it (iow. resetting the VM's 'balloon' value to its specified memory.). Hotplugging a balloon device (coming from explicit '0' to any other value (including deleting it)) is not possible. Signed-off-by: Dominik Csapak --- diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 6756abd..2a07bce 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -4297,7 +4297,10 @@ sub vmconfig_hotplug_pending { qemu_cpu_hotplug($vmid, $conf, undef); } elsif ($opt eq 'balloon') { # enable balloon device is not hotpluggable - die "skip\n" if !defined($conf->{balloon}) || $conf->{balloon}; + die "skip\n" if defined($conf->{balloon}) && $conf->{balloon} == 0; + # here we reset the ballooning value to memory + my $balloon = $conf->{memory} || $defaults->{memory}; + vm_mon_cmd($vmid, "balloon", value => $balloon*1024*1024); } elsif ($fast_plug_option->{$opt}) { # do nothing } elsif ($opt =~ m/^net(\d+)$/) {