From patchwork Fri Aug 23 16:21:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 172119 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp886160ily; Fri, 23 Aug 2019 09:22:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRyzL4z9cjGXMHX/sf0X2POfYonPsBN42yA64U6ex8j7evU1pVO8UuegdeTMaXFarXUTOs X-Received: by 2002:a37:9802:: with SMTP id a2mr4948373qke.346.1566577355895; Fri, 23 Aug 2019 09:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566577355; cv=none; d=google.com; s=arc-20160816; b=IGP9kkVTTqjAkZewXi3Ds5ui+rEgC+OuTXq6WQP4omQqrSVAXmw/ZdJo0+FQwTMbh5 N3z1vSarrKJdlnm/KZoYzGaGLQk/D2R0AGMW++bGw1ew0lu0/bYkDLqNafRjpQc+nl7C 9/rTpc1vd995Dvg/W+4voYB6Ct8AsEb+7ywWVikqbZRBX1r9Y4CTV2lSE7/ARQqotrQA ymjCAzY5Ef5yd2VAXLRUUORGYZTu/YSEITk9bILeTJz8AUA1f2RE7zuL4UqwYfBdJXbq cJTf4JZHHEZYwuk/YmH7tViJVHEktKfk7bC2BZedgW+7DcYu6VVZlnrzU3u8g/n/kDbz GmIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=2djRaFfMhbkMmqYV32xS5dyMrC2v0LIsrbV1xRX88Ys=; b=KDjvOsQg/W/E13asoG3BPP3KnjrB5hlomxEGcWJ6t+wlGXv9dVff9HWdbuGYdIptq3 psrCKjcGr6iUtJ9mK5OWyh9N4udQoIJbHlDiCXTYxxZkWG9fjzWfdbbgj/AyvRyaP7/b HgBUFXVQH+olzuTYWqhucypyYtaZosNu1Xa/GQehP8gEt69Tnf3VaR38bAT9S7rZHtv+ VnXc5oZI6k9Xx0y8NUyWwnbvQx9ZKSNibXXcVZ3G7AGoJN96uBUQRncMjMR3Ms4J6BwQ JjV/T7kYOqDZdxZXRAw9WxzeMkm1KqVs+rIuIuLvcQoq7oV4m/vFdBdETcnckm4NECgI Xo7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id h23si2137730qkk.212.2019.08.23.09.22.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Aug 2019 09:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 8A6A210C030C; Fri, 23 Aug 2019 16:22:34 +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 5F84DBA8A; Fri, 23 Aug 2019 16:22:34 +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 19700180BA99; Fri, 23 Aug 2019 16:22:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7NGM8HZ006022 for ; Fri, 23 Aug 2019 12:22:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 33E8260605; Fri, 23 Aug 2019 16:22:08 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-122-169.rdu2.redhat.com [10.10.122.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3C186092D; Fri, 23 Aug 2019 16:22:07 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 23 Aug 2019 12:21:51 -0400 Message-Id: <96949c1e9b5df8c986a9b36f640dd3dec8dcb0c9.1566576129.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [libvirt] [PATCH v2 07/16] qemu: validate virtio-gpu with vhost-user 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: , 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.6.2 (mx1.redhat.com [10.5.110.65]); Fri, 23 Aug 2019 16:22:35 +0000 (UTC) From: Marc-André Lureau Check qemu capability, and accept 3d acceleration. 3d acceleration support is checked when looking for a suitable vhost-user helper. Signed-off-by: Marc-André Lureau Signed-off-by: Cole Robinson --- src/qemu/qemu_process.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c9921646e9..c439f17011 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5274,8 +5274,10 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm, !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) || - (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && !video->vhostuser && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && video->vhostuser && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_USER_GPU)) || (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW))) { @@ -5285,7 +5287,15 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm, return -1; } - if (video->accel) { + if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + video->vhostuser && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_USER_GPU)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this QEMU does not support vhost-user backed video device")); + return -1; + } + + if (!video->vhostuser && video->accel) { if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON && (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL))) {