From patchwork Fri May 20 00:07:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 68207 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3482416qge; Thu, 19 May 2016 17:10:34 -0700 (PDT) X-Received: by 10.28.216.78 with SMTP id p75mr462901wmg.66.1463703034032; Thu, 19 May 2016 17:10:34 -0700 (PDT) Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com. [209.132.183.37]) by mx.google.com with ESMTPS id oy8si21713678wjb.30.2016.05.19.17.10.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 17:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4K07lY8054893; Thu, 19 May 2016 20:07:47 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u4K07hxO019640 for ; Thu, 19 May 2016 20:07:43 -0400 Received: from colepc.redhat.com (ovpn-116-14.phx2.redhat.com [10.3.116.14]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4K07g0Q019223; Thu, 19 May 2016 20:07:43 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 19 May 2016 20:07:39 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: command: Error on accel3d with non-virtio 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com We should be raising an error if accel3d is present for any non-virtio video as well, incase someone hand edits incorrect XML --- src/qemu/qemu_command.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) -- 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4a2fa1d..731f4c0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4125,18 +4125,20 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias); - if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { - if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("virtio-gpu 3d acceleration is not supported")); - goto error; - } - - virBufferAsprintf(&buf, ",virgl=%s", - virTristateSwitchTypeToString(video->accel->accel3d)); + if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) { + if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("%s 3d acceleration is not supported"), + virDomainVideoTypeToString(video->type)); + goto error; } - } else if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + + virBufferAsprintf(&buf, ",virgl=%s", + virTristateSwitchTypeToString(video->accel->accel3d)); + } + + if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { if (video->vram > (UINT_MAX / 1024)) { virReportError(VIR_ERR_OVERFLOW, _("value for 'vram' must be less than '%u'"),