check also pending changes when reverting/deleting

otherwise we are not able to revert/delete pending changes which
introduce a new config line

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-05-29 10:37:23 +02:00 committed by Fabian Grünbichler
parent 77b4c60758
commit af6d2db4b3

View File

@ -1012,7 +1012,7 @@ my $update_vm_api = sub {
foreach my $opt (@delete) {
$modified->{$opt} = 1;
$conf = PVE::QemuConfig->load_config($vmid); # update/reload
if (!defined($conf->{$opt})) {
if (!defined($conf->{$opt}) && !defined($conf->{pending}->{$opt})) {
warn "cannot delete '$opt' - not set in current configuration!\n";
$modified->{$opt} = 0;
next;