]> git.proxmox.com Git - qemu-server.git/commitdiff
Remove guest states to ensure no old states are exists
authorWolfgang Link <w.link@proxmox.com>
Tue, 27 Jun 2017 13:12:03 +0000 (15:12 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 27 Jun 2017 13:31:41 +0000 (15:31 +0200)
PVE/API2/Qemu.pm

index eb7d6dde43d1148ce03804cbf0102b389f1a9347..40e68ddd702aeafb7a17363c95d5b1a1bc5468cb 100644 (file)
@@ -526,6 +526,9 @@ __PACKAGE__->register_method({
                PVE::AccessControl::add_vm_to_pool($vmid, $pool) if $pool;
            };
 
+           # ensure no old replication state are exists
+           PVE::ReplicationState::delete_guest_states($vmid);
+
            return $rpcenv->fork_worker('qmrestore', $vmid, $authuser, $realcmd);
        };
 
@@ -534,6 +537,9 @@ __PACKAGE__->register_method({
            # test after locking
            PVE::Cluster::check_vmid_unused($vmid);
 
+           # ensure no old replication state are exists
+           PVE::ReplicationState::delete_guest_states($vmid);
+
            my $realcmd = sub {
 
                my $vollist = [];