[pve-devel] [PATCH qemu-server] fix #1013 : migrate : sync_disk : --targetstorage with offline disk

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Dec 10 12:05:35 CET 2018


On 12/7/18 12:03 PM, Alexandre Derumier wrote:
> targetsid was not used, for disk unused (offline copy)
> ---
>  PVE/QemuMigrate.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index e9e9075..f422f2e 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -446,6 +446,7 @@ sub sync_disks {
>  
>  	foreach my $volid (keys %$local_volumes) {
>  	    my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
> +	    my $targetsid = $self->{opts}->{targetstorage} ? $self->{opts}->{targetstorage} : $storeid;

$storeid is not know/in scope here... did you mean $sid?

>  	    if ($self->{running} && $self->{opts}->{targetstorage} && $local_volumes->{$volid}->{ref} eq 'config') {
>  		push @{$self->{online_local_volumes}}, $volid;
>  	    } else {
> @@ -453,7 +454,7 @@ sub sync_disks {
>  		push @{$self->{volumes}}, $volid;
>  		my $insecure = $self->{opts}->{migration_type} eq 'insecure';
>  		my $with_snapshots = $local_volumes->{$volid}->{snapshots};
> -		PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid,
> +		PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $targetsid,
>  					      undef, undef, undef, undef, $insecure, $with_snapshots);
>  	    }
>  	}
> 





More information about the pve-devel mailing list