[pve-devel] [PATCH v2 container 14/18] apply pending changes during container start

Oguz Bektas o.bektas at proxmox.com
Mon Sep 30 14:44:46 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..65c41f5 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1930,6 +1930,13 @@ sub userns_command {
 sub vm_start {
     my ($vmid, $conf, $skiplock) = @_;
 
+    # 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
+    }
+
     update_lxc_config($vmid, $conf);
 
     my $skiplock_flag_fn = "/run/lxc/skiplock-$vmid";
-- 
2.20.1




More information about the pve-devel mailing list