From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2E24CF706 for ; Fri, 16 Dec 2022 14:39:23 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 10CE9225F2 for ; Fri, 16 Dec 2022 14:38:53 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 16 Dec 2022 14:38:52 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 409BB4381A; Fri, 16 Dec 2022 14:38:52 +0100 (CET) Message-ID: <3c98c2e7-9c14-464f-b8ae-0a77fefa38ca@proxmox.com> Date: Fri, 16 Dec 2022 14:38:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 From: Fiona Ebner To: pve-devel@lists.proxmox.com, aderumier@odiso.com References: <20221209192726.1499142-1-aderumier@odiso.com> <20221209192726.1499142-4-aderumier@odiso.com> Content-Language: en-US In-Reply-To: <20221209192726.1499142-4-aderumier@odiso.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.029 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm] Subject: Re: [pve-devel] [PATCH qemu-server 03/10] config: memory: add 'max' option X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2022 13:39:23 -0000 Am 09.12.22 um 20:27 schrieb Alexandre Derumier: > max can be multiple of 64GB only. > Some quick rationale as to why would be nice to have. > Signed-off-by: Alexandre Derumier > --- > PVE/QemuServer.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index ad69b76..0d5b550 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -267,6 +267,9 @@ my $rng_fmt = { > }, > }; > > + > +my @max_memory_list = map 65536*$_, 1..64; > + > my $memory_fmt = { > current => { > description => "Current amount of online RAM for the VM in MB. This is the maximum available memory when" > @@ -276,7 +279,12 @@ my $memory_fmt = { > optional => 1, > minimum => 16, > default => 512, > - } > + }, > + max => { > + type => 'integer', > + optional => 1, Style nit: wrong indentations Missing description. Even if it's just something like "Maximum amount of memory that can be hotplugged", it's better to have something than nothing. > + enum => [@max_memory_list], This feels like an abuse of enum to me. Instead, you could attach a verifier function to the format and die there with an appropriate error message. Or it will be this ;) memory.max: value '1' does not have a value in the enumeration '65536, 131072, 196608, 262144, 327680, 393216, 458752, 524288, 589824, 655360, 720896, 786432, 851968, 917504, 983040, 1048576, 1114112, 1179648, 1245184, 1310720, 1376256, 1441792, 1507328, 1572864, 1638400, 1703936, 1769472, 1835008, 1900544, 1966080, 2031616, 2097152, 2162688, 2228224, 2293760, 2359296, 2424832, 2490368, 2555904, 2621440, 2686976, 2752512, 2818048, 2883584, 2949120, 3014656, 3080192, 3145728, 3211264, 3276800, 3342336, 3407872, 3473408, 3538944, 3604480, 3670016, 3735552, 3801088, 3866624, 3932160, 3997696, 4063232, 4128768, 4194304'