[pve-devel] [PATCH v2 qemu-server] remote migration: fix online migration via API clients

Fiona Ebner f.ebner at proxmox.com
Wed Sep 4 13:14:53 CEST 2024


Am 03.09.24 um 11:37 schrieb Fabian Grünbichler:
> On August 13, 2024 10:42 am, Fiona Ebner wrote:
>> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
>> index e71face4..d31589e7 100644
>> --- a/PVE/QemuMigrate.pm
>> +++ b/PVE/QemuMigrate.pm
>> @@ -1095,7 +1095,10 @@ sub phase2 {
>>  	die "only UNIX sockets are supported for remote migration\n"
>>  	    if $tunnel_info->{proto} ne 'unix';
>>  
>> -	my $remote_socket = $tunnel_info->{addr};
>> +	# untaint
>> +	my ($remote_socket) =
>> +	    $tunnel_info->{addr} =~ m|^(/run/qemu-server/(?:(?!\.\./).)+\.migrate)$|;
> 
> should we just switch to `\d+`, like we do for regular migration? in
> phase2_start_local_cluster we have:
> 
> 	elsif ($line =~ m!^migration listens on (unix):(/run/qemu-server/(\d+)\.migrate)$!) {
> 	    $tunnel_info->{addr} = $2;
> 	    die "Destination UNIX sockets VMID does not match source VMID" if $vmid ne $3;
> 	    $tunnel_info->{proto} = $1;
> 	}
> 
> and I don't really see a reason to deviate from that scheme any time
> soon?
> 

Sounds good, did so in v3:
https://lore.proxmox.com/pve-devel/20240904111231.106570-1-f.ebner@proxmox.com/T/#u




More information about the pve-devel mailing list