mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-03 04:26:09 +00:00
migrate: don't accidentally take NBD code paths
by avoiding auto-vivification of $self->{online_local_volumes} via iteration. most code paths don't care whether it's undef or a reference to an empty list, but this caused the (already) fixed bug of calling nbd_stop without having started an NBD server in the first place. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
a4c7029dd8
commit
6f4b11e9db
@ -713,10 +713,14 @@ sub phase2 {
|
||||
$input .= "nbd_protocol_version: $nbd_protocol_version\n";
|
||||
|
||||
my $number_of_online_replicated_volumes = 0;
|
||||
foreach my $volid (@{$self->{online_local_volumes}}) {
|
||||
next if !$self->{replicated_volumes}->{$volid};
|
||||
$number_of_online_replicated_volumes++;
|
||||
$input .= "replicated_volume: $volid\n";
|
||||
|
||||
# prevent auto-vivification
|
||||
if ($self->{online_local_volumes}) {
|
||||
foreach my $volid (@{$self->{online_local_volumes}}) {
|
||||
next if !$self->{replicated_volumes}->{$volid};
|
||||
$number_of_online_replicated_volumes++;
|
||||
$input .= "replicated_volume: $volid\n";
|
||||
}
|
||||
}
|
||||
|
||||
my $target_replicated_volumes = {};
|
||||
|
Loading…
Reference in New Issue
Block a user