[pve-devel] [PATCH container 1/1] close #1543: allow low-level lxc update

Simon LEONARD git-1001af4 at sinux.sh
Thu Jan 23 23:29:47 CET 2025


Signed-off-by: Simon LEONARD <git-1001af4 at sinux.sh>
---
 src/PVE/API2/LXC/Config.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/PVE/API2/LXC/Config.pm b/src/PVE/API2/LXC/Config.pm
index 5cbc014..0697043 100644
--- a/src/PVE/API2/LXC/Config.pm
+++ b/src/PVE/API2/LXC/Config.pm
@@ -123,7 +123,13 @@ __PACKAGE__->register_method({
 		    description => 'Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.',
 		    maxLength => 40,
 		    optional => 1,
-		}
+		},
+		lxc => {
+		    description => "Array of lxc low-level configurations ([[key1, value1], [key2, value2] ...]).",
+		    type => 'array',
+		    items => { type => 'array', items => { type => 'string' }},
+		    optional => 1,
+		},
 	    }),
     },
     returns => { type => 'null'},
@@ -208,6 +214,10 @@ __PACKAGE__->register_method({
 
 	    my $running = PVE::LXC::check_running($vmid);
 
+	    if (defined($param->{lxc})) {
+		$conf->{lxc} = $param->{lxc};
+	    }
+
 	    my $errors = PVE::LXC::Config->update_pct_config($vmid, $conf, $running, $param, \@delete, \@revert);
 	    # don't write to config if we get any errors – this can result in a broken config
 	    raise_param_exc($errors) if scalar(keys %$errors);
-- 
2.48.1




More information about the pve-devel mailing list