[pve-devel] [PATCH qemu-server] Add a migration lock to avoid a replication on rollback-time.
Wolfgang Link
w.link at proxmox.com
Mon Jun 12 10:38:22 CEST 2017
---
PVE/API2/Qemu.pm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 54db5ab..b5b183f 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -3394,7 +3394,12 @@ __PACKAGE__->register_method({
PVE::QemuConfig->snapshot_rollback($vmid, $snapname);
};
- return $rpcenv->fork_worker('qmrollback', $vmid, $authuser, $realcmd);
+ my $worker = sub {
+ # hold migration lock, this makes sure that nobody create replication snapshots
+ return PVE::GuestHelpers::guest_migration_lock($vmid, 10, $realcmd);
+ };
+
+ return $rpcenv->fork_worker('qmrollback', $vmid, $authuser, $worker);
}});
__PACKAGE__->register_method({
--
2.11.0
More information about the pve-devel
mailing list