From nobody Wed May 14 13:30:29 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 1521825788006854.001658575896; Fri, 23 Mar 2018 10:23:08 -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 77FBD80083; Fri, 23 Mar 2018 17:23:06 +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 50FED9D986; Fri, 23 Mar 2018 17:23:06 +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 1BC944CA9B; Fri, 23 Mar 2018 17:23:06 +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 w2NHMsRx013559 for ; Fri, 23 Mar 2018 13:22:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3F7D8F6C3; Fri, 23 Mar 2018 17:22:54 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DD965D9D6 for ; Fri, 23 Mar 2018 17:22:52 +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 60211C04FF86 for ; Fri, 23 Mar 2018 17:22:51 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2NHK6Gg018139 for ; Fri, 23 Mar 2018 13:22:50 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gw25y2n24-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 23 Mar 2018 13:22:50 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 23 Mar 2018 11:22:49 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 23 Mar 2018 11:22:48 -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 w2NHMmMl12911050; Fri, 23 Mar 2018 10:22:48 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3C87BE03A; Fri, 23 Mar 2018 11:22:47 -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 526DCBE038; Fri, 23 Mar 2018 11:22:47 -0600 (MDT) From: Farhan Ali To: libvir-list@redhat.com Date: Fri, 23 Mar 2018 13:22:39 -0400 In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 x-cbid: 18032317-0008-0000-0000-0000097F8228 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:49 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032317-0009-0000-0000-0000468317E4 Message-Id: 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.31]); Fri, 23 Mar 2018 17:22:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 23 Mar 2018 17:22:51 +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.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: alifm@linux.vnet.ibm.com, jtomko@redhat.com Subject: [libvirt] [PATCH v3 2/6] qemu: Add support for virtio-gpu-ccw video device on S390 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.28]); Fri, 23 Mar 2018 17:23:06 +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 the virtio-gpu-ccw device, which can be used as a video device. Signed-off-by: Farhan Ali --- docs/formatdomain.html.in | 3 +++ src/qemu/qemu_command.c | 13 ++++++++++-- src/qemu/qemu_domain_address.c | 12 ++++++++++-- src/qemu/qemu_process.c | 5 ++++- tests/qemuxml2argvdata/video-virtio-gpu-ccw.args | 25 ++++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 7 +++++++ 6 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxml2argvdata/video-virtio-gpu-ccw.args diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6fd2189..0908709 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6484,6 +6484,9 @@ qemu-kvm -net nic,model=3D? /dev/null
The optional address sub-element can be used to tie the video device to a particular PCI slot. + On S390, address can be used to provide the + CCW address for the video device ( + since 4.2.0).
=20
driver
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a8afbd1..5882637 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -132,7 +132,7 @@ VIR_ENUM_IMPL(qemuDeviceVideoSecondary, VIR_DOMAIN_VIDE= O_TYPE_LAST, "", /* don't support vbox */ "qxl", "", /* don't support parallels */ - "virtio-gpu-pci", + "virtio-gpu", "" /* don't support gop */); =20 VIR_ENUM_DECL(qemuSoundCodec) @@ -4296,7 +4296,16 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, goto error; } =20 - virBufferAsprintf(&buf, "%s,id=3D%s", model, video->info.alias); + if (STREQ(model, "virtio-gpu")) { + if (video->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) + virBufferAsprintf(&buf, "%s-ccw", model); + else + virBufferAsprintf(&buf, "%s-pci", model); + } else { + virBufferAsprintf(&buf, "%s", model); + } + + virBufferAsprintf(&buf, ",id=3D%s", video->info.alias); =20 if (video->accel && video->accel->accel3d =3D=3D VIR_TRISTATE_SWITCH_O= N) { virBufferAsprintf(&buf, ",virgl=3D%s", diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 2551706..37473eb 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -287,8 +287,8 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr de= f, { /* declare address-less virtio devices to be of address type 'type' - disks, networks, consoles, controllers, memballoon and rng in this - order + disks, networks, videos, consoles, controllers, memballoon and rng + in this order if type is ccw filesystem devices are declared to be of address typ= e ccw */ size_t i; @@ -308,6 +308,14 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr d= ef, } } =20 + for (i =3D 0; i < def->nvideos; i++) { + virDomainVideoDefPtr video =3D def->videos[i]; + + if (video->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO) + video->info.type =3D type; + } + for (i =3D 0; i < def->ninputs; i++) { if (def->inputs[i]->bus =3D=3D VIR_DOMAIN_INPUT_BUS_VIRTIO && def->inputs[i]->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYP= E_NONE) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 57c06c7..1afb71f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4778,7 +4778,10 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm, (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_QXL && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))) { + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) || + (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + video->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("this QEMU does not support '%s' video device= "), virDomainVideoTypeToString(video->type)); diff --git a/tests/qemuxml2argvdata/video-virtio-gpu-ccw.args b/tests/qemux= ml2argvdata/video-virtio-gpu-ccw.args new file mode 100644 index 0000000..e5e8854 --- /dev/null +++ b/tests/qemuxml2argvdata/video-virtio-gpu-ccw.args @@ -0,0 +1,25 @@ +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 \ +-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 \ +-vnc 127.0.0.1:0 \ +-device virtio-gpu-ccw,id=3Dvideo0,max_outputs=3D1,devno=3Dfe.0.0002 \ +-device virtio-gpu-ccw,id=3Dvideo1,max_outputs=3D1,devno=3Dfe.0.0003 \ +-device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0001 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5ece3f0..d9ae3ee 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3007,6 +3007,13 @@ mymain(void) DO_TEST("disk-many-format-probing", QEMU_CAPS_DRIVE_BOOT); driver.config->allowDiskFormatProbing =3D false; =20 + DO_TEST("video-virtio-gpu-ccw", QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, + QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS, + QEMU_CAPS_VNC, + QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW); + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20 --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list