From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E0D101FF191 for ; Tue, 9 Sep 2025 11:19:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 29E924365; Tue, 9 Sep 2025 11:19:41 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 9 Sep 2025 11:16:59 +0200 Message-ID: <20250909091918.32254-4-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250909091918.32254-1-f.ebner@proxmox.com> References: <20250909091918.32254-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1757409555080 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.023 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server stable-bookworm v2 3/4] migration: only use nets-host-mtu for PVE 8 target if actually required X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Commit 1736fbeb ("migration: preserve host_mtu for virtio-net devices") addresses probblematic migration scenarios with VirtIO-net devices which inherit the MTU from the bridge. In Proxmox VE 9, the default behavior changed to inherit the MTU from the bridge, but for Proxmox VE 8, only an explicit mtu=1 will do so and thus be potentially problematic. By not using the nets-host-mtu parameter for unproblematic migrations, fricition is reduced, because backwards migrations to not-yet-upgraded Proxmox VE 8 nodes will still work. Signed-off-by: Fiona Ebner --- src/PVE/QemuMigrate.pm | 8 +++++--- src/PVE/QemuServer.pm | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm index 3cd7069a..ea35e54d 100644 --- a/src/PVE/QemuMigrate.pm +++ b/src/PVE/QemuMigrate.pm @@ -1148,9 +1148,11 @@ sub phase2 { }, }; - if (my $nets_host_mtu = PVE::QemuServer::get_nets_host_mtu($vmid, $conf)) { - $params->{start_params}->{'nets-host-mtu'} = $nets_host_mtu; - } + my $target_version = PVE::QemuServer::Helpers::get_node_pvecfg_version($self->{node}); + my $only_inherited_mtus = + $target_version && !PVE::QemuServer::Helpers::pvecfg_min_version($target_version, 9, 0, 0); + my $nets_host_mtu = PVE::QemuServer::get_nets_host_mtu($vmid, $conf, $only_inherited_mtus); + $params->{start_params}->{'nets-host-mtu'} = $nets_host_mtu if $nets_host_mtu; my ($tunnel_info, $spice_port); diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index b2a9f816..8bc55def 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -9535,13 +9535,14 @@ sub delete_ifaces_ipams_ips { } sub get_nets_host_mtu { - my ($vmid, $conf) = @_; + my ($vmid, $conf, $only_inherited_mtus) = @_; my $nets_host_mtu = []; for my $opt (sort keys $conf->%*) { next if $opt !~ m/^net(\d+)$/; my $net = parse_net($conf->{$opt}); next if $net->{model} ne 'virtio'; + next if $only_inherited_mtus && !($net->{mtu} && $net->{mtu} == 1); my $host_mtu = eval { mon_cmd( -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel