5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-02-12 21:57:58 +03:00

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 <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-05-14 14:03:04 +02:00 committed by Wolfgang Bumiller
parent 82329cd55b
commit 75b51053cc

View File

@ -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+)$/) {