From nobody Mon Apr 29 12:37:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1504025315541230.98790974698045; Tue, 29 Aug 2017 09:48:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 55F73806AA; Tue, 29 Aug 2017 16:48:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 34CAE692BD; Tue, 29 Aug 2017 16:48:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DDB4A1806109; Tue, 29 Aug 2017 16:48:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7TGmMnt008627 for ; Tue, 29 Aug 2017 12:48:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 554AD692A8; Tue, 29 Aug 2017 16:48:22 +0000 (UTC) Received: from dnr.brq.redhat.com (unknown [10.34.247.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id D62B1692A7 for ; Tue, 29 Aug 2017 16:48:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 55F73806AA Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 29 Aug 2017 18:48:13 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] conf: use virXMLFormatElement for X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 29 Aug 2017 16:48:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the new helper to simplify the code. This also fixes the bug of not formatting 'eim' in the useless case if it's the only enabled attribute. Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 55 ++++++++++++++++++++++++++++------------------= ---- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d97aab483..8e555ad9d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25056,37 +25056,36 @@ virDomainDefIothreadShouldFormat(virDomainDefPtr = def) } =20 =20 -static void +static int virDomainIOMMUDefFormat(virBufferPtr buf, const virDomainIOMMUDef *iommu) { virBuffer childBuf =3D VIR_BUFFER_INITIALIZER; + virBuffer driverAttrBuf =3D VIR_BUFFER_INITIALIZER; + int ret =3D -1; =20 virBufferSetChildIndent(&childBuf, buf); =20 - if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT || - iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT || - iommu->iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT) { - virBufferAddLit(&childBuf, "intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) { - virBufferAsprintf(&childBuf, " intremap=3D'%s'", - virTristateSwitchTypeToString(iommu->intrema= p)); - } - if (iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT) { - virBufferAsprintf(&childBuf, " caching_mode=3D'%s'", - virTristateSwitchTypeToString(iommu->caching= _mode)); - } - if (iommu->eim !=3D VIR_TRISTATE_SWITCH_ABSENT) { - virBufferAsprintf(&childBuf, " eim=3D'%s'", - virTristateSwitchTypeToString(iommu->eim)); - } - if (iommu->iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT) { - virBufferAsprintf(&childBuf, " iotlb=3D'%s'", - virTristateSwitchTypeToString(iommu->iotlb)); - } - virBufferAddLit(&childBuf, "/>\n"); + if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&driverAttrBuf, " intremap=3D'%s'", + virTristateSwitchTypeToString(iommu->intremap)); + } + if (iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&driverAttrBuf, " caching_mode=3D'%s'", + virTristateSwitchTypeToString(iommu->caching_mod= e)); + } + if (iommu->eim !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&driverAttrBuf, " eim=3D'%s'", + virTristateSwitchTypeToString(iommu->eim)); + } + if (iommu->iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&driverAttrBuf, " iotlb=3D'%s'", + virTristateSwitchTypeToString(iommu->iotlb)); } =20 + if (virXMLFormatElement(&childBuf, "driver", &driverAttrBuf, NULL) < 0) + goto cleanup; + virBufferAsprintf(buf, "model)); =20 @@ -25097,6 +25096,13 @@ virDomainIOMMUDefFormat(virBufferPtr buf, } else { virBufferAddLit(buf, "/>\n"); } + + ret =3D 0; + + cleanup: + virBufferFreeAndReset(&childBuf); + virBufferFreeAndReset(&driverAttrBuf); + return ret; } =20 =20 @@ -25866,8 +25872,9 @@ virDomainDefFormatInternal(virDomainDefPtr def, goto error; } =20 - if (def->iommu) - virDomainIOMMUDefFormat(buf, def->iommu); + if (def->iommu && + virDomainIOMMUDefFormat(buf, def->iommu) < 0) + goto error; =20 virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 12:37:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1504025308121546.9678512068313; Tue, 29 Aug 2017 09:48:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC9724E909; Tue, 29 Aug 2017 16:48:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB87B5D965; Tue, 29 Aug 2017 16:48:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 211001806106; Tue, 29 Aug 2017 16:48:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7TGmNWi008637 for ; Tue, 29 Aug 2017 12:48:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 50144692A7; Tue, 29 Aug 2017 16:48:23 +0000 (UTC) Received: from dnr.brq.redhat.com (unknown [10.34.247.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFE51692AD for ; Tue, 29 Aug 2017 16:48:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DC9724E909 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 29 Aug 2017 18:48:14 +0200 Message-Id: <4b9037fb37527036e916cd3ab25a974df9ad199e.1504025254.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] conf: use virXMLFormatElement for X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 29 Aug 2017 16:48:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Simplify the formatting function even further. Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8e555ad9d..a26731e75 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25061,6 +25061,7 @@ virDomainIOMMUDefFormat(virBufferPtr buf, const virDomainIOMMUDef *iommu) { virBuffer childBuf =3D VIR_BUFFER_INITIALIZER; + virBuffer attrBuf =3D VIR_BUFFER_INITIALIZER; virBuffer driverAttrBuf =3D VIR_BUFFER_INITIALIZER; int ret =3D -1; =20 @@ -25086,16 +25087,11 @@ virDomainIOMMUDefFormat(virBufferPtr buf, if (virXMLFormatElement(&childBuf, "driver", &driverAttrBuf, NULL) < 0) goto cleanup; =20 - virBufferAsprintf(buf, "model)); =20 - if (virBufferError(&childBuf) !=3D 0 || virBufferUse(&childBuf)) { - virBufferAddLit(buf, ">\n"); - virBufferAddBuffer(buf, &childBuf); - virBufferAddLit(buf, "\n"); - } else { - virBufferAddLit(buf, "/>\n"); - } + if (virXMLFormatElement(buf, "iommu", &attrBuf, &childBuf) < 0) + goto cleanup; =20 ret =3D 0; =20 --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 12:37:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150402530828328.47830218243041; Tue, 29 Aug 2017 09:48:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA42D267C5; Tue, 29 Aug 2017 16:48:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B882B77DD3; Tue, 29 Aug 2017 16:48:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D813F41F77; Tue, 29 Aug 2017 16:48:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7TGmO10008643 for ; Tue, 29 Aug 2017 12:48:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 19855692A8; Tue, 29 Aug 2017 16:48:24 +0000 (UTC) Received: from dnr.brq.redhat.com (unknown [10.34.247.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A309692A7 for ; Tue, 29 Aug 2017 16:48:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DA42D267C5 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 29 Aug 2017 18:48:15 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] tests: merge iommu tests X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 29 Aug 2017 16:48:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Using intremap without does not work. Merge the tests to avoid a duplicit test once we start validating it. Reviewed-by: John Ferlan --- .../qemuxml2argv-intel-iommu-caching-mode.args | 2 +- .../qemuxml2argv-intel-iommu-caching-mode.xml | 5 +++- .../qemuxml2argv-intel-iommu-ioapic.args | 21 --------------- .../qemuxml2argv-intel-iommu-ioapic.xml | 31 ------------------= ---- tests/qemuxml2argvtest.c | 6 +---- .../qemuxml2xmlout-intel-iommu-ioapic.xml | 1 - tests/qemuxml2xmltest.c | 1 - 7 files changed, 6 insertions(+), 61 deletions(-) delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.= args delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.= xml delete mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioa= pic.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.a= rgs b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args index 5d12aabf4..81feecfcf 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args @@ -7,7 +7,7 @@ QEMU_AUDIO_DRV=3Dnone \ /usr/bin/qemu-system-x86_64 \ -name QEMUGuest1 \ -S \ --machine q35,accel=3Dtcg \ +-machine q35,accel=3Dkvm,kernel_irqchip=3Dsplit \ -m 214 \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.x= ml b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.xml index 5f3384da7..36a392403 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.xml @@ -1,4 +1,4 @@ - + QEMUGuest1 c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 @@ -8,6 +8,9 @@ hvm + + + destroy restart diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args b/= tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args deleted file mode 100644 index 8e70bf910..000000000 --- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args +++ /dev/null @@ -1,21 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/home/test \ -USER=3Dtest \ -LOGNAME=3Dtest \ -QEMU_AUDIO_DRV=3Dnone \ -/usr/bin/qemu-system-x86_64 \ --name QEMUGuest1 \ --S \ --machine q35,accel=3Dkvm,kernel_irqchip=3Dsplit \ --m 214 \ --smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --nographic \ --nodefaults \ --chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ -server,nowait \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ --no-acpi \ --boot c \ --device intel-iommu,intremap=3Don diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml deleted file mode 100644 index bfe714ad8..000000000 --- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml +++ /dev/null @@ -1,31 +0,0 @@ - - QEMUGuest1 - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219100 - 219100 - 1 - - hvm - - - - - - - destroy - restart - destroy - - /usr/bin/qemu-system-x86_64 - - -
- - - - - - - - - diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0c0bd16f9..3a0080297 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2699,14 +2699,10 @@ mymain(void) DO_TEST("intel-iommu-machine", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_IOMMU); - DO_TEST("intel-iommu-ioapic", + DO_TEST("intel-iommu-caching-mode", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, - QEMU_CAPS_INTEL_IOMMU_INTREMAP, - QEMU_CAPS_DEVICE_INTEL_IOMMU); - DO_TEST("intel-iommu-caching-mode", - QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml deleted file mode 120000 index 42d17b2c0..000000000 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 311b71356..de8a781c1 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1187,7 +1187,6 @@ mymain(void) DO_TEST("intel-iommu-machine", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_IOMMU); - DO_TEST("intel-iommu-ioapic", NONE); DO_TEST("intel-iommu-caching-mode", NONE); DO_TEST("intel-iommu-eim", NONE); DO_TEST("intel-iommu-device-iotlb", NONE); --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 12:37:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1504025315380568.0833927108168; Tue, 29 Aug 2017 09:48:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5859BBDEF; Tue, 29 Aug 2017 16:48:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3408470533; Tue, 29 Aug 2017 16:48:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E0293180610A; Tue, 29 Aug 2017 16:48:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7TGmOZM008648 for ; Tue, 29 Aug 2017 12:48:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id DFEC3692A7; Tue, 29 Aug 2017 16:48:24 +0000 (UTC) Received: from dnr.brq.redhat.com (unknown [10.34.247.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64350692AD for ; Tue, 29 Aug 2017 16:48:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5859BBDEF Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 29 Aug 2017 18:48:16 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] conf: validate IOMMU interrupt remapping setting X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 29 Aug 2017 16:48:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This option requires: Report an error in case someone tries to combine it with different ioapic setting. Setting 'eim' on without enabling 'intremap' does not make sense. https://bugzilla.redhat.com/show_bug.cgi?id=3D1457610 Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a26731e75..fd236f5d2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5551,6 +5551,24 @@ virDomainDefValidateInternal(const virDomainDef *def) if (virDomainDefGetVcpusTopology(def, NULL) < 0) return -1; =20 + if (def->iommu && + def->iommu->intremap =3D=3D VIR_TRISTATE_SWITCH_ON && + (def->features[VIR_DOMAIN_FEATURE_IOAPIC] !=3D VIR_TRISTATE_SWITCH= _ON || + def->ioapic !=3D VIR_DOMAIN_IOAPIC_QEMU)) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("IOMMU interrupt remapping requires split I/O API= C " + "(ioapic driver=3D'qemu')")); + return -1; + } + + if (def->iommu && + def->iommu->eim =3D=3D VIR_TRISTATE_SWITCH_ON && + def->iommu->intremap !=3D VIR_TRISTATE_SWITCH_ON) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("IOMMU eim requires interrupt remapping to be ena= bled")); + return -1; + } + return 0; } =20 --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list