From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server stable-bookworm v2 3/4] migration: only use nets-host-mtu for PVE 8 target if actually required
Date: Tue, 9 Sep 2025 11:16:59 +0200 [thread overview]
Message-ID: <20250909091918.32254-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250909091918.32254-1-f.ebner@proxmox.com>
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 <f.ebner@proxmox.com>
---
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
next prev parent reply other threads:[~2025-09-09 9:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 9:16 [pve-devel] [PATCH-SERIES qemu-server v2 0/4] migration: reduce friction with nets-host-mtu Fiona Ebner
2025-09-09 9:16 ` [pve-devel] [PATCH qemu-server master v2 1/4] migration: tell users to upgrade if nets-host-mtu is not supported Fiona Ebner
2025-09-09 9:16 ` [pve-devel] [PATCH qemu-server master v2 2/4] migration: remove unused variable Fiona Ebner
2025-09-09 9:16 ` Fiona Ebner [this message]
2025-09-09 9:17 ` [pve-devel] [PATCH qemu-server stable-bookworm v2 4/4] migration: tell users to upgrade if nets-host-mtu is required but not supported Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250909091918.32254-4-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox