mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-29 18:45:29 +00:00
add virtio host_mtu feature.
This add a new "mtu" param to vm nic, and force the mtu in the guest for virtio nic only. Special value: 1 = set the same value than the bridge
This commit is contained in:
parent
55fb78aa4a
commit
61a14cde8d
@ -884,6 +884,12 @@ my $net_fmt = {
|
|||||||
description => 'Whether this interface should be disconnected (like pulling the plug).',
|
description => 'Whether this interface should be disconnected (like pulling the plug).',
|
||||||
optional => 1,
|
optional => 1,
|
||||||
},
|
},
|
||||||
|
mtu => {
|
||||||
|
type => 'integer',
|
||||||
|
minimum => 1, maximum => 65520,
|
||||||
|
description => 'Force mtu (virtio only). 1 = bridge mtu value',
|
||||||
|
optional => 1,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
my $netdesc = {
|
my $netdesc = {
|
||||||
@ -1593,6 +1599,19 @@ sub print_netdevice_full {
|
|||||||
}
|
}
|
||||||
$tmpstr .= ",bootindex=$net->{bootindex}" if $net->{bootindex} ;
|
$tmpstr .= ",bootindex=$net->{bootindex}" if $net->{bootindex} ;
|
||||||
|
|
||||||
|
if($net->{model} eq 'virtio' && $net->{mtu} && $net->{bridge}) {
|
||||||
|
|
||||||
|
my $mtu = $net->{mtu};
|
||||||
|
my $bridge_mtu = PVE::Network::read_bridge_mtu($net->{bridge});
|
||||||
|
|
||||||
|
if($mtu == 1) {
|
||||||
|
$mtu = $bridge_mtu;
|
||||||
|
} else {
|
||||||
|
die "mtu $mtu is bigger than bridge mtu $bridge_mtu" if $mtu > $bridge_mtu;
|
||||||
|
}
|
||||||
|
$tmpstr .= ",host_mtu=$mtu";
|
||||||
|
}
|
||||||
|
|
||||||
if ($use_old_bios_files) {
|
if ($use_old_bios_files) {
|
||||||
my $romfile;
|
my $romfile;
|
||||||
if ($device eq 'virtio-net-pci') {
|
if ($device eq 'virtio-net-pci') {
|
||||||
|
Loading…
Reference in New Issue
Block a user