From nobody Wed May 14 07:18:51 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1527687807111950.4690239107767; Wed, 30 May 2018 06:43:27 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D8A83174652; Wed, 30 May 2018 13:43:25 +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 39B9090CF9; Wed, 30 May 2018 13:43:25 +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 D86D74CA88; Wed, 30 May 2018 13:43:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4UDhCYG006603 for ; Wed, 30 May 2018 09:43:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5CCBF10EE6C4; Wed, 30 May 2018 13:43:12 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id D68EF10EE6C1; Wed, 30 May 2018 13:43:11 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Wed, 30 May 2018 15:42:57 +0200 Message-Id: <1a9b3eb5c80983d7a11fbf2461707accfad493f5.1527685754.git.eskultet@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [RFC PATCH 3/7] conf: Introduce virDomainDefHasSpiceGL helper 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 30 May 2018 13:43:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This helper will later help us to make corresponding changes when building QEMU cmdline, depending on what implementation of vfio-pci display should be used - dmabuf (requires OpenGL) vs vfio region mapping (doesn't need OpenGL). Signed-off-by: Erik Skultety Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 24 ++++++++++++++++++++++++ src/conf/domain_conf.h | 3 +++ src/libvirt_private.syms | 1 + 3 files changed, 28 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 62bd17739c..c868d8de08 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -29927,3 +29927,27 @@ virDomainDefHasManagedPR(const virDomainDef *def) =20 return false; } + + +/** + * virDomainDefHasSpiceGL: + * @def: domain definition + * + * Returns true if we have a SPICE graphic frame buffer with OpenGL enable= d, + * false otherwise + */ +bool +virDomainDefHasSpiceGL(const virDomainDef *def) +{ + size_t i; + + for (i =3D 0; i < def->ngraphics; i++) { + virDomainGraphicsDefPtr gfx =3D def->graphics[i]; + + if (gfx->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_SPICE && + gfx->data.spice.gl =3D=3D VIR_TRISTATE_BOOL_YES) + return true; + } + + return false; +} diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 6cc8f8a29b..8493dfdd76 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3592,4 +3592,7 @@ virDomainDiskGetDetectZeroesMode(virDomainDiskDiscard= discard, bool virDomainDefHasManagedPR(const virDomainDef *def); =20 +bool +virDomainDefHasSpiceGL(const virDomainDef *def); + #endif /* __DOMAIN_CONF_H */ diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6001635916..b18f2fd5ea 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -278,6 +278,7 @@ virDomainDefHasDeviceAddress; virDomainDefHasManagedPR; virDomainDefHasMemballoon; virDomainDefHasMemoryHotplug; +virDomainDefHasSpiceGL; virDomainDefHasUSB; virDomainDefHasVcpusOffline; virDomainDefLifecycleActionAllowed; --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list