From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id F394B1FF16F
	for <inbox@lore.proxmox.com>; Thu, 19 Dec 2024 17:08:45 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 14670C574;
	Thu, 19 Dec 2024 17:08:46 +0100 (CET)
From: Daniel Kral <d.kral@proxmox.com>
To: f.gruenbichler@proxmox.com
Date: Thu, 19 Dec 2024 17:08:38 +0100
Message-Id: <20241219160838.187181-1-d.kral@proxmox.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20240416122054.733817-16-f.gruenbichler@proxmox.com>
References: <20240416122054.733817-16-f.gruenbichler@proxmox.com>
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.005 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pve-devel] [PATCH v2 qemu-server 2/6] vmstatus: add usage
 values for pool limits
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Cc: pve-devel@lists.proxmox.com
Content-Type: multipart/mixed; boundary="===============6902538922213216275=="
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

--===============6902538922213216275==
Content-Transfer-Encoding: quoted-printable

On 16/04/2024 14:20, Fabian Gr=C3=BCnbichler wrote:=0D
> these are separate from the existing ones to allow changes on either end=
=0D
> without side-effects, since the semantics are not quite the same.=0D
> =0D
> the conf values incorporate pending values (if higher than the current co=
nfig=0D
> value), and avoid clamping.=0D
> =0D
> the run values are currently identical to the regular ones.=0D
> =0D
> Signed-off-by: Fabian Gr=C3=BCnbichler <f.gruenbichler@proxmox.com>=0D
> ---=0D
>  PVE/QemuServer.pm | 29 +++++++++++++++++++++++++++++=0D
>  1 file changed, 29 insertions(+)=0D
> =0D
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm=0D
> index 661613df..93eaaec5 100644=0D
> --- a/PVE/QemuServer.pm=0D
> +++ b/PVE/QemuServer.pm=0D
> @@ -2755,6 +2755,18 @@ our $vmstatus_return_properties =3D {=0D
>  	optional =3D> 1,=0D
>  	renderer =3D> 'bytes',=0D
>      },=0D
> +    confmem =3D> {=0D
> +	description =3D> "Configured memory in bytes, might be higher than 'max=
mem'",=0D
=0D
nit: consistency with "amount of memory"=0D
=0D
> +	type =3D> 'integer',=0D
> +	optional =3D> 1,=0D
> +	renderer =3D> 'bytes',=0D
> +    },=0D
> +    runmem =3D> {=0D
> +	description =3D> "Currently plugged memory in bytes, if running.",=0D
=0D
for consistency's sake we could also use "configured" instead of=0D
"plugged" memory here (similar to pve-container).=0D
=0D
nit: consistency with "amount of memory"=0D
=0D
> +	type =3D> 'integer',=0D
> +	optional =3D> 1,=0D
> +	renderer =3D> 'bytes',=0D
> +    },=0D
>      maxdisk =3D> {=0D
>  	description =3D> "Root disk size in bytes.",=0D
>  	type =3D> 'integer',=0D
> @@ -2787,6 +2799,16 @@ our $vmstatus_return_properties =3D {=0D
>  	type =3D> 'number',=0D
>  	optional =3D> 1,=0D
>      },=0D
> +    confcpus =3D> {=0D
> +	description =3D> "Configured amount of CPUs, might be higher than 'cpus=
'.",=0D
> +	type =3D> 'number',=0D
> +	optional =3D> 1,=0D
> +    },=0D
> +    runcpus =3D> {=0D
> +	description =3D> "Currently used amount of CPUs.",=0D
=0D
same comment as for the pve-container: "configured" instead of "used".=0D
=0D
> +	type =3D> 'number',=0D
> +	optional =3D> 1,=0D
> +    },=0D
>      lock =3D> {=0D
>  	description =3D> "The current config lock, if any.",=0D
>  	type =3D> 'string',=0D
> @@ -2839,6 +2861,8 @@ sub vmstatus {=0D
>  	# fixme: better status?=0D
>  	$d->{status} =3D $list->{$vmid}->{pid} ? 'running' : 'stopped';=0D
>  =0D
> +	my $usage =3D PVE::QemuConfig->get_pool_usage($conf);=0D
> +=0D
>  	my $size =3D PVE::QemuServer::Drive::bootdisk_size($storecfg, $conf);=0D
>  	if (defined($size)) {=0D
>  	    $d->{disk} =3D 0; # no info available=0D
> @@ -2850,11 +2874,16 @@ sub vmstatus {=0D
>  =0D
>  	$d->{cpus} =3D ($conf->{sockets} || $defaults->{sockets})=0D
>  	    * ($conf->{cores} || $defaults->{cores});=0D
> +	=0D
=0D
Git complained about this line:=0D
=0D
Applying: vmstatus: add usage values for pool limits=0D
.git/rebase-apply/patch:58: trailing whitespace.=0D
=0D
warning: 1 line adds whitespace errors.=0D
=0D
>  	$d->{cpus} =3D $cpucount if $d->{cpus} > $cpucount;=0D
>  	$d->{cpus} =3D $conf->{vcpus} if $conf->{vcpus};=0D
> +	$d->{confcpus} =3D $usage->{cpu};=0D
> +	$d->{runcpus} =3D $d->{cpus};=0D
>  =0D
>  	$d->{name} =3D $conf->{name} || "VM $vmid";=0D
>  	$d->{maxmem} =3D get_current_memory($conf->{memory})*(1024*1024);=0D
> +	$d->{confmem} =3D $usage->{mem};=0D
> +	$d->{runmem} =3D $d->{maxmem};=0D
>  =0D
>  	if ($conf->{balloon}) {=0D
>  	    $d->{balloon_min} =3D $conf->{balloon}*(1024*1024);=0D
> -- =0D
> 2.39.2=0D
=0D
=0D
=0D
=0D
=0D



--===============6902538922213216275==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

--===============6902538922213216275==--