#1008239 libvirt-daemon: wrong MTU on bridge interface created by libvirt

Package:
libvirt-daemon-system
Source:
libvirt
Description:
Libvirt daemon configuration files
Submitter:
maxim orlov
Date:
2022-03-25 03:57:03 UTC
Severity:
normal
#1008239#5
Date:
2022-03-25 03:09:42 UTC
From:
To:
After creating virtual network from next XML file:
$ cat test.xml
<network>
  <name>test</name>
  <bridge name='test' stp='off' delay='0'/>
  <mtu size='9000'/>
</network>

$ virsh net-dumpxml test
<network>
  <name>test</name>
  <uuid>6db03fea-1275-4036-aa0c-fa12428631a8</uuid>
  <bridge name='test' stp='off' delay='0'/>
  <mtu size='9000'/>
  <mac address='52:54:00:34:2d:b1'/>
</network>

bridge interface ignore mtu settings 9000 and use default 1500

$ ip link
26: test: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:34:2d:b1 brd ff:ff:ff:ff:ff:ff
                                                  ^^^^

Bug doesn't exist in libvirt 5.0.0-4+deb10u1 (debian 10):
4: test: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 9000 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:23:cf:42 brd ff:ff:ff:ff:ff:ff
5: test-nic: <BROADCAST,MULTICAST> mtu 9000 qdisc pfifo_fast master test state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:23:cf:42 brd ff:ff:ff:ff:ff:ff

in libvirt 6.0.0-0ubuntu8.15 (ubuntu 20.04):
6: test: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 9000 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:97:39:0d brd ff:ff:ff:ff:ff:ff
7: test-nic: <BROADCAST,MULTICAST> mtu 9000 qdisc fq_codel master test state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:97:39:0d brd ff:ff:ff:ff:ff:ff

and in libvirt 8.0.0-1~bpo11+1 (bullseye-backports/main)
5: test: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 9000 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:3f:42:ee brd ff:ff:ff:ff:ff:ff

#1008239#10
Date:
2022-03-25 03:54:13 UTC
From:
To:
Looks like this is libvirt bug, because same behavior on fedora 34 with libvirt 7.0.0-8, but works correct on fedora 35 with 7.6.0-5

Fedora 34:
[root@fedora ~]# ip link
5: test: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
 link/ether 52:54:00:45:0b:ac brd ff:ff:ff:ff:ff:ff

Fedora 35:
[root@f35 ~]# ip link
5: test: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 9000 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
 link/ether 52:54:00:c8:0e:c0 brd ff:ff:ff:ff:ff:ff