From nobody Tue Mar 3 04:52:35 2026 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=1771246038; cv=none; d=zohomail.com; s=zohoarc; b=Dxl7mq54MEeHC9ZJ3o1Xx+D3iSz23BzRpjIA0SLRz1OxoZuNVifJQH+z87N5en1HlM140gOBF466vE7lLSjpeZ6D/BLSfTzs9bsYXjKUPml4eKhBhzHDuDHZqZGURgL/R29kITsWThU8Dr2OWDZPh7snPXr+rBQ70DUqDoPtiDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771246038; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=qKWJNKY0ngVLVKcgh3KnDjRSi7CfOU4c4KtJ7zxn/bA=; b=oKQiW1jhXdp/88JQ3aideLERFNZUk3uzDBNfpJAj4t075ny99PyYKmaajmtvvf02BgDt0CaGT+8p4RIjWb/AOehsf0q+KHnxUoeMCTsfOepHrOK0spLNtWqEFySHsJebrpAbeD+wsyiXERCvcJggR6mlV+e+K6J00NG/tvO5to4= 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 1771246038487884.5416282200225; Mon, 16 Feb 2026 04:47:18 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 086773F96E; Mon, 16 Feb 2026 07:47:18 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id DD6A641DB4; Mon, 16 Feb 2026 07:35:21 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 9BF10418BC; Mon, 16 Feb 2026 07:35:14 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5498741A31 for ; Mon, 16 Feb 2026 07:28:44 -0500 (EST) Received: from mx-prod-mc-05.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-497-bxa1jazyMYCf8jRQNlMDqg-1; Mon, 16 Feb 2026 07:28:42 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 18FFC1955BD9 for ; Mon, 16 Feb 2026 12:28:42 +0000 (UTC) Received: from antique-laptop.rosnicka.net (unknown [10.45.242.10]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6AB2530001A5 for ; Mon, 16 Feb 2026 12:28:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771244924; 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=qKWJNKY0ngVLVKcgh3KnDjRSi7CfOU4c4KtJ7zxn/bA=; b=F0ww7VnOHXUhtGpO4QoRg8JkLGzSXLY580W0ABI/tavbG5sZgwnvjZ5SMdJxmaAkBhhZ0L 2GJqb5K1OZ66g5r3Dk/+dTffBcZ65ivUGkOnmBTiTRO2dO3MbvqIsvh+7yR/21eUMWIXAW B/M/xAiSJ9GL/dR4ITr/JrbYuIv66kY= X-MC-Unique: bxa1jazyMYCf8jRQNlMDqg-1 X-Mimecast-MFC-AGG-ID: bxa1jazyMYCf8jRQNlMDqg_1771244922 To: devel@lists.libvirt.org Subject: [libvirt PATCH 21/24] qemu_command: Extract building IOMMUFD props to function Date: Mon, 16 Feb 2026 13:28:13 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: aUBxdAu_VEOINvh3DcYVrn6Z2cwa4ktcAQq_wNn4Nq4_1771244922 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: PUPPZDYDYVYEJ5ZGI225Q32PY3MPM5GT X-Message-ID-Hash: PUPPZDYDYVYEJ5ZGI225Q32PY3MPM5GT X-MailFrom: phrdina@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Pavel Hrdina via Devel Reply-To: Pavel Hrdina X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1771246042124154101 Content-Type: text/plain; charset="utf-8"; x-default="true" This will be reused by hotplug code. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_command.c | 20 ++++++++++++++++---- src/qemu/qemu_command.h | 3 +++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index cdf2f91ece..a742998e4c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5344,6 +5344,21 @@ qemuBuildHostdevCommandLine(virCommand *cmd, } =20 =20 +virJSONValue * +qemuBuildIOMMUFDProps(qemuFDPassDirect *iommufd) +{ + g_autoptr(virJSONValue) props =3D NULL; + + if (qemuMonitorCreateObjectProps(&props, "iommufd", + "iommufd0", + "S:fd", qemuFDPassDirectGetPath(iommu= fd), + NULL) < 0) + return NULL; + + return g_steal_pointer(&props); +} + + static int qemuBuildIOMMUFDCommandLine(virCommand *cmd, const virDomainDef *def, @@ -5357,10 +5372,7 @@ qemuBuildIOMMUFDCommandLine(virCommand *cmd, =20 qemuFDPassDirectTransferCommand(priv->iommufd, cmd); =20 - if (qemuMonitorCreateObjectProps(&props, "iommufd", - "iommufd0", - "S:fd", qemuFDPassDirectGetPath(priv-= >iommufd), - NULL) < 0) + if (!(props =3D qemuBuildIOMMUFDProps(priv->iommufd))) return -1; =20 if (qemuBuildObjectCommandlineFromJSON(cmd, props) < 0) diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index ad068f1f16..028d002ef9 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -190,6 +190,9 @@ int qemuBuildRNGBackendProps(virDomainRNGDef *rng, virJSONValue **props); =20 +virJSONValue * +qemuBuildIOMMUFDProps(qemuFDPassDirect *iommufd); + /* Current, best practice */ virJSONValue * qemuBuildUSBHostdevDevProps(const virDomainDef *def, --=20 2.53.0