]> git.proxmox.com Git - qemu-server.git/commitdiff
fix reverting for non-existing configs
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 23 Oct 2019 09:39:53 +0000 (11:39 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Oct 2019 09:47:52 +0000 (11:47 +0200)
reverting a nonexisting option did not work with the latest changes
in pve-guest-common, because we do not delete the pending option
in 'add_to_pending_delete' anymore

this had the effect that we had following in the config:
[pending]
option: pendingvalue
delete: option

which would do the deletion code and the pending add code
(e.g. delete the pending cloud init drive and creating it again)

to avoid that situation, we need to remove the option from the pending hash
in the 'delete loop'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Qemu.pm

index 156ccab792822bf68751cf7b5019c5cd347eb39b..b2c0b0df006e569743990be63e5e3fffb34ff111 100644 (file)
@@ -1134,6 +1134,7 @@ my $update_vm_api  = sub {
                    next;
                }
                my $is_pending_val = defined($conf->{pending}->{$opt});
+               delete $conf->{pending}->{$opt};
 
                if ($opt =~ m/^unused/) {
                    my $drive = PVE::QemuServer::parse_drive($opt, $val);