From nobody Tue Sep 9 19:00:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748876461; cv=none; d=zohomail.com; s=zohoarc; b=iFqQTWvXxXwQh9Yqa3lxYDJQNrLM91GZvmGhe+nyND8QMkAs5k4MpsdUfB+3Ic8wE+JcIVdq2GE0cA9ORKdDS8z9SFT6DF/0veHvZez+8BxI3Cj2RJTP2DoAhK5+Z5VEsWJGaGYvudUjXbSKhQUI7W8hDVmX92dyIE2CNfjgSY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748876461; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=XdH1I+9s5ENe/+dBJe3/QK7L358b/jk/hFx6wU5iogM=; b=j9mSqFTf34x7t0RnsMu6e9Fa+0aw1tES9d7+hxsvBHyGPT/nZ4Yn+Ent/3OBfWmhiHedype0jBT0c7s3odW9AFrn3JUmpF0JAxkyknlfk1lnMA3aaM4w8gk/327JXBtswhCQphTdv41Mad+y+c6FHaRCoxk0CBqgDPDXH3kCHI4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1748876461618541.1334352015241; Mon, 2 Jun 2025 08:01:01 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9218D1563; Mon, 2 Jun 2025 11:01:00 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 37578151F; Mon, 2 Jun 2025 11:00:40 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0684414FD; Mon, 2 Jun 2025 11:00:37 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 6E78614DB for ; Mon, 2 Jun 2025 11:00:36 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-356--APnJ0f_N_iUXS9JMvIiIg-1; Mon, 02 Jun 2025 11:00:34 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2579F1800EC9 for ; Mon, 2 Jun 2025 15:00:33 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5B57819560AB for ; Mon, 2 Jun 2025 15:00:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748876436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rd0FDlvT7BYgfUOSDD8ECLJLGfxZKKfKYTczdDjbGZA=; b=CLn4/5gdlRhSgXdsm+2K5QlzHmlLj8e60tww6u6Vi6TPemNWZjVJJQf0QyWROPFWf2AXC4 Rl3WnjzChaFKh4aqkXZ5cD7UJcC/0sgOWV7Z46+UCS0mSyWw4ky48qpnBl5Fu7cg4vp29U kSjhFMFo6CHsBNfiFZwNYIUC6CI0rO0= X-MC-Unique: -APnJ0f_N_iUXS9JMvIiIg-1 X-Mimecast-MFC-AGG-ID: -APnJ0f_N_iUXS9JMvIiIg_1748876433 To: devel@lists.libvirt.org Subject: [PATCH] qemu: command: Don't attempt to set backend MTU for networks which don't use host backend directly Date: Mon, 2 Jun 2025 17:00:30 +0200 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: gQljSPAaxZyBrDPnUS7pkG2PkPmYvmMbG7VSI3QkPqQ_1748876433 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LGK7XUNH2E3ARJ7Z7J4B6YIGI5W2G5LC X-Message-ID-Hash: LGK7XUNH2E3ARJ7Z7J4B6YIGI5W2G5LC X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748876464287116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Attempting to set MTU for network types which don't actually use the network device on the host results in a failure. The 'mtu' property is also used e.g. for the 'host_mtu' property of e.g. 'virtio-net-pci' which is applied even in vhost-user mode. Use the existing switch which selects devices without a network device backend on the host side and skip setting the MTU. Tested by running 'passt' in vhost-user mode manually: passt -f --vhost-user -s /tmp/vh.sock and the following XML:
The OS in the guest reports MTU 9999. Closes: https://gitlab.com/libvirt/libvirt/-/issues/717 Closes: https://gitlab.com/libvirt/libvirt/-/issues/192 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fec48edfc1..edafe1588c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8713,6 +8713,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver, bool requireNicdev =3D false; g_autoptr(virJSONValue) hostnetprops =3D NULL; qemuDomainNetworkPrivate *netpriv =3D QEMU_DOMAIN_NETWORK_PRIVATE(net); + bool setBackendMTU =3D true; GSList *n; if (qemuDomainValidateActualNetDef(net, qemuCaps) < 0) @@ -8802,6 +8803,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver, case VIR_DOMAIN_NET_TYPE_NULL: case VIR_DOMAIN_NET_TYPE_VDS: case VIR_DOMAIN_NET_TYPE_LAST: + setBackendMTU =3D false; /* These types don't use a network device on the host, but * instead use some other type of connection to the emulated * device in the qemu process. @@ -8842,7 +8844,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver, } } - if (net->mtu && net->managed_tap !=3D VIR_TRISTATE_BOOL_NO && + if (net->mtu && setBackendMTU && net->managed_tap !=3D VIR_TRISTATE_BO= OL_NO && virNetDevSetMTU(net->ifname, net->mtu) < 0) goto cleanup; --=20 2.49.0