From nobody Wed May 14 09:52:42 2025 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1525704430238743.8542197241593; Mon, 7 May 2018 07:47:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCE08C058EC8; Mon, 7 May 2018 14:47:08 +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 93F8D1001959; Mon, 7 May 2018 14:47:08 +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 500FB180BAE5; Mon, 7 May 2018 14:47:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47EfZgm001089 for ; Mon, 7 May 2018 10:41:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id A22A91001F4F; Mon, 7 May 2018 14:41:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B61D1001F4E for ; Mon, 7 May 2018 14:41:35 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 25D4530C809E for ; Mon, 7 May 2018 14:41:34 +0000 (UTC) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w47EdrgT138210 for ; Mon, 7 May 2018 10:41:33 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2htr7mspgd-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 07 May 2018 10:41:33 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 May 2018 15:41:31 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 7 May 2018 15:41:28 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w47EfSgt1769954; Mon, 7 May 2018 14:41:28 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A4B01AE051; Mon, 7 May 2018 15:30:57 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 757D9AE045; Mon, 7 May 2018 15:30:57 +0100 (BST) Received: from localhost.localdomain (unknown [9.152.222.69]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 7 May 2018 15:30:57 +0100 (BST) From: Boris Fiuczynski To: libvir-list@redhat.com Date: Mon, 7 May 2018 16:41:16 +0200 In-Reply-To: <20180507144118.6260-1-fiuczy@linux.ibm.com> References: <20180507144118.6260-1-fiuczy@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18050714-0044-0000-0000-0000054FF973 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18050714-0045-0000-0000-0000289134B8 Message-Id: <20180507144118.6260-7-fiuczy@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-07_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805070150 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 07 May 2018 14:41:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 07 May 2018 14:41:34 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'fiuczy@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.701 (RCVD_IN_DNSWL_LOW, SPF_PASS) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: shalini@linux.vnet.ibm.com, cohuck@redhat.com Subject: [libvirt] [PATCH v2 6/8] tests: tests for vfio-ccw passthrough 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 07 May 2018 14:47:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Shalini Chellathurai Saroja Let us test the following functionalities of vfio-ccw in libvirt 1. Generation of QEMU command line from domain xml file 2. Generation of dump xml from domain xml file 3. Checks duplicate/invalid addresses for vfio-ccw devices. Signed-off-by: Shalini Chellathurai Saroja Reviewed-by: Bjoern Walk Reviewed-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer Reviewed-by: Stefan Zimmermann Reviewed-by: John Ferlan --- ...tdev-subsys-mdev-vfio-ccw-duplicate-address.xml | 29 ++++++++++++++++++= ++++ ...ostdev-subsys-mdev-vfio-ccw-invalid-address.xml | 23 +++++++++++++++++ .../hostdev-subsys-mdev-vfio-ccw.args | 26 +++++++++++++++++++ .../hostdev-subsys-mdev-vfio-ccw.xml | 22 ++++++++++++++++ tests/qemuxml2argvtest.c | 16 ++++++++++++ .../hostdev-subsys-mdev-vfio-ccw.xml | 28 ++++++++++++++++++= +++ tests/qemuxml2xmltest.c | 5 ++++ 7 files changed, 149 insertions(+) create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-dup= licate-address.xml create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-inv= alid-address.xml create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.x= ml diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-= address.xml b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate= -address.xml new file mode 100644 index 0000000..4b95fe2 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address= .xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 524288 + 524288 + 2 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + +
+ +
+ + + +
+ +
+ + + diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-ad= dress.xml b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-add= ress.xml new file mode 100644 index 0000000..680090e --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.x= ml @@ -0,0 +1,23 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 524288 + 524288 + 2 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + +
+ +
+ + + diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args b/tes= ts/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args new file mode 100644 index 0000000..56ebf9a --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.args @@ -0,0 +1,26 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name QEMUGuest1 \ +-S \ +-machine s390-ccw-virtio,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 512 \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot c \ +-device vfio-ccw,id=3Dhostdev0,\ +sysfsdev=3D/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627,\ +devno=3Dfe.0.0000 \ +-device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0001 diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml b/test= s/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml new file mode 100644 index 0000000..96f30f5 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.xml @@ -0,0 +1,22 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 524288 + 524288 + 2 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + +
+ + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 9a05803..bd8d1b4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1539,6 +1539,22 @@ mymain(void) DO_TEST("pci-rom-disabled", NONE); DO_TEST("pci-rom-disabled-invalid", NONE); =20 + DO_TEST("hostdev-subsys-mdev-vfio-ccw", + QEMU_CAPS_CCW, + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, + QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST_FAILURE("hostdev-subsys-mdev-vfio-ccw", + QEMU_CAPS_CCW, + QEMU_CAPS_CCW_CSSID_UNRESTRICTED); + DO_TEST_PARSE_ERROR("hostdev-subsys-mdev-vfio-ccw-duplicate-address", + QEMU_CAPS_CCW, + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, + QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST_PARSE_ERROR("hostdev-subsys-mdev-vfio-ccw-invalid-address", + QEMU_CAPS_CCW, + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, + QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, GIC_NONE, NONE); DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, GIC_NONE, NONE); DO_TEST_FULL("restore-v2-fd", "fd:7", 7, 0, 0, GIC_NONE, NONE); diff --git a/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml b/te= sts/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml new file mode 100644 index 0000000..a14ab05 --- /dev/null +++ b/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw.xml @@ -0,0 +1,28 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 524288 + 524288 + 2 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + +
+ +
+ + +
+ + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index f0b1c34..ff43455 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -960,6 +960,11 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_LSI, QEMU_CAPS_DEVICE_SCSI_GENERIC); =20 + DO_TEST("hostdev-subsys-mdev-vfio-ccw", + QEMU_CAPS_CCW, + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, + QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST("s390-defaultconsole", QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390); DO_TEST("s390-panic", --=20 2.9.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list