From patchwork Wed Jun 22 19:53:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 70694 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp81262qgy; Wed, 22 Jun 2016 12:56:35 -0700 (PDT) X-Received: by 10.28.173.8 with SMTP id w8mr9935933wme.39.1466625395448; Wed, 22 Jun 2016 12:56:35 -0700 (PDT) Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id wp4si1374911wjb.173.2016.06.22.12.56.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 12:56:35 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 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 mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5MJrv9i024372; Wed, 22 Jun 2016 15:53:58 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u5MJruKE007674 for ; Wed, 22 Jun 2016 15:53:56 -0400 Received: from colepc.redhat.com (ovpn-116-65.rdu2.redhat.com [10.10.116.65]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5MJrtXu012628; Wed, 22 Jun 2016 15:53:56 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 22 Jun 2016 15:53:49 -0400 Message-Id: <70c6a9041048428c91a71078402adf6991acbb40.1466625043.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH RESEND 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 tries it for say 'qxl' --- 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 6944129..f3c26f9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4066,18 +4066,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'"),