From nobody Mon Sep 8 17:04:33 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 1740164750106963.3603959195532; Fri, 21 Feb 2025 11:05:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id F3FCC1CDD; Fri, 21 Feb 2025 14:05:48 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 13CF81D81; Fri, 21 Feb 2025 14:05:16 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4A12B1C93; Fri, 21 Feb 2025 14:05:11 -0500 (EST) 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 C63C01C78 for ; Fri, 21 Feb 2025 14:05:10 -0500 (EST) 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-634--tnV5NGhPBON-SNYlZXo6w-1; Fri, 21 Feb 2025 14:05:09 -0500 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 7162B180036F for ; Fri, 21 Feb 2025 19:05:08 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.88.37]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 01FF91955BCB for ; Fri, 21 Feb 2025 19:05:07 +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=1740164710; 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=EmMCFnRNU0OJCpWP1dnUDtL4ymI4Xx3UrPues2IB+88=; b=IAHBvIPHPCU7ixMwiqfw6ppndzwe0yhiWTke0FqzGLAz9doQcvIo1tXme5z2n24hfjwQhB j9jZbTJdWmDTs87gfvR6h7qTMylOoNRXrK4YlHXWbd+nGgNQfz4RwYlJhMUmh0AdtyS5AM /mJefoovi88su1QVt3rnWWGNrjp93O8= X-MC-Unique: -tnV5NGhPBON-SNYlZXo6w-1 X-Mimecast-MFC-AGG-ID: -tnV5NGhPBON-SNYlZXo6w_1740164708 From: Laine Stump To: devel@lists.libvirt.org Subject: [PATCH v2 1/2] qemu: check for/require shared memory for *any* vhostuser interface Date: Fri, 21 Feb 2025 14:05:05 -0500 Message-ID: <20250221190506.25864-2-laine@redhat.com> In-Reply-To: <20250221190506.25864-1-laine@redhat.com> References: <20250221190506.25864-1-laine@redhat.com> 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: v8PT-yUIOcIhb-NN8BvXmIdD6stfzttyhribaLA13T0_1740164708 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: OKGPC3SEUYBMCQQSETSBAECQFMG3V6MA X-Message-ID-Hash: OKGPC3SEUYBMCQQSETSBAECQFMG3V6MA X-MailFrom: laine@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: 1740164751599019100 Content-Type: text/plain; charset="utf-8"; x-default="true" It has always been true that vhostuser interfaces require shared memory, but we've never had that check in the validation. Recently I added that check for the case of interface type=3D'vhostuser' backend type=3D'passt'. This patch generalizes that check to require shared memory for *any* vhostuser interface. (While it is true that we've been allowing interface type=3D'vhostuser' without shared memory enabled for 11 years or so, so there might be some existing config (or config-generating script) that does that and would be broken by this new validation, it is also true that such a config could never have worked, so it was already broken (just failing at runtime rather than during parsing of the config)). Signed-off-by: Laine Stump --- new patch for V2 src/qemu/qemu_validate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index f3ef1be660..2479596628 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1820,9 +1820,8 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNet= Def *net, return -1; } =20 - 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) + if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_VHOSTUSER) { + if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "vhostu= ser") < 0) return -1; } =20 --=20 2.48.1 From nobody Mon Sep 8 17:04:33 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 174016477718564.55700606574737; Fri, 21 Feb 2025 11:06:17 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 914D61CC3; Fri, 21 Feb 2025 14:06:16 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E53691D53; Fri, 21 Feb 2025 14:05:18 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 94C6A1C78; Fri, 21 Feb 2025 14:05:12 -0500 (EST) 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 206D21C78 for ; Fri, 21 Feb 2025 14:05:12 -0500 (EST) 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-440-McbvkIlkMT6Jl0MPDN3n9g-1; Fri, 21 Feb 2025 14:05:10 -0500 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 318D91800374 for ; Fri, 21 Feb 2025 19:05:09 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.88.37]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B7D851955BCB for ; Fri, 21 Feb 2025 19:05:08 +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=1740164711; 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=dfSbAh1wkBKHNCjCKN1lPbF4IN/bIMqjH32UWcq+z20=; b=fOc505mlEGlTd6DKx7scgbRBUzNbIgKOOY4qKKSegVhqvXRqnM3cxaQfCN4dYf51wdJL+Z v9kwyVReWLwh0s5WNltcnQeZN27ZIFuOg1O4EGqB6fVq8JSMWURnSbN83YPi6xKRK4tVxY AoJ/K3oCDMf5KxbWBbqccRiovLaolRg= X-MC-Unique: McbvkIlkMT6Jl0MPDN3n9g-1 X-Mimecast-MFC-AGG-ID: McbvkIlkMT6Jl0MPDN3n9g_1740164709 From: Laine Stump To: devel@lists.libvirt.org Subject: [PATCH v2 2/2] qemu: forbid a few unsupported things for vhost-user/passt interfaces Date: Fri, 21 Feb 2025 14:05:06 -0500 Message-ID: <20250221190506.25864-3-laine@redhat.com> In-Reply-To: <20250221190506.25864-1-laine@redhat.com> References: <20250221190506.25864-1-laine@redhat.com> 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: O3fL6cIXy8OqRSnnGR6DlfRkQSImvMnxzb5dpZBCW2c_1740164709 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TWHJSB2PHBOELZBUNWKURGGXE7TXR5OY X-Message-ID-Hash: TWHJSB2PHBOELZBUNWKURGGXE7TXR5OY X-MailFrom: laine@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: 1740164778659019000 Content-Type: text/plain; charset="utf-8"; x-default="true" vhost-user with a passt backend doesn't support using multiple queues. The path of the socket is auto-generated by libvirt for vhost-user/passt; it can't be set by the user The passt end of a vhost-user socket is always the server, and the qemu end is always a client. Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- Change since V1 - use single quotes instead of escaped double quotes src/qemu/qemu_validate.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 2479596628..9a91f92410 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1823,6 +1823,24 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNe= tDef *net, if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_VHOSTUSER) { if (qemuValidateDomainDefVhostUserRequireSharedMemory(def, "vhostu= ser") < 0) return -1; + + if (net->backend.type =3D=3D VIR_DOMAIN_NET_BACKEND_PASST) { + if (net->driver.virtio.queues > 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("interface type=3D'vhostuser' backend typ= e=3D'passt' does not support multiple queues")); + return -1; + } + if (net->data.vhostuser->data.nix.path) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'path' attribute cannot be set for inter= face type=3D'vhostuser' backend type=3D'passt'")); + return -1; + } + if (net->data.vhostuser->data.nix.listen) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("mode=3D'server' is not supported for int= erface type=3D'vhostuser' backend type=3D'passt'")); + return -1; + } + } } =20 if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_VDPA) { --=20 2.48.1