From nobody Mon Feb 9 23:00:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1633712088; cv=none; d=zohomail.com; s=zohoarc; b=Or0RX4OQLkWLLjvvc0Zw4869SFKhO74gSq+2QJ8GEIhjnSCYqo/XStBFDNmOwR2K79w1EfGb5CaVVezkzvtSXoBeoY+Om0UMObCB7PL49sHn4V+jwjXW7MPykndqReAfq4nK7mqhJz6qobl58alrlECVRxlhFjxHSynzF1HDodk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633712088; 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=p9zu5GtJvtlpK6Zb3b9kft9FtxIApSop79P0p57rRj8=; b=muBx2A1y9LsY4FZGln3hW98QgPQwczK6YIxujPflHPgiBYsn+VFy9VWTrVSoJx1y4L8ZX1fA09noZzwPuWkYW11ft8EINSuP1cI9ogv819nXVe71/y9epP419Ls1jModXMlKRod7fsVKUZgAdE8hIYhTihaksB+nUcTn5RZAk5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1633712088234272.1718719780147; Fri, 8 Oct 2021 09:54:48 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-85-XnPK6MaDPyGLXGNEUXjnMw-1; Fri, 08 Oct 2021 12:54:37 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12E5780292B; Fri, 8 Oct 2021 16:54:30 +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 CE8785F4F5; Fri, 8 Oct 2021 16:54:29 +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 982371818480; Fri, 8 Oct 2021 16:54:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 198GsSPu014036 for ; Fri, 8 Oct 2021 12:54:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0C8A5D740; Fri, 8 Oct 2021 16:54:28 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 25C1F69324 for ; Fri, 8 Oct 2021 16:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633712087; 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=p9zu5GtJvtlpK6Zb3b9kft9FtxIApSop79P0p57rRj8=; b=XKKIWgHO5cnBWabKLiIELj5kGdJ76mAyT+crdwfEHE4TKCH7K1H2QtZ4P0cRR/tOhV7CCS 4g9Fh9MQ4Tuvta4t4puQwxrhoW9muqzvqXGIR5DtnCyDsUypDS32RlH7pxu+piJYxIqabM dyOGjC/ZYEMMpXc7DowLLip//xt8Dqk= X-MC-Unique: XnPK6MaDPyGLXGNEUXjnMw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 18/21] tests: Add test for virtio-iommu address Date: Fri, 8 Oct 2021 18:51:53 +0200 Message-Id: <20211008165156.405216-19-abologna@redhat.com> In-Reply-To: <20211008165156.405216-1-abologna@redhat.com> References: <20211008165156.405216-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1633712089027100001 Content-Type: text/plain; charset="utf-8" virtio-iommu needs to be an integrated device, and our address assignment code will make sure that is the case. If the user has provided an explicit address, however, we should make sure any addresses pointing to a different bus are rejected. Signed-off-by: Andrea Bolognani --- ...io-iommu-invalid-address.x86_64-latest.err | 1 + .../virtio-iommu-invalid-address.xml | 20 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 22 insertions(+) create mode 100644 tests/qemuxml2argvdata/virtio-iommu-invalid-address.x86= _64-latest.err create mode 100644 tests/qemuxml2argvdata/virtio-iommu-invalid-address.xml diff --git a/tests/qemuxml2argvdata/virtio-iommu-invalid-address.x86_64-lat= est.err b/tests/qemuxml2argvdata/virtio-iommu-invalid-address.x86_64-latest= .err new file mode 100644 index 0000000000..997948e91f --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-iommu-invalid-address.x86_64-latest.err @@ -0,0 +1 @@ +XML error: The device at PCI address 0000:01:00.0 needs to be an integrate= d device (bus=3D0) diff --git a/tests/qemuxml2argvdata/virtio-iommu-invalid-address.xml b/test= s/qemuxml2argvdata/virtio-iommu-invalid-address.xml new file mode 100644 index 0000000000..0daa58e3e7 --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-iommu-invalid-address.xml @@ -0,0 +1,20 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + + + + /usr/bin/qemu-system-x86_64 + + + +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0d349567a5..8a5b986e1b 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3244,6 +3244,7 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-wrong-machine"); DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-no-acpi"); DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-invalid-address-type"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-invalid-address"); =20 DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); DO_TEST_PARSE_ERROR("cpu-hotplug-granularity", --=20 2.31.1