[pve-devel] [PATCH 5/7] fix balloon pending update
Alexandre Derumier
aderumier at odiso.com
Wed Dec 31 14:38:12 CET 2014
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuServer.pm | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index df9ce74..a212183 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3537,6 +3537,10 @@ sub vmconfig_hotplug_pending {
} elsif ($opt eq 'cores') {
die "skip\n" if !$hotplug;
qemu_cpu_hotplug($vmid, $conf, 1);
+ } elsif ($opt eq 'balloon') {
+ #enable balloon device is not hotpluggable
+ die "skip\n" if ((defined($conf->{balloon})) && ($conf->{balloon} == 0));
+ } elsif ($opt eq 'shares') {
} elsif ($opt =~ m/^net(\d+)$/) {
die "skip\n" if !$hotplug;
vm_deviceunplug($vmid, $conf, $opt);
@@ -3574,10 +3578,15 @@ sub vmconfig_hotplug_pending {
die "skip\n" if !$hotplug;
qemu_cpu_hotplug($vmid, $conf, $value);
} elsif ($opt eq 'balloon') {
- die "skip\n" if !(defined($conf->{shares}) && ($conf->{shares} == 0));
+ # disable balloning device is not hotpluggable
+ die "skip\n" if ((defined($conf->{pending}->{balloon})) && ($conf->{pending}->{balloon} == 0));
+ # enable balloning device is not hotpluggable
+ die "skip\n" if ((defined($conf->{balloon})) && ($conf->{balloon} == 0));
# allow manual ballooning if shares is set to zero
- my $balloon = $conf->{pending}->{balloon} || $conf->{memory} || $defaults->{memory};
- vm_mon_cmd($vmid, "balloon", value => $balloon*1024*1024);
+ if (!(defined($conf->{shares}) && ($conf->{shares} == 0))) {
+ my $balloon = $conf->{pending}->{balloon} || $conf->{memory} || $defaults->{memory};
+ vm_mon_cmd($vmid, "balloon", value => $balloon*1024*1024);
+ }
} elsif ($opt =~ m/^net(\d+)$/) {
# some changes can be done without hotplug
vmconfig_update_net($storecfg, $conf, $vmid, $opt, $value);
--
1.7.10.4
More information about the pve-devel
mailing list