all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Simon LEONARD <git-1001af4@sinux.sh>
To: pve-devel@lists.proxmox.com
Cc: Simon LEONARD <git-1001af4@sinux.sh>
Subject: [pve-devel] [PATCH container 1/1] close #1543: allow low-level lxc update
Date: Thu, 23 Jan 2025 23:29:47 +0100	[thread overview]
Message-ID: <20250123222951.112660-2-git-1001af4@sinux.sh> (raw)
In-Reply-To: <20250123222951.112660-1-git-1001af4@sinux.sh>

Signed-off-by: Simon LEONARD <git-1001af4@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


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  reply	other threads:[~2025-01-24 11:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-23 22:29 [pve-devel] [PATCH container 0/1] " Simon LEONARD
2025-01-23 22:29 ` Simon LEONARD [this message]
2025-01-27 11:05   ` [pve-devel] [PATCH container 1/1] " Fabian Grünbichler
2025-03-22 18:05     ` [pve-devel] [PATCH container v2 0/1] close #1543: allow low-level lxc config Simon LEONARD
2025-03-22 18:05       ` [pve-devel] [PATCH container v2 1/1] close #1543: allow low-level lxc config update Simon LEONARD
2025-03-24 15:01       ` [pve-devel] [PATCH container v2 0/1] close #1543: allow low-level lxc config Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250123222951.112660-2-git-1001af4@sinux.sh \
    --to=git-1001af4@sinux.sh \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal