]> git.proxmox.com Git - qemu-server.git/commitdiff
cloudinit: allow non-root users to set ciupgrade option
authorFriedrich Weber <f.weber@proxmox.com>
Mon, 24 Jul 2023 11:33:48 +0000 (13:33 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 25 Jul 2023 09:42:07 +0000 (11:42 +0200)
The new ciupgrade option was missing in $cloudinitoptions in
PVE::API2::Qemu, so $check_vm_modify_config_perm defaulted to
requiring root@pam for modifying the option. To fix this, add
ciupgrade to $cloudinitoptions. This also fixes an issue where
ciupgrade was missing in the output of `qm cloudinit pending`,
as it also relies on $cloudinitoptions.

This issue was originally reported in the forum [0].

Also add a comment to avoid similar issues when adding new options in
the future.

[0]: https://forum.proxmox.com/threads/131043/

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuServer.pm

index c7331f29e8b058d12493a9c63059b20bdb170422..030b3bade041ce3af0576ba3a671c16bded904f5 100644 (file)
@@ -562,6 +562,7 @@ my $cloudinitoptions = {
     cipassword => 1,
     citype => 1,
     ciuser => 1,
+    ciupgrade => 1,
     nameserver => 1,
     searchdomain => 1,
     sshkeys => 1,
index aff337288a035769183707b75522c55efdfa1a21..4c6ff8a7c47586d420c3832ff7f1311b10ad5abe 100644 (file)
@@ -760,6 +760,7 @@ my $cicustom_fmt = {
 };
 PVE::JSONSchema::register_format('pve-qm-cicustom', $cicustom_fmt);
 
+# any new option might need to be added to $cloudinitoptions in PVE::API2::Qemu
 my $confdesc_cloudinit = {
     citype => {
        optional => 1,