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 <o.bektas@proxmox.com>
This commit is contained in:
Oguz Bektas 2021-12-02 12:43:03 +01:00 committed by Thomas Lamprecht
parent e3e34a10e7
commit a644de298c

View File

@ -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";