From nobody Sat Feb 7 22:42:13 2026 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=1565710849; cv=none; d=zoho.com; s=zohoarc; b=fnPr472G472f6s65Yk9+YAS5by1RoCcLaghHZ18Qf4TDpeqMITjxTSdtqJq7sE/qAMxYId0q1ddDvTlkpNXMI7/ZtQUmMs869hmA4dKo8TVik3f04+u+nljqyNdamvdxaU5fQwroBNcO8Ip2NRJQ5jsMunA7j2Iz5/rxypTWgP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565710849; 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=iVm50z+61TgN/30FwbMnU7BeX7saIwC21dxTcj0YvZQ=; b=hFaKiyFT1cf15XPxFcWBHh/cSKz4oI9bKCxQSV8jhmVG4WTrP+xIOn56hpKfwpxXDutB1NvNpBJhiM/OuPdLICpQL4kD181CAIkx+mtLFMbxakC+j8BSZw6585E4lRM7W6NxoPsn9pTKw0bqTMSSdgrFYpdTUF2SNM/7v15LPw4= 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 1565710849654835.6154576009036; Tue, 13 Aug 2019 08:40:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 80CCE81F18; Tue, 13 Aug 2019 15:40:48 +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 1F40C805C2; Tue, 13 Aug 2019 15:40: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 2C9A024F33; Tue, 13 Aug 2019 15:40:47 +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 x7DFeiaB009923 for ; Tue, 13 Aug 2019 11:40:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 16416608A5; Tue, 13 Aug 2019 15:40:44 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 109DD7EB96 for ; Tue, 13 Aug 2019 15:40:44 +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 2A16830715F9 for ; Tue, 13 Aug 2019 15:40:42 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7DFXVIv076984 for ; Tue, 13 Aug 2019 11:40:41 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ubyka1dec-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2019 11:40:41 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Aug 2019 16:40:39 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 13 Aug 2019 16:40:37 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7DFeanJ27132184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Aug 2019 15:40:36 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 171F0A405B; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3765A4066; Tue, 13 Aug 2019 15:40:35 +0000 (GMT) Received: from localhost.localdomain (unknown [9.152.222.28]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Aug 2019 15:40:35 +0000 (GMT) From: Boris Fiuczynski To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 17:40:25 +0200 In-Reply-To: <20190813154030.11283-1-fiuczy@linux.ibm.com> References: <20190813154030.11283-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19081315-4275-0000-0000-000003589529 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081315-4276-0000-0000-0000386AA53A Message-Id: <20190813154030.11283-2-fiuczy@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-13_05:, , 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-1908130159 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.49]); Tue, 13 Aug 2019 15:40:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 13 Aug 2019 15:40:42 +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.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.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: jjherne@linux.ibm.com, bwalk@linux.ibm.com, pkrempa@redhat.com, mhartmay@linux.ibm.com Subject: [libvirt] [PATCH v2 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 13 Aug 2019 15:40:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer --- .../hostdev-subsys-mdev-vfio-ap-boot-fail.xml | 23 +++++++++++++++ .../hostdev-subsys-mdev-vfio-ap.args | 28 +++++++++++++++++++ .../hostdev-subsys-mdev-vfio-ap.xml | 22 +++++++++++++++ tests/qemuxml2argvtest.c | 9 ++++++ .../hostdev-subsys-mdev-vfio-ap.xml | 27 ++++++++++++++++++ tests/qemuxml2xmltest.c | 4 +++ 6 files changed, 113 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.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 0000000000..3f9bb64b8b --- /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 0000000000..f9b5d2c84b --- /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.xml b/tests= /qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.xml new file mode 100644 index 0000000000..e7370b5838 --- /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 c166fd18d6..f113dbb0fd 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1633,6 +1633,15 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); =20 + DO_TEST("hostdev-subsys-mdev-vfio-ap", + QEMU_CAPS_CCW, + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, + QEMU_CAPS_DEVICE_VFIO_AP); + DO_TEST_FAILURE("hostdev-subsys-mdev-vfio-ap-boot-fail", + QEMU_CAPS_CCW, + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, + QEMU_CAPS_DEVICE_VFIO_AP); + 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 0000000000..afaa9c3e43 --- /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 e67f1c7460..6fa9a26b64 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -958,6 +958,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.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Feb 7 22:42:13 2026 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=1565710851; cv=none; d=zoho.com; s=zohoarc; b=YCN7ypE+1idl1jkNSFJC+01fi0Vmtika1Ut+C5Np4eO6EOoNJrALE5khvDw5erlOXEgdYUj0+QGuqlM3Nw/PyntTrkQHciN2KVCqVFPRF6y7I2vg98HRB7tz7aCHvFWX4iEJTT8XKPJgu6JTOP/0cZGTmeb5/K1y369Ybhgpejc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565710851; 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=wFqrtXYYBLT0Oxz0OQelJqsJYvcqdEoFeY3lNaZCehI=; b=H3jPt/6CjrkujPYco+oRvFeT+KAdvntclqKtW1KAz0/Qc39si5PXnvrfFmuWqvNSvpVuiWB98Mi4DT0+OnJzqKAYd/fW09kivvAlJCWLD5E+wRvJfnlrh9WZdZZGtHX6bh5MwfSuaFlv7nP81lpqeTFtvKXfNzPTej9Z9k3uky4= 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 1565710851970899.3297846003215; Tue, 13 Aug 2019 08:40:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C67A7FDEC; Tue, 13 Aug 2019 15:40: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 6BF5F8220C; Tue, 13 Aug 2019 15:40: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 F343D24F33; Tue, 13 Aug 2019 15:40:49 +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 x7DFekks009962 for ; Tue, 13 Aug 2019 11:40:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id BFE623793; Tue, 13 Aug 2019 15:40:46 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAB304B5 for ; Tue, 13 Aug 2019 15:40:42 +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 973E94FCDB for ; Tue, 13 Aug 2019 15:40:41 +0000 (UTC) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7DFWbSO050028 for ; Tue, 13 Aug 2019 11:40:41 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ubyawj82b-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2019 11:40:40 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Aug 2019 16:40:39 +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, 13 Aug 2019 16:40:37 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7DFeaHU41288068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Aug 2019 15:40:36 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5B97CA4054; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C5F9A4060; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) Received: from localhost.localdomain (unknown [9.152.222.28]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) From: Boris Fiuczynski To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 17:40:26 +0200 In-Reply-To: <20190813154030.11283-1-fiuczy@linux.ibm.com> References: <20190813154030.11283-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19081315-0028-0000-0000-0000038F31DA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081315-0029-0000-0000-0000245141FC Message-Id: <20190813154030.11283-3-fiuczy@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-13_05:, , 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=994 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908130159 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.30]); Tue, 13 Aug 2019 15:40:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 13 Aug 2019 15:40:41 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'fiuczy@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.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: jjherne@linux.ibm.com, bwalk@linux.ibm.com, pkrempa@redhat.com, mhartmay@linux.ibm.com Subject: [libvirt] [PATCH v2 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 13 Aug 2019 15:40:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Adding a failure test for booting from a vhost scsi hostdev device. Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer --- .../hostdev-scsi-vhost-scsi-pci-boot-fail.xml | 41 +++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 2 files changed, 44 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 0000000000..94f590b11b --- /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 f113dbb0fd..5f94780f61 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2444,6 +2444,9 @@ mymain(void) DO_TEST("hostdev-scsi-vhost-scsi-pci", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI); + DO_TEST_FAILURE("hostdev-scsi-vhost-scsi-pci-boot-fail", + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_DEVICE_VHOST_SCSI); DO_TEST("hostdev-scsi-vhost-scsi-pcie", QEMU_CAPS_KVM, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI, --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Feb 7 22:42:13 2026 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=1565710845; cv=none; d=zoho.com; s=zohoarc; b=fjVggE3S/sQIFO8PyFJMzJ303TxmtzVXUQ1XlXzGYorR3j6QajPWvb78kbOrp83cOusQmz/0Z0gNFLgVYcbKWV7lO6vLfp1rGCubQGaHKLTjB9DyJWFDL8QVG4GZAtwsdM1SVuO7aOSXK/Abicw2ndPCG4C/OonGRxhf5KJvQfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565710845; 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=ULvIfug2DoGgj8It4KeJy8E1i4k46iCzykojOlhrItY=; b=PgCNN5XY8Oj58rYc6Y95rLqq/NTImnLI/5E8N0+RlwBZBLU9VdcJyhpjDAV5Eb5ewy31OXfG2lN+CRzNABAz3eTzOMv2CxqqQg3MsyIvt7mGaq6JegjJEhDpDetnHVPm6YeoIcmB86Z/kmUa7SqObe9EfWFX36MWeWApHlTKkak= 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 1565710845815907.2068660700211; Tue, 13 Aug 2019 08:40:45 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 71B074FCDF; Tue, 13 Aug 2019 15:40:44 +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 4C8FC82489; Tue, 13 Aug 2019 15:40:44 +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 DDB6724F30; Tue, 13 Aug 2019 15:40:43 +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 x7DFegAu009912 for ; Tue, 13 Aug 2019 11:40:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id E150D6092F; Tue, 13 Aug 2019 15:40:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DAFA47EB96 for ; Tue, 13 Aug 2019 15:40:42 +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 447E2307F5E4 for ; Tue, 13 Aug 2019 15:40:42 +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 x7DFWfhc084024 for ; Tue, 13 Aug 2019 11:40:41 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uby7ctjnp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2019 11:40:41 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Aug 2019 16:40:39 +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, 13 Aug 2019 16:40:38 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7DFeaBG38797616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Aug 2019 15:40:36 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B085A4066; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66B80A405B; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) Received: from localhost.localdomain (unknown [9.152.222.28]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) From: Boris Fiuczynski To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 17:40:27 +0200 In-Reply-To: <20190813154030.11283-1-fiuczy@linux.ibm.com> References: <20190813154030.11283-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19081315-0028-0000-0000-0000038F31D9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081315-0029-0000-0000-0000245141FD Message-Id: <20190813154030.11283-4-fiuczy@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-13_05:, , 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-1908130159 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.44]); Tue, 13 Aug 2019 15:40:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 13 Aug 2019 15:40:42 +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.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.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: jjherne@linux.ibm.com, bwalk@linux.ibm.com, pkrempa@redhat.com, mhartmay@linux.ibm.com Subject: [libvirt] [PATCH v2 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 13 Aug 2019 15:40:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Moving the hostdev boot support validation from the command line generator code into the domain validation code. Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer --- src/qemu/qemu_command.c | 13 +------------ src/qemu/qemu_domain.c | 13 +++++++++++++ tests/qemuxml2argvtest.c | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f096e8f27e..d32ffed5d6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5625,6 +5625,7 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *de= f, return ret; } =20 + static int qemuBuildHostdevCommandLine(virCommandPtr cmd, const virDomainDef *def, @@ -5638,18 +5639,6 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd, virDomainHostdevSubsysPtr subsys =3D &hostdev->source.subsys; char *devstr; =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 b9c5a4e541..ce5334aa67 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5263,9 +5263,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 5f94780f61..e378df097c 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1637,7 +1637,7 @@ mymain(void) QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_AP); - DO_TEST_FAILURE("hostdev-subsys-mdev-vfio-ap-boot-fail", + DO_TEST_PARSE_ERROR("hostdev-subsys-mdev-vfio-ap-boot-fail", QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_AP); @@ -2444,7 +2444,7 @@ mymain(void) DO_TEST("hostdev-scsi-vhost-scsi-pci", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI); - DO_TEST_FAILURE("hostdev-scsi-vhost-scsi-pci-boot-fail", + DO_TEST_PARSE_ERROR("hostdev-scsi-vhost-scsi-pci-boot-fail", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI); DO_TEST("hostdev-scsi-vhost-scsi-pcie", --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Feb 7 22:42:13 2026 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=1565710845; cv=none; d=zoho.com; s=zohoarc; b=Xk0+YpokW6QY8hcUTzGTiADig6Lt05QRuf7p4VnHQDSM49T06eB/z5r3MEH+9RNJlNYDQuxGEGj928z0sx+/jXdKVI2NX4nz1yeMJMErdcQoeQOHQMCHTU1H6nFo/mP0sy6Bk+1WJECfRUucm+tE6mkOyxsSI53f2qbrna1gnC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565710845; 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=87VNvBEkbmK1X5CAQ/VeiM36jOIgInkugeqe2eV0M3U=; b=Ztl19i5vk0ZQN5N3LuaCxyN2TLKHFcajf+UYX7Ch4jrP2Wv01jRq5QmNZ996Bg+N/s/yz2j9W2dShgj6zBD/Jp/553OGCGKkb3+41H17CT0iX2V2e54kp1l/icOqM4VJ5hCl3799tt6446gGNkDO4vvfBsI9grl8/n9PV2JVuS0= 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 1565710845597995.3909273741208; Tue, 13 Aug 2019 08:40:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7BB4089AC0; Tue, 13 Aug 2019 15:40:44 +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 4E9627EB96; Tue, 13 Aug 2019 15:40:44 +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 02AEA180BA99; Tue, 13 Aug 2019 15:40:44 +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 x7DFehxt009917 for ; Tue, 13 Aug 2019 11:40:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 37EBC608A5; Tue, 13 Aug 2019 15:40:43 +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 3103C7EB96 for ; Tue, 13 Aug 2019 15:40:43 +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 AB0AF6908A for ; Tue, 13 Aug 2019 15:40:42 +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 x7DFXfDV099238 for ; Tue, 13 Aug 2019 11:40:42 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ubwm47sxs-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2019 11:40:42 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Aug 2019 16:40:39 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) 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, 13 Aug 2019 16:40:38 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7DFea7Q34013442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Aug 2019 15:40:36 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CF617A4067; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A13BAA4060; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) Received: from localhost.localdomain (unknown [9.152.222.28]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) From: Boris Fiuczynski To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 17:40:28 +0200 In-Reply-To: <20190813154030.11283-1-fiuczy@linux.ibm.com> References: <20190813154030.11283-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19081315-0020-0000-0000-0000035F32E9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081315-0021-0000-0000-000021B4487B Message-Id: <20190813154030.11283-5-fiuczy@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-13_05:, , 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=992 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908130159 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, 13 Aug 2019 15:40:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 13 Aug 2019 15:40:42 +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.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: jjherne@linux.ibm.com, bwalk@linux.ibm.com, pkrempa@redhat.com, mhartmay@linux.ibm.com Subject: [libvirt] [PATCH v2 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 13 Aug 2019 15:40:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Changing the error messages to report the problem encountered. Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer Reviewed-by: J=C3=A1n Tomko --- 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 ce5334aa67..9a9b6676e3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5267,16 +5267,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.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Feb 7 22:42:13 2026 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=1565710854; cv=none; d=zoho.com; s=zohoarc; b=kxhI/R9PBgRAWbKtHT3ngmG/IRlNqs+gcqL2pLSuC0x72ZJk+NcDBfwdctuYM1HxwK9i7azIe62wlEkGr79ueSxT+5QdaUtG8v0lA/KTs1RsnTbQOPhilVi1rEz/uGy9zgvH44U2kah5iF6CCdb8wYX3kQytEP8qMcJG9diQ8Tg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565710854; 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=MsmfFEF5uzXKWgbdrAdFWUJp1GaKAEdbAXEc4SOg01s=; b=CjTFaENn3tr88fkgfapXZq1BoAV3Pte5JoOuDpNG+U1wmpvGBSvZ7KDTbn9nhqlHwghF2DT3a0t1echk2RSps0dxx8Ur1MwxqQpKAWGmPTHETpT6QW80kCxvEsTArOXIV4h9eSZakLr9ZFNTR2tIX9LLrCxhuDLcDPOcyGMehXY= 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 1565710854007263.98006673631073; Tue, 13 Aug 2019 08:40:54 -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 8FFC430622E4; Tue, 13 Aug 2019 15:40:51 +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 6080310190A1; Tue, 13 Aug 2019 15:40:51 +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 137C5180B536; Tue, 13 Aug 2019 15:40:51 +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 x7DFejWx009946 for ; Tue, 13 Aug 2019 11:40:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 419EB82E27; Tue, 13 Aug 2019 15:40:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C79882489 for ; Tue, 13 Aug 2019 15:40:42 +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 AF7C2316E534 for ; Tue, 13 Aug 2019 15:40:41 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7DFXMQ5032298 for ; Tue, 13 Aug 2019 11:40:41 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2uby40axk8-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2019 11:40:40 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Aug 2019 16:40:39 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) 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, 13 Aug 2019 16:40:38 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7DFeILp35127650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Aug 2019 15:40:18 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1659AA4060; Tue, 13 Aug 2019 15:40:37 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DADCBA405F; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) Received: from localhost.localdomain (unknown [9.152.222.28]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Aug 2019 15:40:36 +0000 (GMT) From: Boris Fiuczynski To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 17:40:29 +0200 In-Reply-To: <20190813154030.11283-1-fiuczy@linux.ibm.com> References: <20190813154030.11283-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19081315-0012-0000-0000-0000033E358F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081315-0013-0000-0000-00002178459E Message-Id: <20190813154030.11283-6-fiuczy@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-13_05:, , 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-1908130159 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.41]); Tue, 13 Aug 2019 15:40:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 13 Aug 2019 15:40:42 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'fiuczy@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.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: jjherne@linux.ibm.com, bwalk@linux.ibm.com, pkrempa@redhat.com, mhartmay@linux.ibm.com Subject: [libvirt] [PATCH v2 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-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.44]); Tue, 13 Aug 2019 15:40:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Refactoring the method signatures in preparation for checking boot index of the mediated devices. Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer Reviewed-by: J=C3=A1n Tomko --- 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 9a9b6676e3..7331d93868 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5158,10 +5158,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 @@ -5194,17 +5197,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 " @@ -5220,15 +5224,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: @@ -5247,8 +5254,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, @@ -5279,8 +5284,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.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Feb 7 22:42:13 2026 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=1565710859; cv=none; d=zoho.com; s=zohoarc; b=GEFBisvjaU39vLZm/jBN8lFmqV1M7udgx38cnhZceBtoDW0y1ODACyE1ArgQun4dMQ1b55PNsdTMBD7p8P+WVgoMt+ZYEkIHxRRKtZLzo9CFF8uIYcmR5XfgdpToyZ4EUko0/JKl7k8EGCYzkee8me8xA7K9+HUWHPh/V22HreY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565710859; 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=rVRvzp884+a66Bk9jhecdKq/vkExTIrwdvJwAMLm9a0=; b=PJ6+SdRVaWUuPL9HfTnCObq/nmVFZClNT1NZXyuBJjt8CFRW4gDpp0YI9wO2hqn6R3I+aTjBCrMMfJcQrOaLXlo/xk8k8vKmEL20QtS6J2RKtzB/EpWhgYhRCLDxKpc3q8S5dTqB3U2mwQMCdGDHrWqYsVjw2ESpLH1ucELQK5M= 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 1565710859785360.14483172062444; Tue, 13 Aug 2019 08:40:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4BE83066FBF; Tue, 13 Aug 2019 15:40:57 +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 19DE0805CD; Tue, 13 Aug 2019 15:40:57 +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 CFF8024F37; Tue, 13 Aug 2019 15:40:56 +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 x7DFetOS010000 for ; Tue, 13 Aug 2019 11:40:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7DBFF83062; Tue, 13 Aug 2019 15:40:55 +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 78DE083060 for ; Tue, 13 Aug 2019 15:40:55 +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 ABB508E589 for ; Tue, 13 Aug 2019 15:40:54 +0000 (UTC) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7DFXYqD093912 for ; Tue, 13 Aug 2019 11:40:54 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ubx5p5wns-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2019 11:40:53 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Aug 2019 16:40:41 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 13 Aug 2019 16:40:39 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7DFeIJK36635102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Aug 2019 15:40:18 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 52760A405B; Tue, 13 Aug 2019 15:40:37 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2227BA4062; Tue, 13 Aug 2019 15:40:37 +0000 (GMT) Received: from localhost.localdomain (unknown [9.152.222.28]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Aug 2019 15:40:37 +0000 (GMT) From: Boris Fiuczynski To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 17:40:30 +0200 In-Reply-To: <20190813154030.11283-1-fiuczy@linux.ibm.com> References: <20190813154030.11283-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19081315-4275-0000-0000-00000358952B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081315-4276-0000-0000-0000386AA53C Message-Id: <20190813154030.11283-7-fiuczy@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-13_05:, , 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-1908130159 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, 13 Aug 2019 15:40:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 13 Aug 2019 15:40:54 +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.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.15 X-loop: libvir-list@redhat.com Cc: jjherne@linux.ibm.com, bwalk@linux.ibm.com, pkrempa@redhat.com, mhartmay@linux.ibm.com Subject: [libvirt] [PATCH v2 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 13 Aug 2019 15:40:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Add support to specify a boot order on vfio-ccw passthrough devices. Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer --- src/qemu/qemu_command.c | 4 +++ src/qemu/qemu_domain.c | 26 ++++++++++++----- .../hostdev-subsys-mdev-vfio-ccw-boot.args | 29 +++++++++++++++++++ .../hostdev-subsys-mdev-vfio-ccw-boot.xml | 23 +++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ .../hostdev-subsys-mdev-vfio-ccw-boot.xml | 28 ++++++++++++++++++ tests/qemuxml2xmltest.c | 4 +++ 7 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boo= t.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.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d32ffed5d6..db004bf095 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5585,6 +5585,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, return ret; } =20 + char * qemuBuildHostdevMediatedDevStr(const virDomainDef *def, virDomainHostdevDefPtr dev, @@ -5614,6 +5615,9 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *de= f, if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0) goto cleanup; =20 + if (dev->info->bootIndex) + virBufferAsprintf(&buf, ",bootindex=3D%u", dev->info->bootIndex); + if (virBufferCheckError(&buf) < 0) goto cleanup; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7331d93868..9ff28bdbf5 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5164,6 +5164,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; @@ -5197,12 +5206,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]; @@ -5278,12 +5296,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.args = b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.args new file mode 100644 index 0000000000..6fb22b3014 --- /dev/null +++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.args @@ -0,0 +1,29 @@ +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-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 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 0000000000..6cca13c33f --- /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 e378df097c..e916c14cf4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1621,6 +1621,10 @@ mymain(void) QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST("hostdev-subsys-mdev-vfio-ccw-boot", + 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); diff --git a/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-boot.xml= b/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-boot.xml new file mode 100644 index 0000000000..ab387a5198 --- /dev/null +++ b/tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-boot.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 6fa9a26b64..6f672184be 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -958,6 +958,10 @@ mymain(void) QEMU_CAPS_CCW, QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); + DO_TEST("hostdev-subsys-mdev-vfio-ccw-boot", + 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, --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list