mirror of
https://git.proxmox.com/git/qemu-server
synced 2026-01-06 06:29:29 +00:00
migrate: aquire guest_migration_lock during migration
To block replication jobs.
This commit is contained in:
parent
628bb7f231
commit
95f42d61fa
@ -16,6 +16,7 @@ use PVE::Storage;
|
||||
use PVE::JSONSchema qw(get_standard_option);
|
||||
use PVE::RESTHandler;
|
||||
use PVE::ReplicationConfig;
|
||||
use PVE::GuestHelpers;
|
||||
use PVE::QemuConfig;
|
||||
use PVE::QemuServer;
|
||||
use PVE::QemuMigrate;
|
||||
@ -2856,13 +2857,17 @@ __PACKAGE__->register_method({
|
||||
|
||||
} else {
|
||||
|
||||
my $realcmd = sub {
|
||||
my $upid = shift;
|
||||
my $code = sub {
|
||||
my $realcmd = sub {
|
||||
my $upid = shift;
|
||||
|
||||
PVE::QemuMigrate->migrate($target, $targetip, $vmid, $param);
|
||||
PVE::QemuMigrate->migrate($target, $targetip, $vmid, $param);
|
||||
};
|
||||
|
||||
return $rpcenv->fork_worker('qmigrate', $vmid, $authuser, $realcmd);
|
||||
};
|
||||
|
||||
return $rpcenv->fork_worker('qmigrate', $vmid, $authuser, $realcmd);
|
||||
return PVE::GuestHelpers::guest_migration_lock($vmid, 10, $code);
|
||||
}
|
||||
|
||||
}});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user