Commit 9b960bbc13 for qemu.org
commit 9b960bbc1361b2ab24022faa4957438c385dbc6e
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: Wed Feb 25 10:20:21 2026 +0100
hw/net/virtio-net: Remove VirtIONet::mtu_bypass_backend field
The VirtIONet::mtu_bypass_backend boolean was only set in
the hw_compat_2_9[] array, via the 'x-mtu-bypass-backend=off'
property. We removed all machines using that array, lets remove
that property and all the code around it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-17-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
[thuth: Adjusted patch for latest changes in the master branch]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-14-thuth@redhat.com>
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index eccb48ad42..2a5d642a64 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -935,8 +935,7 @@ static void virtio_net_set_features(VirtIODevice *vdev,
int i;
virtio_features_copy(features, in_features);
- if (n->mtu_bypass_backend &&
- !virtio_has_feature(vdev->backend_features, VIRTIO_NET_F_MTU)) {
+ if (!virtio_has_feature(vdev->backend_features, VIRTIO_NET_F_MTU)) {
virtio_clear_feature_ex(features, VIRTIO_NET_F_MTU);
}
@@ -3160,8 +3159,7 @@ static void virtio_net_get_features(VirtIODevice *vdev, uint64_t *features,
vhost_net_get_features_ex(get_vhost_net(nc->peer), features);
virtio_features_copy(vdev->backend_features_ex, features);
- if (n->mtu_bypass_backend &&
- (n->host_features & 1ULL << VIRTIO_NET_F_MTU)) {
+ if ((n->host_features & 1ULL << VIRTIO_NET_F_MTU) != 0) {
virtio_add_feature_ex(features, VIRTIO_NET_F_MTU);
}
@@ -4251,8 +4249,6 @@ static const Property virtio_net_properties[] = {
DEFINE_PROP_UINT16("tx_queue_size", VirtIONet, net_conf.tx_queue_size,
VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE),
DEFINE_PROP_UINT16("host_mtu", VirtIONet, net_conf.mtu, 0),
- DEFINE_PROP_BOOL("x-mtu-bypass-backend", VirtIONet, mtu_bypass_backend,
- true),
DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed, SPEED_UNKNOWN),
DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str),
DEFINE_PROP_BOOL("failover", VirtIONet, failover, false),
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index 5b8ab7bda7..371e376428 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -218,7 +218,6 @@ struct VirtIONet {
uint64_t saved_guest_offloads;
AnnounceTimer announce_timer;
bool needs_vnet_hdr_swap;
- bool mtu_bypass_backend;
/* primary failover device is hidden*/
bool failover_primary_hidden;
bool failover;