]> git.proxmox.com Git - qemu-server.git/commitdiff
check also pending changes when reverting/deleting
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 29 May 2017 08:37:23 +0000 (10:37 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 31 May 2017 09:40:14 +0000 (11:40 +0200)
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>
PVE/API2/Qemu.pm

index eb61cb8e231f08e98415a43cb71252d7e0b6a0ee..54db5ab0caaf43255dcf8d73fb9262eddd31c32c 100644 (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;