[pve-devel] [PATCH qemu-server 03/10] config: memory: add 'max' option
    Alexandre Derumier 
    aderumier at odiso.com
       
    Fri Dec  9 20:27:19 CET 2022
    
    
  
max can be multiple of 64GB only.
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 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,
+	enum => [@max_memory_list],
+    },
 };
 
 my $meta_info_fmt = {
-- 
2.30.2
    
    
More information about the pve-devel
mailing list