From nobody Sat Apr 27 22:54:37 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1566915584; cv=none; d=zoho.com; s=zohoarc; b=DCMA1VqDU7iUFNPiQGJ3PNLVP1JJDLZmVH/x9wzYrCQDJY4fI1Fuw9BaW9QmNePVH+mLTs/B4J6al+yKuUU/yFHtlXDppBx0IBzQbUpm/ootJz+e443vVVvHhqFdyWIBfxs6EUMCyqm84ItYT4xnJmiPeAHY/Fxyt7Ue4AV7G1o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566915584; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=KHlcqh+NVXvAWUQSt8JaKf1Wpb5QUrFXGN+4rfflba0=; b=KfnIEVS6Byq8cD4HKOvYuRfCBCJPICReFWS//QyETpnSq6s3aE4cpww3wvYAdBnoZAD2IjZUORqSY70wbhZDpGjLRGgtrehf6XYzqqC/huAijZO5nVI1RL+3nhJv2x0YXzKD1tMFM4vb87mH5C5liDK0EjRJJGCd0Eirswtzvkw= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566915584009862.2393495962615; Tue, 27 Aug 2019 07:19:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39CE43018ED0; Tue, 27 Aug 2019 14:19:42 +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 0A9AA60167; Tue, 27 Aug 2019 14:19:42 +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 869521806B01; Tue, 27 Aug 2019 14:19:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7REJfP5024424 for ; Tue, 27 Aug 2019 10:19:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0532D60167; Tue, 27 Aug 2019 14:19:41 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2DDE6012E for ; Tue, 27 Aug 2019 14:19:38 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3E78B8E251 for ; Tue, 27 Aug 2019 14:19:37 +0000 (UTC) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7REJBA4038818 for ; Tue, 27 Aug 2019 10:19:36 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2un4brp3um-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Aug 2019 10:19:35 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2019 15:19:33 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Aug 2019 15:19:31 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7REJUkq43319588 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Aug 2019 14:19:30 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 585F111C050; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 21B0011C054; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) From: Bjoern Walk To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 16:19:18 +0200 In-Reply-To: <20190827141923.112378-1-bwalk@linux.ibm.com> References: <20190827141923.112378-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19082714-0016-0000-0000-000002A381D8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19082714-0017-0000-0000-00003303CDCA Message-Id: <20190827141923.112378-2-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-27_02:, , 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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908270153 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 27 Aug 2019 14:19:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 27 Aug 2019 14:19:37 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski Subject: [libvirt] [PATCH 1/6] tests: add vfio-ap mdev 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: , 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 27 Aug 2019 14:19:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Reviewed-by: Marc Hartmayer Signed-off-by: Bjoern Walk Signed-off-by: Boris Fiuczynski Reviewed-by: J=C3=A1n Tomko --- .../hostdev-subsys-mdev-vfio-ap-boot-fail.xml | 23 +++++++++++++ .../hostdev-subsys-mdev-vfio-ap.args | 28 ++++++++++++++++ ...tdev-subsys-mdev-vfio-ap.s390x-latest.args | 33 +++++++++++++++++++ .../hostdev-subsys-mdev-vfio-ap.xml | 22 +++++++++++++ tests/qemuxml2argvtest.c | 5 +++ .../hostdev-subsys-mdev-vfio-ap.xml | 27 +++++++++++++++ tests/qemuxml2xmltest.c | 4 +++ 7 files changed, 142 insertions(+) create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap-boot= -fail.xml create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.args create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.s390= x-latest.args create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.xml create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ap.xml diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap-boot-fail.x= ml b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap-boot-fail.xml new file mode 100644 index 00000000..3f9bb64b --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap-boot-fail.xml @@ -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-ap.args b/test= s/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.args new file mode 100644 index 00000000..f9b5d2c8 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.args @@ -0,0 +1,28 @@ +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 \ +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 \ +-realtime mlock=3Doff \ +-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 \ +-device vfio-ap,id=3Dhostdev0,\ +sysfsdev=3D/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627 \ +-device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0000 diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.s390x-lates= t.args b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.ar= gs new file mode 100644 index 00000000..4aedc266 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args @@ -0,0 +1,33 @@ +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 \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine s390-ccw-virtio,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 512 \ +-overcommit mem-lock=3Doff \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device vfio-ap,id=3Dhostdev0,\ +sysfsdev=3D/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627 \ +-device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0000 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.xml b/tests= /qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.xml new file mode 100644 index 00000000..e7370b58 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.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 1799eb33..77f72b66 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1637,6 +1637,11 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); =20 + DO_TEST_CAPS_ARCH_LATEST("hostdev-subsys-mdev-vfio-ap", + "s390x"); + DO_TEST_CAPS_ARCH_LATEST_FAILURE("hostdev-subsys-mdev-vfio-ap-boot-fai= l", + "s390x"); + DO_TEST_FULL("restore-v2", ARG_MIGRATE_FROM, "exec:cat", ARG_MIGRATE_FD, 7, diff --git a/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ap.xml b/tes= ts/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ap.xml new file mode 100644 index 00000000..afaa9c3e --- /dev/null +++ b/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ap.xml @@ -0,0 +1,27 @@ + + 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 4981eca8..e9eed4c3 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -959,6 +959,10 @@ mymain(void) QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST("hostdev-subsys-mdev-vfio-ap", + QEMU_CAPS_CCW, + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, + QEMU_CAPS_DEVICE_VFIO_AP); =20 DO_TEST("s390-defaultconsole", QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 22:54:37 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1566915588; cv=none; d=zoho.com; s=zohoarc; b=YHMVzx9Cr4OZtF2Xz4Vta+ryfvaUaEpnIrqlrzDVzNq3f2YKhgu500ZDXEjmXoSxqPBaFbDIvMqVBYk8haebLvJ1vx93y7+dGrcmKoj0tcm5TyZ+f8JPTLAFZ/qxuPPVhNxXAV2GaMwM2nYqD+v6Py9YJaNOmpk2ukDHNwza/Ds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566915588; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=yzhH06wVMlA2FwE7LZCoQVSo7LLPiPNYzi8+y53sANM=; b=HvAEyB2szNqwNlMxxTm/Nt53VsFjvoKn3nS9VH0j2dELKSjD6Ben80HvrgTIVRX6oSERh975CTeyOb1UOpzTl54+xQMkuiq6NLK/drK8cYTsxYs8667372F/8XkpXhZDGDMP0cZ/Ni0kZI96XblI6Tb1ydnQT/0/4YJLcP/kBU4= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566915588769996.7763216165405; Tue, 27 Aug 2019 07:19:48 -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 368952F3663; Tue, 27 Aug 2019 14:19:47 +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 EF54360F88; Tue, 27 Aug 2019 14:19:46 +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 7B72E180B536; Tue, 27 Aug 2019 14:19:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7REJgUC024432 for ; Tue, 27 Aug 2019 10:19:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4815761B62; Tue, 27 Aug 2019 14:19:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3E8975D9E2 for ; Tue, 27 Aug 2019 14:19:37 +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 AB0033082133 for ; Tue, 27 Aug 2019 14:19:36 +0000 (UTC) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7REIg16134542 for ; Tue, 27 Aug 2019 10:19:36 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2un3vuy001-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Aug 2019 10:19:36 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2019 15:19:34 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Aug 2019 15:19:32 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7REJUcr43319590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Aug 2019 14:19:30 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 928B111C050; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6559711C04C; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) From: Bjoern Walk To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 16:19:19 +0200 In-Reply-To: <20190827141923.112378-1-bwalk@linux.ibm.com> References: <20190827141923.112378-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19082714-0028-0000-0000-000003948174 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19082714-0029-0000-0000-00002456BA7E Message-Id: <20190827141923.112378-3-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-27_02:, , 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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908270153 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 27 Aug 2019 14:19:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 27 Aug 2019 14:19:36 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, 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.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski Subject: [libvirt] [PATCH 2/6] tests: add vhost scsi hostdev boot unsupported test 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: , 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.29]); Tue, 27 Aug 2019 14:19:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Adding a failure test for booting from a vhost scsi hostdev device. Reviewed-by: Marc Hartmayer Signed-off-by: Bjoern Walk Signed-off-by: Boris Fiuczynski Reviewed-by: J=C3=A1n Tomko --- .../hostdev-scsi-vhost-scsi-pci-boot-fail.xml | 41 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 2 files changed, 42 insertions(+) create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci-boot= -fail.xml diff --git a/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci-boot-fail.x= ml b/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci-boot-fail.xml new file mode 100644 index 00000000..94f590b1 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci-boot-fail.xml @@ -0,0 +1,41 @@ + + QEMUGuest2 + c7a5fdbd-edaf-9466-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + +
+ + +
+ + +
+ + + + + + + + + +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 77f72b66..c1eb9cba 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2444,6 +2444,7 @@ mymain(void) DO_TEST("hostdev-scsi-vhost-scsi-pci", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI); + DO_TEST_CAPS_LATEST_FAILURE("hostdev-scsi-vhost-scsi-pci-boot-fail"); DO_TEST("hostdev-scsi-vhost-scsi-pcie", QEMU_CAPS_KVM, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 22:54:37 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1566915614; cv=none; d=zoho.com; s=zohoarc; b=c+zOQD3ERzUtTIQFS/IL0/zw1zh9owROqQnlPZPdBxxgZY50IV+Imyum1yTxKnPyZH3GaXMX8Kcrz4RJ8AQlg7TLzhb/m+au7rPTBDossWLE2vWha4lNxGb4yGQKmUcahtPjpx9OiBnaSa8ubks5qOiyqTXXec7Yh8uEdqBfnYM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566915614; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=kS2edQOEylUGh1Xag1v82ghYCpijAsogTjsd8aRsTms=; b=g1W6MsOmVeyP6A7dhvMWpUoItaLstLm0QTcvf8mOfcyMOrwKWZKrNoyCL00/+kjbes1ugVBURQh3s87m3eVIGXLfeYa7Ceo7nNip5lbaXxhA45Doy0KDzsXyaUtjVdzMsbfBc+6OzJHIiWq/6AGKm+YHKABIls1ksVMu4sy4hUI= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156691561417377.4702408699103; Tue, 27 Aug 2019 07:20:14 -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 A811230034A4; Tue, 27 Aug 2019 14:20:12 +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 536B21053B39; Tue, 27 Aug 2019 14:20:12 +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 B484524F31; Tue, 27 Aug 2019 14:20:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7REK9ma024526 for ; Tue, 27 Aug 2019 10:20:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id DD4174129; Tue, 27 Aug 2019 14:20:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C272F165D9 for ; Tue, 27 Aug 2019 14:19:37 +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 5E0A285540 for ; Tue, 27 Aug 2019 14:19:37 +0000 (UTC) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7REIfj7098513 for ; Tue, 27 Aug 2019 10:19:37 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2un5wa8ujr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Aug 2019 10:19:36 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2019 15:19:34 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Aug 2019 15:19:32 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7REJUR030212488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Aug 2019 14:19:30 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB7A011C04A; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F39311C054; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) From: Bjoern Walk To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 16:19:20 +0200 In-Reply-To: <20190827141923.112378-1-bwalk@linux.ibm.com> References: <20190827141923.112378-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19082714-0012-0000-0000-000003437FB7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19082714-0013-0000-0000-0000217DB8E0 Message-Id: <20190827141923.112378-4-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-27_02:, , 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 mlxscore=0 impostorscore=0 mlxlogscore=780 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908270153 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 27 Aug 2019 14:19:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 27 Aug 2019 14:19:37 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski Subject: [libvirt] [PATCH 3/6] qemu: move hostdev boot validation into domain validation 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: , 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.47]); Tue, 27 Aug 2019 14:20:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Moving the hostdev boot support validation from the command line generator code into the domain validation code. Reviewed-by: Marc Hartmayer Signed-off-by: Bjoern Walk Signed-off-by: Boris Fiuczynski Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 12 ------------ src/qemu/qemu_domain.c | 13 +++++++++++++ tests/qemuxml2argvtest.c | 6 +++--- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c3931b67..4a430ddf 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5422,18 +5422,6 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd, virDomainHostdevSubsysPtr subsys =3D &hostdev->source.subsys; VIR_AUTOFREE(char *) devstr =3D NULL; =20 - if (hostdev->info->bootIndex) { - if (hostdev->mode !=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || - (subsys->type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI && - subsys->type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB && - subsys->type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("booting from assigned devices is only " - "supported for PCI, USB and SCSI devices"= )); - return -1; - } - } - /* USB */ if (hostdev->mode =3D=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && subsys->type =3D=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) { diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d0722f87..ed3a8a4f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5295,9 +5295,22 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHo= stdevDef *hostdev, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: + break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: + if (hostdev->info->bootIndex) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("booting from assigned devices is only " + "supported for PCI, USB and SCSI devices"= )); + return -1; + } break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: + if (hostdev->info->bootIndex) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("booting from assigned devices is only " + "supported for PCI, USB and SCSI devices"= )); + return -1; + } mdevsrc =3D &hostdev->source.subsys.u.mdev; return qemuDomainMdevDefValidate(mdevsrc, def, qemuCaps); case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c1eb9cba..c6b72f83 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1639,8 +1639,8 @@ mymain(void) =20 DO_TEST_CAPS_ARCH_LATEST("hostdev-subsys-mdev-vfio-ap", "s390x"); - DO_TEST_CAPS_ARCH_LATEST_FAILURE("hostdev-subsys-mdev-vfio-ap-boot-fai= l", - "s390x"); + DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("hostdev-subsys-mdev-vfio-ap-boot= -fail", + "s390x"); =20 DO_TEST_FULL("restore-v2", ARG_MIGRATE_FROM, "exec:cat", @@ -2444,7 +2444,7 @@ mymain(void) DO_TEST("hostdev-scsi-vhost-scsi-pci", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI); - DO_TEST_CAPS_LATEST_FAILURE("hostdev-scsi-vhost-scsi-pci-boot-fail"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("hostdev-scsi-vhost-scsi-pci-boot-fail= "); DO_TEST("hostdev-scsi-vhost-scsi-pcie", QEMU_CAPS_KVM, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 22:54:37 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1566915726; cv=none; d=zoho.com; s=zohoarc; b=I6Q5zKKmRiwRrX6HJRu1UCoumimiEbiLXOVi3v+XRTj2AJqeTWsLDZmPwUnPjQw1TSdUo/r3POAoZmC5kjZWxHnusKYS/9JwCSR+KxdttUoRYt9IPQ4tsHucWU4pD+DYmYAKSICZwpCpfeYsIvd98g5saDvqjanVicxvhLLFIbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566915726; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=RJ6aoNpXEcilPYMyFTCL+JqgWK+w5tQtQu629YeDv38=; b=dLE4SALuwJ00pcYzV1DRVevveu7xlcJg8M5WaNGbgJhycFejM2sKNJbF3aiMLmHcjcfw502yinY57c4X+ndeKSSbDiXrIxg4Ju3Qh7FsZIdiTxNXMBVGDu8Aw3Zjj76pF9OT6G+YRrKlS+92X2VprYOQAjx0jn5MxbZZ+YponkU= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566915726274389.8381316986189; Tue, 27 Aug 2019 07:22:06 -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 85F51305B41E; Tue, 27 Aug 2019 14:22:04 +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 4AC541001B07; Tue, 27 Aug 2019 14:22:04 +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 068391806B00; Tue, 27 Aug 2019 14:22:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7REM2YV024641 for ; Tue, 27 Aug 2019 10:22:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id AA6E36060D; Tue, 27 Aug 2019 14:22:02 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2F8F60600 for ; Tue, 27 Aug 2019 14:21:59 +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 B0BAB88309 for ; Tue, 27 Aug 2019 14:21:58 +0000 (UTC) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7RELmXK086980 for ; Tue, 27 Aug 2019 10:21:58 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2un417xkeq-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Aug 2019 10:21:52 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2019 15:19:35 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Aug 2019 15:19:32 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7REJ9Zj37290266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Aug 2019 14:19:09 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11A9911C054; Tue, 27 Aug 2019 14:19:31 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D8E3F11C04C; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 27 Aug 2019 14:19:30 +0000 (GMT) From: Bjoern Walk To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 16:19:21 +0200 In-Reply-To: <20190827141923.112378-1-bwalk@linux.ibm.com> References: <20190827141923.112378-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19082714-0020-0000-0000-000003648149 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19082714-0021-0000-0000-000021B9CEFC Message-Id: <20190827141923.112378-5-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-27_02:, , 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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908270153 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 27 Aug 2019 14:21:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 27 Aug 2019 14:21:58 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski Subject: [libvirt] [PATCH 4/6] qemu: make error messages device specific 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: , Content-Type: text/plain; charset="utf-8" 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.47]); Tue, 27 Aug 2019 14:22:05 +0000 (UTC) From: Boris Fiuczynski Changing the error messages to report the problem encountered. Reviewed-by: J=C3=A1n Tomko Reviewed-by: Marc Hartmayer Signed-off-by: Bjoern Walk Signed-off-by: Boris Fiuczynski --- src/qemu/qemu_domain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ed3a8a4f..b8260921 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5299,16 +5299,16 @@ qemuDomainDeviceDefValidateHostdev(const virDomainH= ostdevDef *hostdev, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: if (hostdev->info->bootIndex) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("booting from assigned devices is only " - "supported for PCI, USB and SCSI devices"= )); + _("booting from assigned devices is not " + "supported by vhost SCSI devices")); return -1; } break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: if (hostdev->info->bootIndex) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("booting from assigned devices is only " - "supported for PCI, USB and SCSI devices"= )); + _("booting from assigned devices is not " + "supported by mediated devices")); return -1; } mdevsrc =3D &hostdev->source.subsys.u.mdev; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 22:54:37 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1566915589; cv=none; d=zoho.com; s=zohoarc; b=aRNy7OBYzKQznhj8z3COQ3z71MJ8eo25+Xk6UaA9amgyPhKFuAfyLCeJqq6fCzqCDlgkjhhQbPiCQirYTe2Cwg3rjeFmfR/NjlkhrEeZ8DyohvDej/IpyaoRjE6vY6lVEQ5tTv+i5wjco5T4CNy524pDM9t0oXw6Zm+4r+ueoWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566915589; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=+KCr7+Psk6TrBm89mFKkSeiKYH4N+UZSvMDNNNcKNKU=; b=ajmus7PjRkIFzjbmJ+DiEsG5FFERuW0CCL+DSQInlpYj5urEnO6loha0cSe0D9SX/Jmptwpm+rFE7GLCJU3MOq2I5xgM0rycf/D0idXvBvsMmnSy5vCY/bKrT5lrzKDgMLolr+VG3Zbdh8slRSOn54GDCgPBQDpm6nfayeTwEnY= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566915589703242.169766167047; Tue, 27 Aug 2019 07:19:49 -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 4747269EE7; Tue, 27 Aug 2019 14:19:48 +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 018945C1D6; Tue, 27 Aug 2019 14:19:48 +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 AE1B2180BA9B; Tue, 27 Aug 2019 14:19:47 +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 x7REJj2O024452 for ; Tue, 27 Aug 2019 10:19:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8F6A21751E; Tue, 27 Aug 2019 14:19:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71E275C22F for ; Tue, 27 Aug 2019 14:19:39 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 8CE573084242 for ; Tue, 27 Aug 2019 14:19:38 +0000 (UTC) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7REJCsb038861 for ; Tue, 27 Aug 2019 10:19:38 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2un4brp3vt-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Aug 2019 10:19:37 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2019 15:19:34 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Aug 2019 15:19:32 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7REJ9Es35324176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Aug 2019 14:19:09 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4335B11C064; Tue, 27 Aug 2019 14:19:31 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1EB1311C05C; Tue, 27 Aug 2019 14:19:31 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 27 Aug 2019 14:19:31 +0000 (GMT) From: Bjoern Walk To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 16:19:22 +0200 In-Reply-To: <20190827141923.112378-1-bwalk@linux.ibm.com> References: <20190827141923.112378-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19082714-0016-0000-0000-000002A381D9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19082714-0017-0000-0000-00003303CDCB Message-Id: <20190827141923.112378-6-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-27_02:, , 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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908270153 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 27 Aug 2019 14:19:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 27 Aug 2019 14:19:38 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski Subject: [libvirt] [PATCH 5/6] qemu: refactor mdev validation method signatures 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: , Content-Type: text/plain; charset="utf-8" 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.25]); Tue, 27 Aug 2019 14:19:48 +0000 (UTC) From: Boris Fiuczynski Refactoring the method signatures in preparation for checking boot index of the mediated devices. Reviewed-by: J=C3=A1n Tomko Reviewed-by: Marc Hartmayer Signed-off-by: Bjoern Walk Signed-off-by: Boris Fiuczynski --- src/qemu/qemu_domain.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b8260921..581b48bc 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5190,10 +5190,13 @@ qemuDomainDeviceDefValidateNetwork(const virDomainN= etDef *net) =20 =20 static int -qemuDomainMdevDefVFIOPCIValidate(const virDomainHostdevSubsysMediatedDev *= dev, +qemuDomainMdevDefVFIOPCIValidate(const virDomainHostdevDef *hostdev, const virDomainDef *def, virQEMUCapsPtr qemuCaps) { + const virDomainHostdevSubsysMediatedDev *dev; + + dev =3D &hostdev->source.subsys.u.mdev; if (dev->display =3D=3D VIR_TRISTATE_SWITCH_ABSENT) return 0; =20 @@ -5226,17 +5229,18 @@ qemuDomainMdevDefVFIOPCIValidate(const virDomainHos= tdevSubsysMediatedDev *dev, =20 =20 static int -qemuDomainMdevDefVFIOAPValidate(const virDomainDef *def) +qemuDomainMdevDefVFIOAPValidate(const virDomainHostdevDef *hostdev ATTRIBU= TE_UNUSED, + const virDomainDef *def) { size_t i; bool vfioap_found =3D false; =20 /* VFIO-AP is restricted to a single mediated device only */ for (i =3D 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev =3D def->hostdevs[i]; + virDomainHostdevDefPtr hdev =3D def->hostdevs[i]; =20 - if (virHostdevIsMdevDevice(hostdev) && - hostdev->source.subsys.u.mdev.model =3D=3D VIR_MDEV_MODEL_TYPE= _VFIO_AP) { + if (virHostdevIsMdevDevice(hdev) && + hdev->source.subsys.u.mdev.model =3D=3D VIR_MDEV_MODEL_TYPE_VF= IO_AP) { if (vfioap_found) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Only one hostdev of model vfio-ap is " @@ -5252,15 +5256,18 @@ qemuDomainMdevDefVFIOAPValidate(const virDomainDef = *def) =20 =20 static int -qemuDomainMdevDefValidate(const virDomainHostdevSubsysMediatedDev *mdevsrc, +qemuDomainMdevDefValidate(const virDomainHostdevDef *hostdev, const virDomainDef *def, virQEMUCapsPtr qemuCaps) { + const virDomainHostdevSubsysMediatedDev *mdevsrc; + + mdevsrc =3D &hostdev->source.subsys.u.mdev; switch ((virMediatedDeviceModelType) mdevsrc->model) { case VIR_MDEV_MODEL_TYPE_VFIO_PCI: - return qemuDomainMdevDefVFIOPCIValidate(mdevsrc, def, qemuCaps); + return qemuDomainMdevDefVFIOPCIValidate(hostdev, def, qemuCaps); case VIR_MDEV_MODEL_TYPE_VFIO_AP: - return qemuDomainMdevDefVFIOAPValidate(def); + return qemuDomainMdevDefVFIOAPValidate(hostdev, def); case VIR_MDEV_MODEL_TYPE_VFIO_CCW: break; case VIR_MDEV_MODEL_TYPE_LAST: @@ -5279,8 +5286,6 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHos= tdevDef *hostdev, const virDomainDef *def, virQEMUCapsPtr qemuCaps) { - const virDomainHostdevSubsysMediatedDev *mdevsrc; - /* forbid capabilities mode hostdev in this kind of hypervisor */ if (hostdev->mode =3D=3D VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -5311,8 +5316,7 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHos= tdevDef *hostdev, "supported by mediated devices")); return -1; } - mdevsrc =3D &hostdev->source.subsys.u.mdev; - return qemuDomainMdevDefValidate(mdevsrc, def, qemuCaps); + return qemuDomainMdevDefValidate(hostdev, def, qemuCaps); case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: default: virReportEnumRangeError(virDomainHostdevSubsysType, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 22:54:37 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1566915591; cv=none; d=zoho.com; s=zohoarc; b=K5TQXIxckQjTjDOdEW64txsWsKubSdHFyMx2vDSpB5WYl6cdghBpyjYL8g3Nt8f7v34TXewR1wdptZ3ofVa6bFGGxS6O2A3gU78ibIA/875/4WaaQvWYH1hOAVwg8+XnvS5GPSzZrYLqmWd5hPrbV6O1QxrC/+D3Hx09AuZcn+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566915591; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=8Tvf5XUQgAqmqeow8P23kYZeGrdOzqXj4dHUNRtxeXo=; b=AAVS+JGVT5wVqFKa4OElTeN22uQu/av67OiQRrjn2oLaKhYbHo+ucywCRIo1bDg6l5Ecs7HZV+qI4WJzj05/e79LNCpb4fgm9QdByYVA+AYRQuZAtPEk3vex9/JG0j4RkmQy1Z99Q6SP6IOpw5S3QMi5Gpk7jtl9k5jyu1kMcDU= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566915591992890.3422351181671; Tue, 27 Aug 2019 07:19:51 -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 AAC4869061; Tue, 27 Aug 2019 14:19:50 +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 68BC1104B500; Tue, 27 Aug 2019 14:19:50 +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 0983424F34; Tue, 27 Aug 2019 14:19:50 +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 x7REJjlL024444 for ; Tue, 27 Aug 2019 10:19:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C3135C1D6; Tue, 27 Aug 2019 14:19:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx23.extmail.prod.ext.phx2.redhat.com [10.5.110.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2718F5C1B2 for ; Tue, 27 Aug 2019 14:19:38 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 78140107C37E for ; Tue, 27 Aug 2019 14:19:37 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7REIeNh072292 for ; Tue, 27 Aug 2019 10:19:36 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2un5cxtqe4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Aug 2019 10:19:36 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2019 15:19:35 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Aug 2019 15:19:33 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7REJ9sR41550094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Aug 2019 14:19:09 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8991211C04C; Tue, 27 Aug 2019 14:19:31 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 58B4411C050; Tue, 27 Aug 2019 14:19:31 +0000 (GMT) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 27 Aug 2019 14:19:31 +0000 (GMT) From: Bjoern Walk To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 16:19:23 +0200 In-Reply-To: <20190827141923.112378-1-bwalk@linux.ibm.com> References: <20190827141923.112378-1-bwalk@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19082714-0020-0000-0000-00000364814A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19082714-0021-0000-0000-000021B9CEFD Message-Id: <20190827141923.112378-7-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-27_02:, , 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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908270153 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Tue, 27 Aug 2019 14:19:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Tue, 27 Aug 2019 14:19:37 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.64 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Boris Fiuczynski Subject: [libvirt] [PATCH 6/6] qemu: support bootindex on vfio-ccw mdev devices 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: , 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.28]); Tue, 27 Aug 2019 14:19:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Boris Fiuczynski Add support to specify a boot order on vfio-ccw passthrough devices. Reviewed-by: Marc Hartmayer Signed-off-by: Bjoern Walk Signed-off-by: Boris Fiuczynski Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 4 +++ src/qemu/qemu_domain.c | 26 ++++++++++---- ...ubsys-mdev-vfio-ccw-boot.s390x-latest.args | 34 +++++++++++++++++++ .../hostdev-subsys-mdev-vfio-ccw-boot.xml | 23 +++++++++++++ tests/qemuxml2argvtest.c | 2 ++ ...subsys-mdev-vfio-ccw-boot.s390x-latest.xml | 29 ++++++++++++++++ tests/qemuxml2xmltest.c | 2 ++ 7 files changed, 113 insertions(+), 7 deletions(-) create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boo= t.s390x-latest.args create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boo= t.xml create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-b= oot.s390x-latest.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4a430ddf..373ebd6d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5375,6 +5375,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, return virBufferContentAndReset(&buf); } =20 + char * qemuBuildHostdevMediatedDevStr(const virDomainDef *def, virDomainHostdevDefPtr dev, @@ -5403,6 +5404,9 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *de= f, if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0) return NULL; =20 + if (dev->info->bootIndex) + virBufferAsprintf(&buf, ",bootindex=3D%u", dev->info->bootIndex); + if (virBufferCheckError(&buf) < 0) return NULL; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 581b48bc..4998474d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5196,6 +5196,15 @@ qemuDomainMdevDefVFIOPCIValidate(const virDomainHost= devDef *hostdev, { const virDomainHostdevSubsysMediatedDev *dev; =20 + /* VFIO-PCI does not support boot */ + if (hostdev->info->bootIndex) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("booting from assigned devices is not " + "supported by mediated devices of " + "model vfio-pci")); + return -1; + } + dev =3D &hostdev->source.subsys.u.mdev; if (dev->display =3D=3D VIR_TRISTATE_SWITCH_ABSENT) return 0; @@ -5229,12 +5238,21 @@ qemuDomainMdevDefVFIOPCIValidate(const virDomainHos= tdevDef *hostdev, =20 =20 static int -qemuDomainMdevDefVFIOAPValidate(const virDomainHostdevDef *hostdev ATTRIBU= TE_UNUSED, +qemuDomainMdevDefVFIOAPValidate(const virDomainHostdevDef *hostdev, const virDomainDef *def) { size_t i; bool vfioap_found =3D false; =20 + /* VFIO-AP does not support boot */ + if (hostdev->info->bootIndex) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("booting from assigned devices is not " + "supported by mediated devices of " + "model vfio-ap")); + return -1; + } + /* VFIO-AP is restricted to a single mediated device only */ for (i =3D 0; i < def->nhostdevs; i++) { virDomainHostdevDefPtr hdev =3D def->hostdevs[i]; @@ -5310,12 +5328,6 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHo= stdevDef *hostdev, } break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: - if (hostdev->info->bootIndex) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("booting from assigned devices is not " - "supported by mediated devices")); - return -1; - } return qemuDomainMdevDefValidate(hostdev, def, qemuCaps); case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: default: diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x= -latest.args b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.s39= 0x-latest.args new file mode 100644 index 00000000..aef2eb37 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest= .args @@ -0,0 +1,34 @@ +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 \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine s390-ccw-virtio,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 512 \ +-overcommit mem-lock=3Doff \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device vfio-ccw,id=3Dhostdev0,\ +sysfsdev=3D/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627,\ +devno=3Dfe.0.0000,bootindex=3D1 \ +-device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0001 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml b= /tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml new file mode 100644 index 00000000..6cca13c3 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml @@ -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/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c6b72f83..9588d26d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1625,6 +1625,8 @@ mymain(void) QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST_CAPS_ARCH_LATEST("hostdev-subsys-mdev-vfio-ccw-boot", + "s390x"); DO_TEST_FAILURE("hostdev-subsys-mdev-vfio-ccw", QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED); diff --git a/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-boot.s39= 0x-latest.xml b/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-boot.= s390x-latest.xml new file mode 100644 index 00000000..68defea4 --- /dev/null +++ b/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-late= st.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/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e9eed4c3..2f9a07e6 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -959,6 +959,8 @@ mymain(void) QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST_CAPS_ARCH_LATEST("hostdev-subsys-mdev-vfio-ccw-boot", + "s390x"); DO_TEST("hostdev-subsys-mdev-vfio-ap", QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list