From nobody Mon Feb 9 11:28:42 2026 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=1647621665; cv=none; d=zohomail.com; s=zohoarc; b=Noce35H7QBQ2JPJCijxmDe8lcsI9cvxct8ffHGDoUP7NqaiC5Ohxe809WEkTk1V9COytpde4XOnhJUeq2f/CP1CXi3KRJa7HEl7+OISWsOC9Yjb4d73EJWdcwhzbMDjkITFR7xFY2ql1FnkQSV/CePbvjF/cYdE7XaVftkUEqDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647621665; 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=8qfJpe/nvu8yObvyi9SUfKmupLtAbQS8xRxtacL2YCs=; b=DedAqC2gM0k94GRBUzZgJTX4N09DU0PMjbY1poBIFTuyXiVXAGSbvOUst+KTIyXgmd090yezcEag0KtB1/h6Ty1v1i6pHOy4n5fKNJcrovy0xacjUoC4Eo6uB0bDnESsPl7CqgTcRh+6YzhBhZpvPV9af5vXcSCK2yVf5HUshsc= 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 1647621665556326.3575264357554; Fri, 18 Mar 2022 09:41:05 -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-380-On_qr8vbOvGLT-rTUw35MQ-1; Fri, 18 Mar 2022 12:40:47 -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 434F110544AF; Fri, 18 Mar 2022 16:40:40 +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 2E91D54EC6C; Fri, 18 Mar 2022 16:40:40 +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 D61A01940379; Fri, 18 Mar 2022 16:40:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 345ED194035B for ; Fri, 18 Mar 2022 16:40:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2764E145B97D; Fri, 18 Mar 2022 16:40:37 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.195.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 634CF145B97B for ; Fri, 18 Mar 2022 16:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647621664; 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=8qfJpe/nvu8yObvyi9SUfKmupLtAbQS8xRxtacL2YCs=; b=CL6PVM8GWuJhvyOzOu7hkCH/QVSMvHURHTgkwnFqUUQtAtXH2kAYXkEILUCBJ9rZX+RoLe u4pGqe5SzNj+7XxrT8gH8ZRkQVoP9liEbPOuu7NEVQf9cViXxc+Lo2Qb2UgQ+BWpvDtue1 rEmezWvqpX4d17c3SZGodYx8UhZaOpQ= X-MC-Unique: On_qr8vbOvGLT-rTUw35MQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH v2 07/17] tests: Add test cases for virtio-iommu Date: Fri, 18 Mar 2022 17:40:18 +0100 Message-Id: <20220318164028.1185357-8-abologna@redhat.com> In-Reply-To: <20220318164028.1185357-1-abologna@redhat.com> References: <20220318164028.1185357-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1647621667618100001 These represent valid uses of the device. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- .../virtio-iommu-aarch64.aarch64-latest.args | 35 +++++++++++++++++++ .../qemuxml2argvdata/virtio-iommu-aarch64.xml | 20 +++++++++++ .../virtio-iommu-x86_64.x86_64-latest.args | 31 ++++++++++++++++ .../qemuxml2argvdata/virtio-iommu-x86_64.xml | 18 ++++++++++ tests/qemuxml2argvtest.c | 2 ++ .../virtio-iommu-aarch64.aarch64-latest.xml | 32 +++++++++++++++++ .../virtio-iommu-x86_64.x86_64-latest.xml | 34 ++++++++++++++++++ tests/qemuxml2xmltest.c | 2 ++ 8 files changed, 174 insertions(+) create mode 100644 tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-lat= est.args create mode 100644 tests/qemuxml2argvdata/virtio-iommu-aarch64.xml create mode 100644 tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-lates= t.args create mode 100644 tests/qemuxml2argvdata/virtio-iommu-x86_64.xml create mode 100644 tests/qemuxml2xmloutdata/virtio-iommu-aarch64.aarch64-l= atest.xml create mode 100644 tests/qemuxml2xmloutdata/virtio-iommu-x86_64.x86_64-lat= est.xml diff --git a/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.arg= s b/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args new file mode 100644 index 0000000000..917451d6f2 --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args @@ -0,0 +1,35 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-guest/master-key.aes"}' \ +-blockdev '{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.fd","n= ode-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"= }' \ +-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver"= :"raw","file":"libvirt-pflash0-storage"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_= VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"disca= rd":"unmap"}' \ +-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver= ":"raw","file":"libvirt-pflash1-storage"}' \ +-machine virt,usb=3Doff,dump-guest-core=3Doff,gic-version=3D2,pflash0=3Dli= bvirt-pflash0-format,pflash1=3Dlibvirt-pflash1-format,memory-backend=3Dmach= -virt.ram \ +-accel tcg \ +-cpu cortex-a15 \ +-m 1024 \ +-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073= 741824}' \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/virtio-iommu-aarch64.xml b/tests/qemuxm= l2argvdata/virtio-iommu-aarch64.xml new file mode 100644 index 0000000000..3e89cb2dac --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-iommu-aarch64.xml @@ -0,0 +1,20 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 1048576 + 1 + + hvm + /usr/share/AAVMF/AAVMF_CODE.f= d + /var/lib/libvirt/qemu/nvram/guest_VARS.fd + + + + + + /usr/bin/qemu-system-aarch64 + + + + + diff --git a/tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-latest.args = b/tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-latest.args new file mode 100644 index 0000000000..be06ea9957 --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine q35,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/virtio-iommu-x86_64.xml b/tests/qemuxml= 2argvdata/virtio-iommu-x86_64.xml new file mode 100644 index 0000000000..51c13d2ef6 --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-iommu-x86_64.xml @@ -0,0 +1,18 @@ + + 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 e7fecb24d3..7c2191f580 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3247,6 +3247,8 @@ mymain(void) DO_TEST_CAPS_LATEST("intel-iommu-aw-bits"); DO_TEST_CAPS_LATEST_PARSE_ERROR("intel-iommu-wrong-machine"); DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64"); + DO_TEST_CAPS_LATEST("virtio-iommu-x86_64"); + DO_TEST_CAPS_ARCH_LATEST("virtio-iommu-aarch64", "aarch64"); =20 DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); DO_TEST_PARSE_ERROR("cpu-hotplug-granularity", diff --git a/tests/qemuxml2xmloutdata/virtio-iommu-aarch64.aarch64-latest.x= ml b/tests/qemuxml2xmloutdata/virtio-iommu-aarch64.aarch64-latest.xml new file mode 100644 index 0000000000..336f99d539 --- /dev/null +++ b/tests/qemuxml2xmloutdata/virtio-iommu-aarch64.aarch64-latest.xml @@ -0,0 +1,32 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 1048576 + 1048576 + 1 + + hvm + /usr/share/AAVMF/AAVMF_CODE.f= d + /var/lib/libvirt/qemu/nvram/guest_VARS.fd + + + + + + + + cortex-a15 + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + diff --git a/tests/qemuxml2xmloutdata/virtio-iommu-x86_64.x86_64-latest.xml= b/tests/qemuxml2xmloutdata/virtio-iommu-x86_64.x86_64-latest.xml new file mode 100644 index 0000000000..0b6c2d0eaf --- /dev/null +++ b/tests/qemuxml2xmloutdata/virtio-iommu-x86_64.x86_64-latest.xml @@ -0,0 +1,34 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + + + +