* [pve-devel] [PATCH-SERIES qemu-server 0/2] virtio-net: fix migration between default/non-default MTUs, part one
@ 2025-09-02 13:44 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
0 siblings, 2 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-09-02 13:44 UTC (permalink / raw)
To: pve-devel
The virtual hardware is generated differently (at least for i440fx
machines) when host_mtu is set or not set on the netdev command line
[0]. When the MTU is the same value as the default 1500, Proxmox VE
did not add a host_mtu parameter. This is problematic for migration
where host_mtu is present on one end of the migration, but not on the
other [1]. Migration between command lines where host_mtu is set on
both ends, even if set to different values, works fine.
Always set the host_mtu parameter starting with machine version
10.0+pve1 to avoid this issue going forward. Handling migrations with
older machine versions is more involved and will be done in separate
patches. In particular, the plan is to query whether host_mtu is
present for migration and pass that information along from source to
target. And for snapshots, it might make sense to record the
qemu-server version in the snapshot configuration and base the
decision off that, defaulting to Proxmox VE 8 behavior if no such
information is present, except when the machine version is 10.0+pve0,
defaulting to PVE 9 behavior from before the fixes.
[0]: https://bugzilla.redhat.com/show_bug.cgi?id=1449346
[1]: https://forum.proxmox.com/threads/live-vm-migration-fails.169537/post-796379
Fiona Ebner (2):
run make tidy
virtio-net: fix migration between default/non-default MTUs starting
with machine version 10.0+pve1
src/PVE/QemuServer.pm | 28 +++++++++++++++++--
src/PVE/QemuServer/Machine.pm | 6 ++++
src/test/cfg2cmd/bootorder-empty.conf.cmd | 4 +--
src/test/cfg2cmd/bootorder-legacy.conf.cmd | 4 +--
src/test/cfg2cmd/bootorder.conf.cmd | 4 +--
src/test/cfg2cmd/efidisk-on-rbd.conf.cmd | 4 +--
src/test/cfg2cmd/ide.conf.cmd | 4 +--
.../cfg2cmd/netdev-7.1-multiqueues.conf.cmd | 2 +-
src/test/cfg2cmd/netdev-7.1.conf.cmd | 2 +-
src/test/cfg2cmd/netdev_vxlan.conf.cmd | 2 +-
src/test/cfg2cmd/q35-ide.conf.cmd | 4 +--
.../q35-linux-hostpci-mapping.conf.cmd | 4 +--
.../q35-linux-hostpci-multifunction.conf.cmd | 4 +--
...q35-linux-hostpci-x-pci-overrides.conf.cmd | 4 +--
src/test/cfg2cmd/q35-linux-hostpci.conf.cmd | 4 +--
src/test/cfg2cmd/q35-simple.conf.cmd | 4 +--
src/test/cfg2cmd/seabios_serial.conf.cmd | 4 +--
src/test/cfg2cmd/simple-btrfs.conf.cmd | 4 +--
.../cfg2cmd/simple-disk-passthrough.conf.cmd | 4 +--
src/test/cfg2cmd/simple-rbd.conf.cmd | 4 +--
src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 4 +--
.../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 4 +--
src/test/cfg2cmd/simple1.conf.cmd | 4 +--
23 files changed, 70 insertions(+), 42 deletions(-)
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH qemu-server 1/2] run make tidy
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 ` 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
1 sibling, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-09-02 13:44 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index f263fedb..38fa3f83 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -7379,7 +7379,10 @@ sub live_import_from_files {
my ($interface, $index) = PVE::QemuServer::Drive::parse_drive_interface($dev);
my $drive = { file => $volid, interface => $interface, index => $index };
my $blockdev = PVE::QemuServer::Blockdev::generate_drive_blockdev(
- $storecfg, $drive, $machine_version, { 'no-throttle' => 1 },
+ $storecfg,
+ $drive,
+ $machine_version,
+ { 'no-throttle' => 1 },
);
$live_restore_backing->{$dev}->{blockdev} = $blockdev;
} else {
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH qemu-server 2/2] virtio-net: fix migration between default/non-default MTUs starting with machine version 10.0+pve1
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 ` Fiona Ebner
2025-09-03 7:22 ` Fabian Grünbichler
1 sibling, 1 reply; 5+ messages in thread
From: Fiona Ebner @ 2025-09-02 13:44 UTC (permalink / raw)
To: pve-devel
The virtual hardware is generated differently (at least for i440fx
machines) when host_mtu is set or not set on the netdev command line
[0]. When the MTU is the same value as the default 1500, Proxmox VE
did not add a host_mtu parameter. This is problematic for migration
where host_mtu is present on one end of the migration, but not on the
other [1]. Migration between command lines where host_mtu is set on
both ends, even if set to different values, works fine.
Always set the host_mtu parameter starting with machine version
10.0+pve1 to avoid this issue going forward. Handling migrations with
older machine versions is more involved and will be done in separate
patches. Thanks to Stefan Hanreich and Fabian Grünbichler for
discussing this with me!
Since print_netdevice_full() is also called for hotplug, it cannot
always use the $version_guard helper and needs to fallback to
min_version() then.
[0]: https://bugzilla.redhat.com/show_bug.cgi?id=1449346
[1]: https://forum.proxmox.com/threads/live-vm-migration-fails.169537/post-796379
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 23 +++++++++++++++++--
src/PVE/QemuServer/Machine.pm | 6 +++++
src/test/cfg2cmd/bootorder-empty.conf.cmd | 4 ++--
src/test/cfg2cmd/bootorder-legacy.conf.cmd | 4 ++--
src/test/cfg2cmd/bootorder.conf.cmd | 4 ++--
src/test/cfg2cmd/efidisk-on-rbd.conf.cmd | 4 ++--
src/test/cfg2cmd/ide.conf.cmd | 4 ++--
.../cfg2cmd/netdev-7.1-multiqueues.conf.cmd | 2 +-
src/test/cfg2cmd/netdev-7.1.conf.cmd | 2 +-
src/test/cfg2cmd/netdev_vxlan.conf.cmd | 2 +-
src/test/cfg2cmd/q35-ide.conf.cmd | 4 ++--
.../q35-linux-hostpci-mapping.conf.cmd | 4 ++--
.../q35-linux-hostpci-multifunction.conf.cmd | 4 ++--
...q35-linux-hostpci-x-pci-overrides.conf.cmd | 4 ++--
src/test/cfg2cmd/q35-linux-hostpci.conf.cmd | 4 ++--
src/test/cfg2cmd/q35-simple.conf.cmd | 4 ++--
src/test/cfg2cmd/seabios_serial.conf.cmd | 4 ++--
src/test/cfg2cmd/simple-btrfs.conf.cmd | 4 ++--
.../cfg2cmd/simple-disk-passthrough.conf.cmd | 4 ++--
src/test/cfg2cmd/simple-rbd.conf.cmd | 4 ++--
src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 4 ++--
.../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 4 ++--
src/test/cfg2cmd/simple1.conf.cmd | 4 ++--
23 files changed, 66 insertions(+), 41 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 38fa3f83..8528f9f3 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -1457,7 +1457,17 @@ sub print_pbs_blockdev {
}
sub print_netdevice_full {
- my ($vmid, $conf, $net, $netid, $bridges, $use_old_bios_files, $arch, $machine_version) = @_;
+ my (
+ $vmid,
+ $conf,
+ $net,
+ $netid,
+ $bridges,
+ $use_old_bios_files,
+ $arch,
+ $machine_version,
+ $version_guard,
+ ) = @_;
my $device = $net->{model};
if ($net->{model} eq 'virtio') {
@@ -1495,7 +1505,15 @@ sub print_netdevice_full {
die "netdev $netid: MTU '$mtu' is bigger than the bridge MTU '$bridge_mtu'\n";
}
- $tmpstr .= ",host_mtu=$mtu" if $mtu != 1500;
+ my $always_set_host_mtu =
+ $version_guard
+ ? $version_guard->(10, 0, 1)
+ : min_version($machine_version, 10, 0, 1);
+ if ($always_set_host_mtu) {
+ $tmpstr .= ",host_mtu=$mtu";
+ } else {
+ $tmpstr .= ",host_mtu=$mtu" if $mtu != 1500;
+ }
} elsif (defined($mtu)) {
warn
"WARN: netdev $netid: ignoring MTU '$mtu', not using VirtIO or no bridge configured.\n";
@@ -3828,6 +3846,7 @@ sub config_to_command {
$use_old_bios_files,
$arch,
$machine_version,
+ $version_guard,
);
push @$devices, '-device', $netdevicefull;
diff --git a/src/PVE/QemuServer/Machine.pm b/src/PVE/QemuServer/Machine.pm
index 9d17344a..4c135a20 100644
--- a/src/PVE/QemuServer/Machine.pm
+++ b/src/PVE/QemuServer/Machine.pm
@@ -37,6 +37,12 @@ our $PVE_MACHINE_VERSION = {
'+pve1' => 'Disables S3/S4 power states by default.',
},
},
+ '10.0' => {
+ highest => 1,
+ revisions => {
+ '+pve1' => 'Set host_mtu vNIC option even with default value for migration compat.',
+ },
+ },
};
my $machine_fmt = {
diff --git a/src/test/cfg2cmd/bootorder-empty.conf.cmd b/src/test/cfg2cmd/bootorder-empty.conf.cmd
index 3516b344..af4a5ba6 100644
--- a/src/test/cfg2cmd/bootorder-empty.conf.cmd
+++ b/src/test/cfg2cmd/bootorder-empty.conf.cmd
@@ -39,5 +39,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"eeb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"feb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"drive-virtio1","read-only":false,"throttle-group":"throttle-drive-virtio1"}' \
-device 'virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/bootorder-legacy.conf.cmd b/src/test/cfg2cmd/bootorder-legacy.conf.cmd
index c86ab6f9..6b848a9b 100644
--- a/src/test/cfg2cmd/bootorder-legacy.conf.cmd
+++ b/src/test/cfg2cmd/bootorder-legacy.conf.cmd
@@ -39,5 +39,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"eeb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"feb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"drive-virtio1","read-only":false,"throttle-group":"throttle-drive-virtio1"}' \
-device 'virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1,bootindex=302,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=100' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=100,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/bootorder.conf.cmd b/src/test/cfg2cmd/bootorder.conf.cmd
index 48f9da8b..a3c6bd39 100644
--- a/src/test/cfg2cmd/bootorder.conf.cmd
+++ b/src/test/cfg2cmd/bootorder.conf.cmd
@@ -39,5 +39,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"eeb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"feb683fb9c516c1a8707c917f0d7a38","read-only":false},"node-name":"drive-virtio1","read-only":false,"throttle-group":"throttle-drive-virtio1"}' \
-device 'virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=101' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=101,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd b/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
index 5d0c8aff..dda9d91b 100644
--- a/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
+++ b/src/test/cfg2cmd/efidisk-on-rbd.conf.cmd
@@ -31,5 +31,5 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=pc+pve0'
+ -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=pc+pve1'
diff --git a/src/test/cfg2cmd/ide.conf.cmd b/src/test/cfg2cmd/ide.conf.cmd
index 6b5a52a9..23282a18 100644
--- a/src/test/cfg2cmd/ide.conf.cmd
+++ b/src/test/cfg2cmd/ide.conf.cmd
@@ -42,5 +42,5 @@
-blockdev '{"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-2.qcow2","node-name":"ec11e0572184321efc5835152b95d5d","read-only":false},"node-name":"fc11e0572184321efc5835152b95d5d","read-only":false},"node-name":"drive-scsi0","read-only":false,"throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,device_id=drive-scsi0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/netdev-7.1-multiqueues.conf.cmd b/src/test/cfg2cmd/netdev-7.1-multiqueues.conf.cmd
index 776bab30..43e40742 100644
--- a/src/test/cfg2cmd/netdev-7.1-multiqueues.conf.cmd
+++ b/src/test/cfg2cmd/netdev-7.1-multiqueues.conf.cmd
@@ -25,4 +25,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on,queues=2' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,vectors=6,mq=on,packed=on,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=900' \
- -machine 'type=pc+pve0'
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/netdev-7.1.conf.cmd b/src/test/cfg2cmd/netdev-7.1.conf.cmd
index 0d6b3ad2..10404de4 100644
--- a/src/test/cfg2cmd/netdev-7.1.conf.cmd
+++ b/src/test/cfg2cmd/netdev-7.1.conf.cmd
@@ -25,4 +25,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=900' \
- -machine 'type=pc+pve0'
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/netdev_vxlan.conf.cmd b/src/test/cfg2cmd/netdev_vxlan.conf.cmd
index a2f3579d..7de574a7 100644
--- a/src/test/cfg2cmd/netdev_vxlan.conf.cmd
+++ b/src/test/cfg2cmd/netdev_vxlan.conf.cmd
@@ -25,4 +25,4 @@
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1450' \
- -machine 'type=pc+pve0'
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/q35-ide.conf.cmd b/src/test/cfg2cmd/q35-ide.conf.cmd
index 475e58d9..9af48002 100644
--- a/src/test/cfg2cmd/q35-ide.conf.cmd
+++ b/src/test/cfg2cmd/q35-ide.conf.cmd
@@ -41,5 +41,5 @@
-blockdev '{"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/images/100/vm-100-disk-2.qcow2","node-name":"ec11e0572184321efc5835152b95d5d","read-only":false},"node-name":"fc11e0572184321efc5835152b95d5d","read-only":false},"node-name":"drive-scsi0","read-only":false,"throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,device_id=drive-scsi0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=q35+pve0'
+ -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'type=q35+pve1'
diff --git a/src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd
index b0c3e587..7413a651 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci-mapping.conf.cmd
@@ -35,5 +35,5 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
+ -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve1'
diff --git a/src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd
index b4aa46f5..f8435778 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd
@@ -35,5 +35,5 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
+ -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve1'
diff --git a/src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd
index 6c4937c7..b314b8ad 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci-x-pci-overrides.conf.cmd
@@ -34,5 +34,5 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
+ -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve1'
diff --git a/src/test/cfg2cmd/q35-linux-hostpci.conf.cmd b/src/test/cfg2cmd/q35-linux-hostpci.conf.cmd
index 19e6ba3c..b6914255 100644
--- a/src/test/cfg2cmd/q35-linux-hostpci.conf.cmd
+++ b/src/test/cfg2cmd/q35-linux-hostpci.conf.cmd
@@ -40,5 +40,5 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
+ -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve1'
diff --git a/src/test/cfg2cmd/q35-simple.conf.cmd b/src/test/cfg2cmd/q35-simple.conf.cmd
index e3f712c3..9cdb5bdb 100644
--- a/src/test/cfg2cmd/q35-simple.conf.cmd
+++ b/src/test/cfg2cmd/q35-simple.conf.cmd
@@ -28,5 +28,5 @@
-device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve0'
+ -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve1'
diff --git a/src/test/cfg2cmd/seabios_serial.conf.cmd b/src/test/cfg2cmd/seabios_serial.conf.cmd
index 8fc0509b..ce2d7cf2 100644
--- a/src/test/cfg2cmd/seabios_serial.conf.cmd
+++ b/src/test/cfg2cmd/seabios_serial.conf.cmd
@@ -31,5 +31,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"ecd04be4259153b8293415fefa2a84c","read-only":false},"node-name":"fcd04be4259153b8293415fefa2a84c","read-only":false},"node-name":"drive-scsi0","read-only":false,"throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,device_id=drive-scsi0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'smm=off,type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'smm=off,type=pc+pve1'
diff --git a/src/test/cfg2cmd/simple-btrfs.conf.cmd b/src/test/cfg2cmd/simple-btrfs.conf.cmd
index f80421ad..b73aae79 100644
--- a/src/test/cfg2cmd/simple-btrfs.conf.cmd
+++ b/src/test/cfg2cmd/simple-btrfs.conf.cmd
@@ -40,5 +40,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/butter/bread/images/8006/vm-8006-disk-0/disk.raw","node-name":"e7487c01d831e2b51a5446980170ec9","read-only":false},"node-name":"f7487c01d831e2b51a5446980170ec9","read-only":false},"node-name":"drive-scsi3","read-only":false,"throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi3,id=scsi3,device_id=drive-scsi3,write-cache=off' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/simple-disk-passthrough.conf.cmd b/src/test/cfg2cmd/simple-disk-passthrough.conf.cmd
index 987a6c82..2b3a22e5 100644
--- a/src/test/cfg2cmd/simple-disk-passthrough.conf.cmd
+++ b/src/test/cfg2cmd/simple-disk-passthrough.conf.cmd
@@ -36,5 +36,5 @@
-blockdev '{"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/mnt/file.raw","node-name":"e234a4e3b89ac3adac9bdbf0c3dd6b4","read-only":false},"node-name":"f234a4e3b89ac3adac9bdbf0c3dd6b4","read-only":false},"node-name":"drive-scsi1","read-only":false,"throttle-group":"throttle-drive-scsi1"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1,device_id=drive-scsi1,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/simple-rbd.conf.cmd b/src/test/cfg2cmd/simple-rbd.conf.cmd
index b848672c..29dfaacc 100644
--- a/src/test/cfg2cmd/simple-rbd.conf.cmd
+++ b/src/test/cfg2cmd/simple-rbd.conf.cmd
@@ -52,5 +52,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-8006-disk-0","node-name":"eb0b017124a47505c97a5da052e0141","read-only":false},"node-name":"fb0b017124a47505c97a5da052e0141","read-only":false},"node-name":"drive-scsi7","read-only":false,"throttle-group":"throttle-drive-scsi7"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=7,drive=drive-scsi7,id=scsi7,device_id=drive-scsi7,write-cache=off' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/simple-virtio-blk.conf.cmd b/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
index a9acb0cf..efec4a20 100644
--- a/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
+++ b/src/test/cfg2cmd/simple-virtio-blk.conf.cmd
@@ -31,5 +31,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"edd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"fdd19f6c1b3a6d5a6248c3376a91a16","read-only":false},"node-name":"drive-virtio0","read-only":false,"throttle-group":"throttle-drive-virtio0"}' \
-device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,iothread=iothread-virtio0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd b/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
index 4fa6a5a9..21bfd638 100644
--- a/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
+++ b/src/test/cfg2cmd/simple-zfs-over-iscsi.conf.cmd
@@ -40,5 +40,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"raw","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"iscsi","lun":0,"node-name":"e915a332310039f7a3feed6901eb5da","portal":"127.0.0.1","read-only":false,"target":"iqn.2019-10.org.test:foobar","transport":"tcp"},"node-name":"f915a332310039f7a3feed6901eb5da","read-only":false},"node-name":"drive-scsi3","read-only":false,"throttle-group":"throttle-drive-scsi3"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi3,id=scsi3,device_id=drive-scsi3,write-cache=off' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'type=pc+pve1'
diff --git a/src/test/cfg2cmd/simple1.conf.cmd b/src/test/cfg2cmd/simple1.conf.cmd
index 49b848f2..eef2868b 100644
--- a/src/test/cfg2cmd/simple1.conf.cmd
+++ b/src/test/cfg2cmd/simple1.conf.cmd
@@ -31,5 +31,5 @@
-blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"qcow2","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"file","filename":"/var/lib/vz/images/8006/vm-8006-disk-0.qcow2","node-name":"ecd04be4259153b8293415fefa2a84c","read-only":false},"node-name":"fcd04be4259153b8293415fefa2a84c","read-only":false},"node-name":"drive-scsi0","read-only":false,"throttle-group":"throttle-drive-scsi0"}' \
-device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,device_id=drive-scsi0,bootindex=100,write-cache=on' \
-netdev 'type=tap,id=net0,ifname=tap8006i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on' \
- -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \
- -machine 'type=pc+pve0'
+ -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300,host_mtu=1500' \
+ -machine 'type=pc+pve1'
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 2/2] virtio-net: fix migration between default/non-default MTUs starting with machine version 10.0+pve1
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
0 siblings, 1 reply; 5+ messages in thread
From: Fabian Grünbichler @ 2025-09-03 7:22 UTC (permalink / raw)
To: Proxmox VE development discussion
On September 2, 2025 3:44 pm, Fiona Ebner wrote:
> The virtual hardware is generated differently (at least for i440fx
> machines) when host_mtu is set or not set on the netdev command line
> [0]. When the MTU is the same value as the default 1500, Proxmox VE
> did not add a host_mtu parameter. This is problematic for migration
> where host_mtu is present on one end of the migration, but not on the
> other [1]. Migration between command lines where host_mtu is set on
> both ends, even if set to different values, works fine.
>
> Always set the host_mtu parameter starting with machine version
> 10.0+pve1 to avoid this issue going forward. Handling migrations with
> older machine versions is more involved and will be done in separate
> patches. Thanks to Stefan Hanreich and Fabian Grünbichler for
> discussing this with me!
>
> Since print_netdevice_full() is also called for hotplug, it cannot
> always use the $version_guard helper and needs to fallback to
> min_version() then.
>
> [0]: https://bugzilla.redhat.com/show_bug.cgi?id=1449346
> [1]: https://forum.proxmox.com/threads/live-vm-migration-fails.169537/post-796379
>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> src/PVE/QemuServer.pm | 23 +++++++++++++++++--
> src/PVE/QemuServer/Machine.pm | 6 +++++
> src/test/cfg2cmd/bootorder-empty.conf.cmd | 4 ++--
> src/test/cfg2cmd/bootorder-legacy.conf.cmd | 4 ++--
> src/test/cfg2cmd/bootorder.conf.cmd | 4 ++--
> src/test/cfg2cmd/efidisk-on-rbd.conf.cmd | 4 ++--
> src/test/cfg2cmd/ide.conf.cmd | 4 ++--
> .../cfg2cmd/netdev-7.1-multiqueues.conf.cmd | 2 +-
> src/test/cfg2cmd/netdev-7.1.conf.cmd | 2 +-
> src/test/cfg2cmd/netdev_vxlan.conf.cmd | 2 +-
> src/test/cfg2cmd/q35-ide.conf.cmd | 4 ++--
> .../q35-linux-hostpci-mapping.conf.cmd | 4 ++--
> .../q35-linux-hostpci-multifunction.conf.cmd | 4 ++--
> ...q35-linux-hostpci-x-pci-overrides.conf.cmd | 4 ++--
> src/test/cfg2cmd/q35-linux-hostpci.conf.cmd | 4 ++--
> src/test/cfg2cmd/q35-simple.conf.cmd | 4 ++--
> src/test/cfg2cmd/seabios_serial.conf.cmd | 4 ++--
> src/test/cfg2cmd/simple-btrfs.conf.cmd | 4 ++--
> .../cfg2cmd/simple-disk-passthrough.conf.cmd | 4 ++--
> src/test/cfg2cmd/simple-rbd.conf.cmd | 4 ++--
> src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 4 ++--
> .../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 4 ++--
> src/test/cfg2cmd/simple1.conf.cmd | 4 ++--
> 23 files changed, 66 insertions(+), 41 deletions(-)
>
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index 38fa3f83..8528f9f3 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -1457,7 +1457,17 @@ sub print_pbs_blockdev {
> }
>
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----
(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?)
that might make it easier to (at some point) move more of this into its
own module (or QemuServer::Network)?
other than this, seems to behave as expected so either variant is fine
for me :)
> sub print_netdevice_full {
> - my ($vmid, $conf, $net, $netid, $bridges, $use_old_bios_files, $arch, $machine_version) = @_;
> + my (
> + $vmid,
> + $conf,
> + $net,
> + $netid,
> + $bridges,
> + $use_old_bios_files,
> + $arch,
> + $machine_version,
> + $version_guard,
> + ) = @_;
>
> my $device = $net->{model};
> if ($net->{model} eq 'virtio') {
> @@ -1495,7 +1505,15 @@ sub print_netdevice_full {
> die "netdev $netid: MTU '$mtu' is bigger than the bridge MTU '$bridge_mtu'\n";
> }
>
> - $tmpstr .= ",host_mtu=$mtu" if $mtu != 1500;
> + my $always_set_host_mtu =
> + $version_guard
> + ? $version_guard->(10, 0, 1)
> + : min_version($machine_version, 10, 0, 1);
> + if ($always_set_host_mtu) {
> + $tmpstr .= ",host_mtu=$mtu";
> + } else {
> + $tmpstr .= ",host_mtu=$mtu" if $mtu != 1500;
> + }
> } elsif (defined($mtu)) {
> warn
> "WARN: netdev $netid: ignoring MTU '$mtu', not using VirtIO or no bridge configured.\n";
> @@ -3828,6 +3846,7 @@ sub config_to_command {
> $use_old_bios_files,
> $arch,
> $machine_version,
> + $version_guard,
> );
>
> push @$devices, '-device', $netdevicefull;
> diff --git a/src/PVE/QemuServer/Machine.pm b/src/PVE/QemuServer/Machine.pm
> index 9d17344a..4c135a20 100644
> --- a/src/PVE/QemuServer/Machine.pm
> +++ b/src/PVE/QemuServer/Machine.pm
> @@ -37,6 +37,12 @@ our $PVE_MACHINE_VERSION = {
> '+pve1' => 'Disables S3/S4 power states by default.',
> },
> },
> + '10.0' => {
> + highest => 1,
> + revisions => {
> + '+pve1' => 'Set host_mtu vNIC option even with default value for migration compat.',
> + },
> + },
> };
>
> my $machine_fmt = {
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 2/2] virtio-net: fix migration between default/non-default MTUs starting with machine version 10.0+pve1
2025-09-03 7:22 ` Fabian Grünbichler
@ 2025-09-03 7:58 ` Fiona Ebner
0 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-09-03 7:58 UTC (permalink / raw)
To: Fabian Grünbichler, Proxmox VE development discussion
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-09-03 7:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox