mirror of
git://git.proxmox.com/git/pve-guest-common.git
synced 2024-12-24 21:34:13 +03:00
PVE::ReplicationState::extract_vmid_tranfer_state - new helper
moved from PVE::QemuMigrate
This commit is contained in:
parent
18c369255d
commit
210a5f7970
@ -62,6 +62,20 @@ sub extract_job_state {
|
||||
return $state;
|
||||
}
|
||||
|
||||
sub extract_vmid_tranfer_state {
|
||||
my ($stateobj, $vmid, $old_target, $new_target) = @_;
|
||||
|
||||
my $oldid = PVE::ReplicationConfig::Cluster->get_unique_target_id({ target => $old_target });
|
||||
my $newid = PVE::ReplicationConfig::Cluster->get_unique_target_id({ target => $new_target });
|
||||
|
||||
if (defined(my $vmstate = $stateobj->{$vmid})) {
|
||||
$vmstate->{$newid} = delete($vmstate->{$oldid}) if defined($vmstate->{$oldid});
|
||||
return $vmstate;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
sub read_job_state {
|
||||
my ($jobcfg) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user