[pve-devel] [PATCH v3 container 18/19] apply pending changes during container start

Oguz Bektas o.bektas at proxmox.com
Mon Oct 14 10:28:50 CEST 2019


Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 src/PVE/LXC.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index fa66aaf..6b5bd44 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1934,6 +1934,13 @@ sub userns_command {
 sub vm_start {
     my ($vmid, $conf, $skiplock) = @_;
 
+    # apply pending changes while starting
+    if (scalar(keys %{$conf->{pending}})) {
+	my $storecfg = PVE::Storage::config();
+	PVE::LXC::Config->vmconfig_apply_pending($vmid, $conf, $storecfg);
+	$conf = PVE::LXC::Config->load_config($vmid); # update/reload
+    }
+
     update_lxc_config($vmid, $conf);
 
     my $skiplock_flag_fn = "/run/lxc/skiplock-$vmid";
-- 
2.20.1




More information about the pve-devel mailing list