[pve-devel] [PATCH qemu-server v6 05/10] pci: set 'enable-migration' to on for live-migration marked mapped devices

Fiona Ebner f.ebner at proxmox.com
Fri Mar 7 12:20:24 CET 2025


Am 13.02.25 um 14:17 schrieb Dominik Csapak:
> the default is 'auto', but for those which are marked as capable for
> live migration, we want to explicitly enable that, so we get an early
> error on start if the driver does not support that.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>

Reviewed-by: Fiona Ebner <f.ebner at proxmox.com>

> ---
> no changes in v6
>  PVE/QemuServer/PCI.pm | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer/PCI.pm b/PVE/QemuServer/PCI.pm
> index a0d99692..6bde248b 100644
> --- a/PVE/QemuServer/PCI.pm
> +++ b/PVE/QemuServer/PCI.pm
> @@ -433,9 +433,11 @@ sub parse_hostpci {
>  	die "PCI device mapping not found for '$mapping'\n" if !$devices || !scalar($devices->@*);
>  
>  	my $config = PVE::Mapping::PCI::config();
> +	my $cfg = $config->{ids}->{$mapping};

Style nit: bit confusing to have such similarly named variables

> +	$res->{'live-migration-capable'} = 1 if $cfg->{'live-migration-capable'};
>  
>  	for my $device ($devices->@*) {
> -	    eval { PVE::Mapping::PCI::assert_valid($mapping, $device, $config->{ids}->{$mapping}) };
> +	    eval { PVE::Mapping::PCI::assert_valid($mapping, $device, $cfg) };
>  	    die "PCI device mapping invalid (hardware probably changed): $@\n" if $@;
>  	    push $alternatives->@*, [split(/;/, $device->{path})];
>  	}
> @@ -692,6 +694,10 @@ sub print_hostpci_devices {
>  		$devicestr .= ",host=$pcidevice->{id}";
>  	    }
>  
> +	    if ($d->{'live-migration-capable'}) {
> +		$devicestr .= ",enable-migration=on"

Style nit: missing semicolon

> +	    }
> +
>  	    my $mf_addr = $multifunction ? ".$j" : '';
>  	    $devicestr .= ",id=${id}${mf_addr}${pciaddr}${mf_addr}";
>  





More information about the pve-devel mailing list