From nobody Tue May 14 06:21:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656932966; cv=none; d=zohomail.com; s=zohoarc; b=SINyzasdsJYWLcRO/3AKso/+KvtkNTwQKVGOKF4UjA02ZjGrpJVjXYZlzmN2Ftr/QkZ/aToQ0eYfCQchuYxhIzTanHCNEns241zSVgtXWkpU5RPLxcn818cYi97cXXtfocmN9d35YDbGUEDBbEJlTQ+B3ezaMTa1QPvWWO0kypo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656932966; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a1M7kjACIWLnxG6YkmDQYh5m7Am2Zhzn1L6uuO14z0k=; b=Atl3ciy092IIbnlKgmQDQiqQKbYb4McS7KsUsl5nX8U6Ct/PlvpcN9doeR/gMw1i2YsoHlbOJgoxKs6dnarM9EHacRf1w/iZOqDmtKAh3F2zps2v9aBoRiO1npX2xdFsp+NvtWKHxqZ+P5MOIWKLG/qTeEfCsYgvvoXCjW6YtFM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1656932966383797.8543845690547; Mon, 4 Jul 2022 04:09:26 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-444-mzJfhQAUPTu1xqG6p8pX9g-1; Mon, 04 Jul 2022 07:09:21 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8778E1019C8D; Mon, 4 Jul 2022 11:09:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D38A492C3B; Mon, 4 Jul 2022 11:09:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BC7F4194704A; Mon, 4 Jul 2022 11:09:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3E44219466DF for ; Mon, 4 Jul 2022 11:09:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2B94B2166B29; Mon, 4 Jul 2022 11:09:14 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBD0D2166B26 for ; Mon, 4 Jul 2022 11:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656932964; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=a1M7kjACIWLnxG6YkmDQYh5m7Am2Zhzn1L6uuO14z0k=; b=GgqKMMdhNwwFse4pMmHz853Q5d3r/lxmINp39tjNC50yzX3FLfCaKW+mHuZh9p2m2ys+9L bPnR3DW1vLP1WZYHJo08Kken0gmtHPLuSwFtxjk/Df3FufEkZ4hj/x0xtZKwVnazv1JeKg /IkuJvOxrtLlyuOy5bL4zhK5ZsPY/0E= X-MC-Unique: mzJfhQAUPTu1xqG6p8pX9g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] qemu_domain_address: Drop needless virDomainIOMMUModel typecast Date: Mon, 4 Jul 2022 13:09:10 +0200 Message-Id: <7b9d937bc47363e15d6f17ea3c6fc714ce5f61d6.1656932858.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656932968226100005 Content-Type: text/plain; charset="utf-8"; x-default="true" There are two places where the @model member of _virDomainIOMMUDef struct is typecasted to virDomainIOMMUModel which is completely unnecessary because the struct already defines the member of that type. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain_address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 753733d1b9..026be99ba9 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1003,7 +1003,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDev= iceDef *dev, break; =20 case VIR_DOMAIN_DEVICE_IOMMU: - switch ((virDomainIOMMUModel) dev->data.iommu->model) { + switch (dev->data.iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: return virtioFlags | VIR_PCI_CONNECT_INTEGRATED; =20 @@ -2384,7 +2384,7 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def, if (def->iommu) { virDomainIOMMUDef *iommu =3D def->iommu; =20 - switch ((virDomainIOMMUModel) iommu->model) { + switch (iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: if (virDeviceInfoPCIAddressIsWanted(&iommu->info) && qemuDomainPCIAddressReserveNextAddr(addrs, &iommu->info) <= 0) { --=20 2.35.1 From nobody Tue May 14 06:21:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656933004; cv=none; d=zohomail.com; s=zohoarc; b=YJRwjksDQ90JFU4Gm9tXaKXsgaGF/CddARnEdBqAXAKb728J/pC1Qi+DH/MY6EMrBhlAy8Ff/IPwfjf8JgkvPW793IR93qjARxcOMBaiwjLXj1iJHDHviCdA+Ux4vrOddHnPhh6xbFQuaWbp3HaIbOciyVtSUre7E1uFFVWP3l4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656933004; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9pWMmSqyJHxT73gzIEdv7bwwKQQbesw0jvQC/BwsTN8=; b=Jbq201lMCSBW0xCf7SEzjqS2AtM7KFJlc2USskBaArIgsLgNK674v0bOUV+9nKTfR0+PbPtHMLI+o4W4uuuDf21bxAGKuMLuQenrElnl4d5uBO4LIEAsmLQ0gNDNQjbpgJc5QUzKu3NW5jBKhnCISs6N5X292cGgP6bVVZ1KV+8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1656933004525465.12547987571065; Mon, 4 Jul 2022 04:10:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-553-c_EWNVGyM-WiTdKm1zg0Rg-1; Mon, 04 Jul 2022 07:09:19 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 87A5B3C0F376; Mon, 4 Jul 2022 11:09:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AB8AC44CC6; Mon, 4 Jul 2022 11:09:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D990C194705A; Mon, 4 Jul 2022 11:09:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D035B19451EF for ; Mon, 4 Jul 2022 11:09:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B627F2166B29; Mon, 4 Jul 2022 11:09:14 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6212D2166B26 for ; Mon, 4 Jul 2022 11:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656933003; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9pWMmSqyJHxT73gzIEdv7bwwKQQbesw0jvQC/BwsTN8=; b=RaMmvXV3cjetH5UDpD5u1KJggcdMMqwM85Av41p+RUE8IQ2zz19Pg79S7UWBa348h/auSY Y04smuPBf0t9FXgQHqeGYhJpQP8YfvCBabiPsz5l3Ie8AMQBNVcpgLcv7vodukQEBPepQp 9ars6j5bRnO27mxiaFFwnA/n8Q6ZktA= X-MC-Unique: c_EWNVGyM-WiTdKm1zg0Rg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/3] docs: Document
for IOMMU device Date: Mon, 4 Jul 2022 13:09:11 +0200 Message-Id: <3986af03270a4ded34feabb85ae5b216ee9559f1.1656932858.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656933005104100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The commit v8.3.0-rc1~199 introduced
to device. And while it updated the RNG it forgot to update the docs. Fix that. Fixes: b0eb1e193f5db033d0fbbf91ff71a121066ad77c Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- docs/formatdomain.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 62a94890f0..a4e3c39928 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -8083,6 +8083,9 @@ Example: mapping larger iova addresses in the guest. :since:`Since 6.5.0` (QE= MU/KVM only) =20 +The ``virtio`` IOMMU devices can further have ``address`` element as descr= ibed +in `Device addresses`_ (address has to by type of ``pci``). + =20 Vsock ~~~~~ --=20 2.35.1 From nobody Tue May 14 06:21:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656932965; cv=none; d=zohomail.com; s=zohoarc; b=dIInFFtX421A3DcfAAtnvPHg7lKovkGoUo+OOnC9Dp5leDLaj20aoYIzQeSStVMf6ots+P6o8VyTP6AqwFGd/cHLVNlXnmaVGlbWOG60MgxyWRQfR+KggXnd5x5kxO/+PGVD8+OcOB3/vfU1ovBn3m1jw0D5XScXaw9qUgOJT4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656932965; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iuOi8iJbqBzBzvSKNoWMosBG0Batta4odWAEDtzRFJU=; b=QQJT7UHU2NWqllgMWQer2ZYFMmI+l1RsijQ1zuS6twZp32zxme8ovxbhYcTdDMiXtZbM6SyCHlYqP0fl1DlNfwyDbfILwOFPo5C4yhfoHwU+YaE6NQ+BvY6dF9/SEq7awnbQWXmU5//4Mj9ooT9PoaIQBizB9HkOV6HGCZp/BAw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1656932965332778.5614196121327; Mon, 4 Jul 2022 04:09:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-663-JwU5a1DbNBaB5QAXcy0MNg-1; Mon, 04 Jul 2022 07:09:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 570A080C8D3; Mon, 4 Jul 2022 11:09:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39C622166B2B; Mon, 4 Jul 2022 11:09:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A7609194707A; Mon, 4 Jul 2022 11:09:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5855519466DF for ; Mon, 4 Jul 2022 11:09:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4CC812166B2A; Mon, 4 Jul 2022 11:09:15 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC76D2166B26 for ; Mon, 4 Jul 2022 11:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656932964; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=iuOi8iJbqBzBzvSKNoWMosBG0Batta4odWAEDtzRFJU=; b=ItKT2HxQwiI2hg7CRnB1IW0vsLqfKb3kk1n3O5Nan/xd55W5Igs/rLlUif2R5XU8kocJ7f 2VqvJ5f78ZyqbVVERSYNxeeAFOj0CPLUk5NAysPu/M4LbsM3v5XFUIqw6xNOF9tdwE0aph fnrkfhjJL91wnvPnyU8wWOFb9xDqQvM= X-MC-Unique: JwU5a1DbNBaB5QAXcy0MNg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/3] domain_validate: Disallow non-virtio IOMMU with an
Date: Mon, 4 Jul 2022 13:09:12 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656932966200100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Per v8.3.0-rc1~199 it's only a virtio IOMMU that can have
. The rest (Intel and SMMUv3) are system devices and thus have no address associated with them. However, this assumption is never checked for. Fixes: b0eb1e193f5db033d0fbbf91ff71a121066ad77c Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_validate.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index c977c39144..d35451c26a 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2582,6 +2582,27 @@ virDomainGraphicsDefValidate(const virDomainDef *def, return 0; } =20 +static int +virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu) +{ + switch (iommu->model) { + case VIR_DOMAIN_IOMMU_MODEL_INTEL: + case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + if (iommu->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { + virReportError(VIR_ERR_XML_ERROR, + _("iommu model '%s' can't have address"), + virDomainIOMMUModelTypeToString(iommu->model)); + return -1; + } + break; + + case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: + case VIR_DOMAIN_IOMMU_MODEL_LAST: + } + + return 0; +} + static int virDomainDeviceInfoValidate(const virDomainDeviceDef *dev) { @@ -2683,6 +2704,9 @@ virDomainDeviceDefValidateInternal(const virDomainDev= iceDef *dev, case VIR_DOMAIN_DEVICE_GRAPHICS: return virDomainGraphicsDefValidate(def, dev->data.graphics); =20 + case VIR_DOMAIN_DEVICE_IOMMU: + return virDomainIOMMUDefValidate(dev->data.iommu); + case VIR_DOMAIN_DEVICE_LEASE: case VIR_DOMAIN_DEVICE_WATCHDOG: case VIR_DOMAIN_DEVICE_HUB: @@ -2690,7 +2714,6 @@ virDomainDeviceDefValidateInternal(const virDomainDev= iceDef *dev, case VIR_DOMAIN_DEVICE_NVRAM: case VIR_DOMAIN_DEVICE_TPM: case VIR_DOMAIN_DEVICE_PANIC: - case VIR_DOMAIN_DEVICE_IOMMU: case VIR_DOMAIN_DEVICE_NONE: case VIR_DOMAIN_DEVICE_LAST: break; --=20 2.35.1