[pve-devel] applied: [PATCH qemu-server 10/16] rename 'volid' to 'drivestr' where it's not only a volume ID

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Feb 5 09:46:18 CET 2020


On January 29, 2020 2:30 pm, Fabian Ebner wrote:
> Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
> ---
>  PVE/QemuMigrate.pm | 10 +++++-----
>  PVE/QemuServer.pm  |  4 ++--
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index 49848e8..d025b09 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -491,7 +491,7 @@ sub cleanup_remotedisks {
>  
>      foreach my $target_drive (keys %{$self->{target_drive}}) {
>  
> -	my $drive = PVE::QemuServer::parse_drive($target_drive, $self->{target_drive}->{$target_drive}->{volid});
> +	my $drive = PVE::QemuServer::parse_drive($target_drive, $self->{target_drive}->{$target_drive}->{drivestr});
>  	my ($storeid, $volname) = PVE::Storage::parse_volume_id($drive->{file});
>  
>  	my $cmd = [@{$self->{rem_ssh}}, 'pvesm', 'free', "$storeid:$volname"];
> @@ -612,12 +612,12 @@ sub phase2 {
>  	    $spice_port = int($1);
>  	}
>  	elsif ($line =~ m/^storage migration listens on nbd:(localhost|[\d\.]+|\[[\d\.:a-fA-F]+\]):(\d+):exportname=(\S+) volume:(\S+)$/) {
> -	    my $volid = $4;
> +	    my $drivestr = $4;
>  	    my $nbd_uri = "nbd:$1:$2:exportname=$3";
>  	    my $targetdrive = $3;
>  	    $targetdrive =~ s/drive-//g;
>  
> -	    $self->{target_drive}->{$targetdrive}->{volid} = $volid;
> +	    $self->{target_drive}->{$targetdrive}->{drivestr} = $drivestr;
>  	    $self->{target_drive}->{$targetdrive}->{nbd_uri} = $nbd_uri;
>  
>  	} elsif ($line =~ m/^QEMU: (.*)$/) {
> @@ -687,7 +687,7 @@ sub phase2 {
>  	    my $target = $self->{target_drive}->{$drive};
>  	    my $nbd_uri = $target->{nbd_uri};
>  	    my $source_sid = PVE::Storage::Plugin::parse_volume_id($conf->{$drive});
> -	    my $target_sid = PVE::Storage::Plugin::parse_volume_id($target->{volid});
> +	    my $target_sid = PVE::Storage::Plugin::parse_volume_id($target->{drivestr});
>  	    my $bwlimit = PVE::Storage::get_bandwidth_limit('migrate', [$source_sid, $target_sid], $opt_bwlimit);
>  
>  	    $self->log('info', "$drive: start migration to $nbd_uri");
> @@ -963,7 +963,7 @@ sub phase3_cleanup {
>  	    die "Failed to complete storage migration: $err\n";
>  	} else {
>  	    foreach my $target_drive (keys %{$self->{target_drive}}) {
> -		my $drive = PVE::QemuServer::parse_drive($target_drive, $self->{target_drive}->{$target_drive}->{volid});
> +		my $drive = PVE::QemuServer::parse_drive($target_drive, $self->{target_drive}->{$target_drive}->{drivestr});
>  		$conf->{$target_drive} = PVE::QemuServer::print_drive($drive);
>  		PVE::QemuConfig->write_config($vmid, $conf);
>  	    }
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 7374bf1..c1f1c4e 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -5432,10 +5432,10 @@ sub vm_start {
>  	    $localip = "[$localip]" if Net::IP::ip_is_ipv6($localip);
>  
>  	    foreach my $opt (sort keys %$local_volumes) {
> -		my $volid = $local_volumes->{$opt};
> +		my $drivestr = $local_volumes->{$opt};
>  		mon_cmd($vmid, "nbd-server-add", device => "drive-$opt", writable => JSON::true );
>  		my $migrate_storage_uri = "nbd:${localip}:${storage_migrate_port}:exportname=drive-$opt";
> -		print "storage migration listens on $migrate_storage_uri volume:$volid\n";
> +		print "storage migration listens on $migrate_storage_uri volume:$drivestr\n";
>  	    }
>  	}
>  
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




More information about the pve-devel mailing list