From nobody Sun May 5 15:56:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665735544; cv=none; d=zohomail.com; s=zohoarc; b=a+2UB/UiO7mHmdgx9KAj/bepXs3LcKh+JVNnMW4giXz5IP5oCUTSesvhbchRo8p12L05lLeQXGeZlYhsYDfW1bXeWUUjdc9LbmlLee9cUrlxdIRqmY/VqAT+xMyWLaX2GGKiWZnMKfh4XS4sGmvw3SIq8jgx8ykLFfFRQV0htnM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665735544; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=XMUckZvDWBJmOmdWcc+dam2OqZvmXcWfFWXRDtHWTDI=; b=m2JvnrMwt9bAKG1rolGy6H1POWpYUoXO75EK9l9fxXWKsai36w6wa5IQ/24HB3uIhKr6EdEOpkwUU9aPwo8iaTWFeoub8bHIdniAUTmefbHz7azI3ahftHcmJHubkkSCuMsOBjW8RXvp9In4l4fijeRMZFYQKCtJPODbRAI+mJI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1665735544422625.5290719895299; Fri, 14 Oct 2022 01:19:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-581-KYHRkoqHPNGG3Vn-RrPfXw-1; Fri, 14 Oct 2022 04:18:59 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 245BC2A2AD4C; Fri, 14 Oct 2022 08:18:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FAC640F16A; Fri, 14 Oct 2022 08:18:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1598B1946588; Fri, 14 Oct 2022 08:18:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 349231946587 for ; Fri, 14 Oct 2022 08:18:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A99D540398B1; Fri, 14 Oct 2022 08:18:07 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-39.brq.redhat.com [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C24F40398BD for ; Fri, 14 Oct 2022 08:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665735542; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XMUckZvDWBJmOmdWcc+dam2OqZvmXcWfFWXRDtHWTDI=; b=M5iiTf8tDHke+eqtdLmZrPVmgNDXV/su4unDfARmYV9DxbARKYkCdSP0lMJi1LpY4Oh3JN kyhi+Sc9lXdql1SmZJEzbJQ6oFgxpuQ+I9Gbc3WYdsgWViES8r17OCFwbplPaHTYkYLYFx nG1IacPrNm1D991B9SSAoLJoiOV4R1k= X-MC-Unique: KYHRkoqHPNGG3Vn-RrPfXw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: validate: Clarify error messages for unsupported 3d video acceleration Date: Fri, 14 Oct 2022 10:18:04 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665735545304100001 Content-Type: text/plain; charset="utf-8" The error message doesn't really convey the information that 3d acceleration works only for the 'virtio' model and similarly the same error would be reported if qemu doesn't support acceleration, which is hard to debug. Split and clarify the errors. Noticed in https://gitlab.com/libvirt/libvirt/-/issues/388 Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_validate.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index cb4e32c0ff..079009ea4b 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2765,15 +2765,20 @@ qemuValidateDomainDeviceDefVideo(const virDomainVid= eoDef *video, return -1; } } else if (video->accel) { - if (video->accel->accel3d =3D=3D VIR_TRISTATE_BOOL_YES && - (video->type !=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO || - !(virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) || - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) || - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL)))) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("%s 3d acceleration is not supported"), - virDomainVideoTypeToString(video->type)); - return -1; + if (video->accel->accel3d =3D=3D VIR_TRISTATE_BOOL_YES) { + if (video->type !=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("3d acceleration is supported only with '= virtio' video device")); + return -1; + } + + if (!(virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("3d acceleration is not supported by this= QEMU binary")); + return -1; + } } } --=20 2.37.3