[pve-devel] [PATCH V3 qemu-server] Remove guest states to ensure no old states are exists

Wolfgang Link w.link at proxmox.com
Tue Jun 27 15:01:46 CEST 2017


---
 PVE/API2/Qemu.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

PATCH V2
Move delete_guest_states to ensure all checks are past.

PATCH V3
Move return 

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index da5f5b1..324e802 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -585,7 +585,12 @@ __PACKAGE__->register_method({
 	    return $rpcenv->fork_worker('qmcreate', $vmid, $authuser, $realcmd);
 	};
 
-	return PVE::QemuConfig->lock_config_full($vmid, 1, $archive ? $restorefn : $createfn);
+	my $ret = PVE::QemuConfig->lock_config_full($vmid, 1, $archive ? $restorefn : $createfn);
+
+	# ensure no old replication state are exists
+	PVE::ReplicationState::delete_guest_states($vmid);
+
+	return $ret;
     }});
 
 __PACKAGE__->register_method({
-- 
2.11.0





More information about the pve-devel mailing list