From nobody Wed May 14 17:25:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152182578635381.61601774663916; Fri, 23 Mar 2018 10:23:06 -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 DC4B6C0587E4; Fri, 23 Mar 2018 17:23: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 B10531692A; Fri, 23 Mar 2018 17:23: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 5F553180BAD4; Fri, 23 Mar 2018 17:23:04 +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 w2NHN1qQ013609 for ; Fri, 23 Mar 2018 13:23:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8DB6817569; Fri, 23 Mar 2018 17:23:01 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 827BB17B64 for ; Fri, 23 Mar 2018 17:22:59 +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 B70E323E6D1 for ; Fri, 23 Mar 2018 17:22:57 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2NHK5PU041175 for ; Fri, 23 Mar 2018 13:22:57 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gw3jr5j8h-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 23 Mar 2018 13:22:56 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 23 Mar 2018 11:22:56 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 23 Mar 2018 11:22:53 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2NHMr9o10027434; Fri, 23 Mar 2018 10:22:53 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04D8FBE03A; Fri, 23 Mar 2018 11:22:53 -0600 (MDT) Received: from alifm-ThinkPad-T470p.pok.ibm.com (unknown [9.56.58.48]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTPS id 56034BE03E; Fri, 23 Mar 2018 11:22:52 -0600 (MDT) From: Farhan Ali To: libvir-list@redhat.com Date: Fri, 23 Mar 2018 13:22:42 -0400 In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 x-cbid: 18032317-0028-0000-0000-000009578547 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008730; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01007315; UDB=6.00512952; IPR=6.00786603; MB=3.00020202; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-23 17:22:55 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032317-0029-0000-0000-00003A15A587 Message-Id: <72153d441d4f5972019df9de2166d6004a2ab9ef.1521819720.git.alifm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-23_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=15 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803230197 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 23 Mar 2018 17:22:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 23 Mar 2018 17:22:57 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'alifm@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.72 (RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL) 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.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: alifm@linux.vnet.ibm.com, jtomko@redhat.com Subject: [libvirt] [PATCH v3 5/6] qemu: Add support for virtio input ccw 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.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.32]); Fri, 23 Mar 2018 17:23:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" QEMU on S390 (since v2.11) can support virtio input ccw devices. So build the qemu command line for ccw devices. Also add test cases for virtio-{keyboard, mouse, tablet}-ccw. Signed-off-by: Farhan Ali Signed-off-by: Boris Fiuczynski --- docs/formatdomain.html.in | 2 ++ src/qemu/qemu_command.c | 14 +++++++--- tests/qemuxml2argvdata/input-virtio-ccw.args | 26 +++++++++++++++++++ tests/qemuxml2argvdata/input-virtio-ccw.xml | 29 +++++++++++++++++++++ tests/qemuxml2argvtest.c | 8 ++++++ tests/qemuxml2xmloutdata/input-virtio-ccw.xml | 37 +++++++++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 8 ++++++ 7 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/input-virtio-ccw.args create mode 100644 tests/qemuxml2argvdata/input-virtio-ccw.xml create mode 100644 tests/qemuxml2xmloutdata/input-virtio-ccw.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0908709..08dc74b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6048,6 +6048,8 @@ qemu-kvm -net nic,model=3D? /dev/null sub-element <address> which can tie the device to a particular PCI slot, documented above. + On S390, address can be used to provide a CCW address f= or + an input device (since 4.2.0). =20 For type passthrough, the mandatory sub-element s= ource must have an evdev attribute containing the absolute pa= th to the diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 5882637..c95d5eb 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3955,6 +3955,8 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def, =20 if (dev->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { suffix =3D "-pci"; + } else if (dev->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { + suffix =3D "-ccw"; } else if (dev->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO= _MMIO) { suffix =3D "-device"; } else { @@ -3966,7 +3968,9 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def, =20 switch ((virDomainInputType) dev->type) { case VIR_DOMAIN_INPUT_TYPE_MOUSE: - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_MOUSE)) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_MOUSE) || + (dev->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW))= ) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtio-mouse is not supported by this QEMU b= inary")); goto error; @@ -3974,7 +3978,9 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def, virBufferAsprintf(&buf, "virtio-mouse%s,id=3D%s", suffix, dev->inf= o.alias); break; case VIR_DOMAIN_INPUT_TYPE_TABLET: - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_TABLET)) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_TABLET) || + (dev->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW)= )) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtio-tablet is not supported by this QEMU = binary")); goto error; @@ -3982,7 +3988,9 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def, virBufferAsprintf(&buf, "virtio-tablet%s,id=3D%s", suffix, dev->in= fo.alias); break; case VIR_DOMAIN_INPUT_TYPE_KBD: - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_KEYBOARD)) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_KEYBOARD) || + (dev->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_KEYBOARD_CC= W))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtio-keyboard is not supported by this QEM= U binary")); goto error; diff --git a/tests/qemuxml2argvdata/input-virtio-ccw.args b/tests/qemuxml2a= rgvdata/input-virtio-ccw.args new file mode 100644 index 0000000..6ee318c --- /dev/null +++ b/tests/qemuxml2argvdata/input-virtio-ccw.args @@ -0,0 +1,26 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name QEMUGuest1 \ +-S \ +-M s390-ccw-virtio \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1803 \ +-nographic \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-vir= tio-disk0 \ +-device virtio-blk-ccw,devno=3Dfe.0.0000,drive=3Ddrive-virtio-disk0,\ +id=3Dvirtio-disk0 \ +-device virtio-keyboard-ccw,id=3Dinput0,devno=3Dfe.0.0002 \ +-device virtio-mouse-ccw,id=3Dinput1,devno=3Dfe.0.0003 \ +-device virtio-tablet-ccw,id=3Dinput2,devno=3Dfe.0.0004 \ +-device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0001 diff --git a/tests/qemuxml2argvdata/input-virtio-ccw.xml b/tests/qemuxml2ar= gvdata/input-virtio-ccw.xml new file mode 100644 index 0000000..a971662 --- /dev/null +++ b/tests/qemuxml2argvdata/input-virtio-ccw.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1803 + 219136 + 219136 + 1 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d9ae3ee..728854c 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3014,6 +3014,14 @@ mymain(void) QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW); =20 + DO_TEST("input-virtio-ccw", QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_KEYBOARD, + QEMU_CAPS_VIRTIO_MOUSE, + QEMU_CAPS_VIRTIO_TABLET, + QEMU_CAPS_DEVICE_VIRTIO_KEYBOARD_CCW, + QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW, + QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW); + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20 diff --git a/tests/qemuxml2xmloutdata/input-virtio-ccw.xml b/tests/qemuxml2= xmloutdata/input-virtio-ccw.xml new file mode 100644 index 0000000..20aed31 --- /dev/null +++ b/tests/qemuxml2xmloutdata/input-virtio-ccw.xml @@ -0,0 +1,37 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1803 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + + + +
+ + +
+ + +
+ + +
+ + +
+ + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5b014ca..0f56029 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1230,6 +1230,14 @@ mymain(void) QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); =20 DO_TEST("user-aliases", NONE); + DO_TEST("input-virtio-ccw", + QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_KEYBOARD, + QEMU_CAPS_VIRTIO_MOUSE, + QEMU_CAPS_VIRTIO_TABLET, + QEMU_CAPS_DEVICE_VIRTIO_KEYBOARD_CCW, + QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW, + QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW); =20 /* Test disks with format probing enabled for legacy reasons. * New tests should not go in this section. */ --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list