]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #1749: do not copy pending changes when cloning a vm
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 2 May 2018 09:23:59 +0000 (11:23 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 4 May 2018 06:26:26 +0000 (08:26 +0200)
cloning a vm means copying the current state, not the
state of 'some time in the future, when the vm is started again'
we should not copy the pending changes, which also fixes the
issue that we got a wrong pending change on the disks,net,smbios,etc.

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

index 0f27d299fc6b2ecee2575942f6b0b1b689b06930..fb8a6e3cd30824bf8ce6e8b0a9b531c1a03b5b3f 100644 (file)
@@ -2723,6 +2723,13 @@ __PACKAGE__->register_method({
                    }
 
                    delete $newconf->{lock};
+
+                   # do not write pending changes
+                   if ($newconf->{pending}) {
+                       warn "found pending changes, discarding for clone\n";
+                       delete $newconf->{pending};
+                   }
+
                    PVE::QemuConfig->write_config($newid, $newconf);
 
                     if ($target) {