]> git.proxmox.com Git - pve-container.git/commitdiff
apply pending changes during container start
authorOguz Bektas <o.bektas@proxmox.com>
Mon, 14 Oct 2019 08:28:50 +0000 (10:28 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 18:44:36 +0000 (20:44 +0200)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
src/PVE/LXC.pm

index cd59354643d93e1747de4d5554a259c00a4b4ea7..cdf6d6413588d0cf1c0ca87b1bd5ac6c8f3b4c77 100644 (file)
@@ -1932,6 +1932,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";