From nobody Wed Mar 12 17:21:53 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1741680884124949.8477375463373; Tue, 11 Mar 2025 01:14:44 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 2A8B31B76; Tue, 11 Mar 2025 04:14:43 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E30C11B64; Tue, 11 Mar 2025 04:13:20 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BF54D1BCC; Tue, 11 Mar 2025 04:13:16 -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 49BB41B89 for ; Tue, 11 Mar 2025 04:13:11 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-BAC4fGhNOhG9NyebLqMNAA-1; Tue, 11 Mar 2025 04:13:07 -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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D5AD019560B7 for ; Tue, 11 Mar 2025 08:13:06 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0236B1944EAA for ; Tue, 11 Mar 2025 08:13:05 +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, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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=1741680791; 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: in-reply-to:in-reply-to:references:references; bh=GiWpQ40WBxj/eCDTpFa75klBv+NX5CI+X4dNZDfURVI=; b=CMdMeop6SDBg/E/CWkOMWysFhuFWq/cvG9fWVfQ5+QEFbbMwRpFcBpDY4E8JcUEsKT2MVW LRo7G0MCORjUDH9lFurlOXMRVs+LEzsD5amWgEHIDhrwbTGPtgyKfd7j+HFusQSKwJAV6I iwsCDgFMjB3Vqw4b/jFl2YRZc69DZ6s= X-MC-Unique: BAC4fGhNOhG9NyebLqMNAA-1 X-Mimecast-MFC-AGG-ID: BAC4fGhNOhG9NyebLqMNAA_1741680787 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 2/3] qemuValidateDomainDeviceDefNetwork: Require shared memory for all vhost-user interfaces Date: Tue, 11 Mar 2025 09:13:00 +0100 Message-ID: <77607ccea1e77ad453fd3f4cd591f961237a7365.1741680723.git.pkrempa@redhat.com> In-Reply-To: References: 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: KYWKaWJkzpmsWgDujpNEn6OeXLO0TIlLoN44zlCWatk_1741680787 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6GDJYXBEBZ7ZOHVGYOM6G5Z2ZULCQKCA X-Message-ID-Hash: 6GDJYXBEBZ7ZOHVGYOM6G5Z2ZULCQKCA 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1741680886537019100 Content-Type: text/plain; charset="utf-8" Currently we produce only a warning into the log if a non-passt vhost-user interface is configured with shared memory. Since we do make it fatal with all other vhost-user types, fix the check to trigger also for normal-vhost-user interfaces. Since passt-based vhost-user interfaces are checked separately the check will no longer be required. Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 9 +++------ .../net-vhostuser-passt-no-shmem.x86_64-latest.err | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 4ab7af36f3..4282d8c11d 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1843,12 +1843,6 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNe= tDef *net, return -1; } - if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_VHOSTUSER && - net->backend.type =3D=3D VIR_DOMAIN_NET_BACKEND_PASST) { - if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "interf= ace type=3D\"vhostuser\" backend type=3D\"passt\"") < 0) - return -1; - } - if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_VDPA) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_VHOST_VDPA)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -1872,6 +1866,9 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNet= Def *net, _("'reconnect' attribute is not supported when = source mode=3D'server' for ")); return -1; } + + if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "interf= ace") < 0) + return -1; } if (!virDomainNetIsVirtioModel(net)) { diff --git a/tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-late= st.err b/tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-latest.e= rr index 274af5c722..babde17518 100644 --- a/tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-latest.err +++ b/tests/qemuxmlconfdata/net-vhostuser-passt-no-shmem.x86_64-latest.err @@ -1 +1 @@ -unsupported configuration: 'interface type=3D"vhostuser" backend type=3D"p= asst"' requires shared memory +unsupported configuration: 'interface' requires shared memory --=20 2.48.1