[pve-devel] [PATCH] allow manual ballooning if shares is not enabled
Dietmar Maurer
dietmar at proxmox.com
Fri Dec 28 14:08:09 CET 2012
Applied a slightly modified version, please test.
> -----Original Message-----
> From: pve-devel-bounces at pve.proxmox.com [mailto:pve-devel-
> bounces at pve.proxmox.com] On Behalf Of Alexandre Derumier
> Sent: Donnerstag, 20. Dezember 2012 15:07
> To: pve-devel at pve.proxmox.com
> Subject: [pve-devel] [PATCH] allow manual ballooning if shares is not enabled
>
>
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
> PVE/API2/Qemu.pm | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 09ab1e7..9bdbc0a 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -897,9 +897,15 @@ __PACKAGE__->register_method({
>
> &$vmconfig_update_net($rpcenv, $authuser, $conf,
> $storecfg, $vmid,
> $opt, $param->{$opt});
> -
> } else {
>
> + if ($opt eq 'balloon' && ((!$conf->{shares}) || ($conf-
> >{shares} && $conf->{shares} == 0))) {
> +
> + my $balloontarget = $param->{$opt};
> + $balloontarget = $conf->{memory} if $param->{$opt}
> == 0;
> + PVE::QemuServer::vm_mon_cmd_nocheck($vmid,
> "balloon", value => $balloontarget*1024*1024);
> + }
> +
> $conf->{$opt} = $param->{$opt};
> PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
> }
> --
> 1.7.10.4
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
More information about the pve-devel
mailing list