mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 11:41:16 +00:00
PVE/API2/Qemu.pm: aquire guest_migration_lock inside worker
This commit is contained in:
parent
c068c1c3a9
commit
f53c6ad8b9
@ -2857,17 +2857,17 @@ __PACKAGE__->register_method({
|
||||
|
||||
} else {
|
||||
|
||||
my $code = sub {
|
||||
my $realcmd = sub {
|
||||
my $upid = shift;
|
||||
my $realcmd = sub {
|
||||
my $upid = shift;
|
||||
|
||||
PVE::QemuMigrate->migrate($target, $targetip, $vmid, $param);
|
||||
};
|
||||
|
||||
return $rpcenv->fork_worker('qmigrate', $vmid, $authuser, $realcmd);
|
||||
PVE::QemuMigrate->migrate($target, $targetip, $vmid, $param);
|
||||
};
|
||||
|
||||
return PVE::GuestHelpers::guest_migration_lock($vmid, 10, $code);
|
||||
my $worker = sub {
|
||||
return PVE::GuestHelpers::guest_migration_lock($vmid, 10, $realcmd);
|
||||
};
|
||||
|
||||
return $rpcenv->fork_worker('qmigrate', $vmid, $authuser, $worker);
|
||||
}
|
||||
|
||||
}});
|
||||
|
Loading…
Reference in New Issue
Block a user