From: Fiona Ebner <f.ebner@proxmox.com>
To: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>,
"Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server 2/2] virtio-net: fix migration between default/non-default MTUs starting with machine version 10.0+pve1
Date: Wed, 3 Sep 2025 09:58:00 +0200 [thread overview]
Message-ID: <e26eaf3e-797d-4fae-87f0-e3e352a755ec@proxmox.com> (raw)
In-Reply-To: <1756882252.49rsx8buc9.astroid@yuna.none>
Am 03.09.25 um 9:22 AM schrieb Fabian Grünbichler:
> we could avoid the need for $version_guard in print_netdevice_full, if
> we do something like:
>
> ----8<----
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index 8528f9f3..d3c2486d 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -1466,7 +1466,6 @@ sub print_netdevice_full {
> $use_old_bios_files,
> $arch,
> $machine_version,
> - $version_guard,
> ) = @_;
>
> my $device = $net->{model};
> @@ -1505,10 +1504,7 @@ sub print_netdevice_full {
> die "netdev $netid: MTU '$mtu' is bigger than the bridge MTU '$bridge_mtu'\n";
> }
>
> - my $always_set_host_mtu =
> - $version_guard
> - ? $version_guard->(10, 0, 1)
> - : min_version($machine_version, 10, 0, 1);
> + my $always_set_host_mtu = min_version($machine_version, 10, 0, 1);
> if ($always_set_host_mtu) {
> $tmpstr .= ",host_mtu=$mtu";
> } else {
> @@ -3837,6 +3833,8 @@ sub config_to_command {
> my $netdevfull = print_netdev_full($vmid, $conf, $arch, $d, $netname);
> push @$devices, '-netdev', $netdevfull;
>
> + # force +pve1 if machine version 10, for host_mtu differentiation
> + $version_guard->(10, 0, 1);
> my $netdevicefull = print_netdevice_full(
> $vmid,
> $conf,
> @@ -3846,7 +3844,6 @@ sub config_to_command {
> $use_old_bios_files,
> $arch,
> $machine_version,
> - $version_guard,
> );
>
> push @$devices, '-device', $netdevicefull;
> ---->8----
Yes, sounds good to me!
> (with the downside of now bumping to +pve1 for unversioned VMs as soon
> as they have a NIC, instead of more fine-grained, but that shouldn't
> really hurt?)
You won't be able to migrate such VMs to a host with non-updated
qemu-server, but that is true in general for such version bumps and
virtio-net is the most common use case in any case, so users already
need to update.
> that might make it easier to (at some point) move more of this into its
> own module (or QemuServer::Network)?
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
prev parent reply other threads:[~2025-09-03 7:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 13:44 [pve-devel] [PATCH-SERIES qemu-server 0/2] virtio-net: fix migration between default/non-default MTUs, part one Fiona Ebner
2025-09-02 13:44 ` [pve-devel] [PATCH qemu-server 1/2] run make tidy Fiona Ebner
2025-09-02 13:44 ` [pve-devel] [PATCH qemu-server 2/2] virtio-net: fix migration between default/non-default MTUs starting with machine version 10.0+pve1 Fiona Ebner
2025-09-03 7:22 ` Fabian Grünbichler
2025-09-03 7:58 ` Fiona Ebner [this message]
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=e26eaf3e-797d-4fae-87f0-e3e352a755ec@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=f.gruenbichler@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