From a644de298cc2798f7374af82d1f8d34c7e0e81c2 Mon Sep 17 00:00:00 2001 From: Oguz Bektas Date: Thu, 2 Dec 2021 12:43:03 +0100 Subject: [PATCH] avoid writing the config if there are no pending changes to apply We drop properties which we do not understand and we call `vmconfig_apply_pending` on stop and before start, so if a user tried to edit the config or downgraded qemu-server they may get stuff dropped from the config just by doing a stop/start, which may be a bit too confusing, also the write is just unnecessary then. we also have the same skipping logic when starting vms, this way we avoid calling 'write_config' when there are no present changes to commit. Signed-off-by: Oguz Bektas --- PVE/QemuServer.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 45b704d9..0071a069 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -4998,6 +4998,8 @@ sub vmconfig_delete_or_detach_drive { sub vmconfig_apply_pending { my ($vmid, $conf, $storecfg, $errors) = @_; + return if !scalar(keys %{$conf->{pending}}); + my $add_apply_error = sub { my ($opt, $msg) = @_; my $err_msg = "unable to apply pending change $opt : $msg";