mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 14:51:37 +00:00
migrateall: use get_filtered_vmlist
instead of using get_start_stop_list in a rather hacky way use the new get_filtered_vmlist method and adapt the loop, as now only one level is required. most changes are just an indent shift left as we lost an unnecessary loop level Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b72cdbb752
commit
f5c1dde5f4
@ -1588,15 +1588,12 @@ __PACKAGE__->register_method ({
|
||||
die "either 'maxworkers' parameter or max_workers in datacenter.cfg must be set!\n";
|
||||
|
||||
my $code = sub {
|
||||
|
||||
$rpcenv->{type} = 'priv'; # to start tasks in background
|
||||
|
||||
my $migrateList = &$get_start_stop_list($nodename, undef, $param->{vms});
|
||||
my $vmlist = &$get_filtered_vmlist($nodename, $param->{vms}, 1, 1);
|
||||
|
||||
foreach my $order (sort {$b <=> $a} keys %$migrateList) {
|
||||
my $vmlist = $migrateList->{$order};
|
||||
my $workers = {};
|
||||
foreach my $vmid (sort {$b <=> $a} keys %$vmlist) {
|
||||
foreach my $vmid (sort keys %$vmlist) {
|
||||
my $d = $vmlist->{$vmid};
|
||||
my $pid;
|
||||
eval { $pid = &$create_migrate_worker($nodename, $d->{type}, $vmid, $target); };
|
||||
@ -1621,7 +1618,6 @@ __PACKAGE__->register_method ({
|
||||
}
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user