From nobody Thu Dec 18 03:51:19 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 1520525209348142.9223605971216; Thu, 8 Mar 2018 08:06:49 -0800 (PST) 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 BCDAB62E94; Thu, 8 Mar 2018 16:06: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 946CF5C20D; Thu, 8 Mar 2018 16:06:47 +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 545D2180BAD4; Thu, 8 Mar 2018 16:06:47 +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 w28G6aYu031591 for ; Thu, 8 Mar 2018 11:06:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 97015620AF; Thu, 8 Mar 2018 16:06:36 +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 8B07A620AA for ; Thu, 8 Mar 2018 16:06:32 +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 1633380C28 for ; Thu, 8 Mar 2018 16:06:31 +0000 (UTC) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w28G6TBM144494 for ; Thu, 8 Mar 2018 11:06:30 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gk84d8x34-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 08 Mar 2018 11:06:29 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Mar 2018 11:06:28 -0500 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 8 Mar 2018 11:06:26 -0500 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w28G6PPm43450580; Thu, 8 Mar 2018 16:06:25 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A5682803F; Thu, 8 Mar 2018 11:05:49 -0500 (EST) Received: from alifm-ThinkPad-T470p.ibm.com (unknown [9.85.157.14]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTPS id 0B2462804C; Thu, 8 Mar 2018 11:05:49 -0500 (EST) From: Farhan Ali To: libvir-list@redhat.com Date: Thu, 8 Mar 2018 11:06:22 -0500 In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 x-cbid: 18030816-0048-0000-0000-00000246E9AB X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008635; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01000103; UDB=6.00508677; IPR=6.00779434; MB=3.00019918; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-08 16:06:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030816-0049-0000-0000-0000445FF4D2 Message-Id: <8c66a86dc66e76916430f6469fe66c8d063528e9.1520524234.git.alifm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-08_09:, , 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=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803080185 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.26]); Thu, 08 Mar 2018 16:06:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 08 Mar 2018 16:06:31 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'alifm@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.701 (RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2) 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.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: fiuczy@linux.vnet.ibm.com--dry-run, alifm@linux.vnet.ibm.com Subject: [libvirt] [PATCH v1 5/7] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 08 Mar 2018 16:06:48 +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 introduce capabilities for virtio-{keyboard, mouse, tablet}-ccw devices. Signed-off-by: Farhan Ali Signed-off-by: Boris Fiuczynski --- docs/formatdomain.html.in | 2 ++ src/qemu/qemu_capabilities.c | 8 ++++++++ src/qemu/qemu_capabilities.h | 5 +++++ src/qemu/qemu_command.c | 14 +++++++++++--- tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 3 +++ 5 files changed, 29 insertions(+), 3 deletions(-) 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_capabilities.c b/src/qemu/qemu_capabilities.c index 9db4c31..14564e8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -460,6 +460,11 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "machine.pseries.max-cpu-compat", "dump-completed", "virtio-gpu-ccw", + "virtio-keyboard-ccw", + + /* 285 */ + "virtio-mouse-ccw", + "virtio-tablet-ccw", ); =20 =20 @@ -1696,6 +1701,9 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL }, { "pl011", QEMU_CAPS_DEVICE_PL011 }, { "virtio-gpu-ccw", QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW }, + { "virtio-keyboard-ccw", QEMU_CAPS_DEVICE_VIRTIO_KEYBOARD_CCW }, + { "virtio-mouse-ccw", QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW }, + { "virtio-tablet-ccw", QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[]= =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index b4852e5..3f3c29f 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -445,6 +445,11 @@ typedef enum { QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-= compat=3D */ QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */ QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW, /* -device virtio-gpu-ccw */ + QEMU_CAPS_DEVICE_VIRTIO_KEYBOARD_CCW, /* -device virtio-keyboard-ccw */ + + /* 285 */ + QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW, /* -device virtio-mouse-ccw */ + QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW, /* -device virtio-tablet-ccw */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ba63670..5477e14 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3921,6 +3921,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 { @@ -3932,7 +3934,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; @@ -3940,7 +3944,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; @@ -3948,7 +3954,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/qemucapabilitiesdata/caps_2.11.0.s390x.xml b/tests/qemuc= apabilitiesdata/caps_2.11.0.s390x.xml index ec5c396..fda5c36 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml @@ -147,6 +147,9 @@ + + + 2011000 0 342885 --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list