]> git.proxmox.com Git - pve-common.git/commitdiff
schema: explicitly set min/max for vmid option
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 16 Jun 2023 07:35:37 +0000 (09:35 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Jun 2023 08:21:47 +0000 (10:21 +0200)
The associated pve_verify_vmid() method already restricts the value
to this range, but this wouldn't be visible in the API viewer for
example [0].

The verify method is also called by qemu-server's qmextract, so it's
not possible to just drop the method right now.

[0]: https://forum.proxmox.com/threads/128845/post-564526

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
src/PVE/JSONSchema.pm

index 60b02cb19eefb0759999306e4fbe638ea55e270d..7589bbad4e56c93c17e9dfb7af34014ed7a665cb 100644 (file)
@@ -59,8 +59,10 @@ sub get_standard_option {
 
 register_standard_option('pve-vmid', {
     description => "The (unique) ID of the VM.",
-    type => 'integer', format => 'pve-vmid',
-    minimum => 1
+    type => 'integer',
+    format => 'pve-vmid',
+    minimum => 100,
+    maximum => 999_999_999,
 });
 
 register_standard_option('pve-node', {