[pve-devel] [PATCH container 9/9] apply pending changes when container is started

Oguz Bektas o.bektas at proxmox.com
Thu Sep 5 16:11:21 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 475d9be..9dd5bc9 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1939,6 +1939,13 @@ sub vm_start {
 	close($fh);
     }
 
+    # apply pending changes while starting
+    my $storecfg = PVE::Storage::config();
+    if (scalar(keys %{$conf->{pending}})) {
+	PVE::LXC::Config->vmconfig_apply_pending($vmid, $conf, $storecfg);
+	$conf = PVE::LXC::Config->load_config($vmid); # update/reload
+    }
+
     my $cmd = ['systemctl', 'start', "pve-container\@$vmid"];
 
     PVE::GuestHelpers::exec_hookscript($conf, $vmid, 'pre-start', 1);
-- 
2.20.1




More information about the pve-devel mailing list