From nobody Tue Feb 10 04:14:29 2026 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 ARC-Seal: i=1; a=rsa-sha256; t=1568379104; cv=none; d=zoho.com; s=zohoarc; b=MScpRaBdXuB5bHhgdeXHcXs12or/ZOCuOjqbEawYWq312ouXrYzgbzUqSS1StpOBOBM3cXQNLGOpK7PzkDGeVycn9fJsY50ajyJ5iKM/M62sosv0GCo8iKgr+1VJXXoVYYh0ewSZw+qhSbrPNMmG893ZBaIv9zgaUSQrm5kSGBk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568379104; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vogsa5O2JU0sw1rvX95pF+hlj690iUvVhOFTiZbgXas=; b=B5KBRX//BaEyucQc8aykYYD5E71ggk/xb586KqLHtovlUclZHHT7oI8oM19J10uaW5/thWktMk6rPlCM1XQc+Sr1QAQgWTDBuFRd0LxodEWv+O+xiOMOTVWAYw7ixkKst2pZKaa3X5T3E9bNFPKd/VWbLdjBHa8XCSZv6ERdm58= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568379104619301.61914651726215; Fri, 13 Sep 2019 05:51:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F341910576CB; Fri, 13 Sep 2019 12:51:42 +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 C679860A9F; Fri, 13 Sep 2019 12:51:42 +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 85045180B536; Fri, 13 Sep 2019 12:51:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8DCpecc028030 for ; Fri, 13 Sep 2019 08:51:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id D8366410E; Fri, 13 Sep 2019 12:51:40 +0000 (UTC) Received: from localhost (ovpn-112-45.ams2.redhat.com [10.36.112.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 326A6194B9; Fri, 13 Sep 2019 12:51:34 +0000 (UTC) From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Date: Fri, 13 Sep 2019 16:50:41 +0400 Message-Id: <20190913125057.29333-5-marcandre.lureau@redhat.com> In-Reply-To: <20190913125057.29333-1-marcandre.lureau@redhat.com> References: <20190913125057.29333-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , jtomko@redhat.com Subject: [libvirt] [PATCH v4 04/20] domain: add rendernode attribute on 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Fri, 13 Sep 2019 12:51:43 +0000 (UTC) From: Marc-Andr=C3=A9 Lureau vhost-user-gpu helper takes --render-node option to specify on which GPU should the renderning be done. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: J=C3=A1n Tomko --- docs/formatdomain.html.in | 6 ++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 17 ++++++++++++++++- src/conf/domain_conf.h | 1 + tests/qemuxml2argvdata/virtio-options.xml | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 60a47c812b..93991aa3d1 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -7082,6 +7082,12 @@ qemu-kvm -net nic,model=3D? /dev/null
Enable 3D acceleration (for vbox driver since 0.7.1, qemu driver since 1.3.0)
+ +
rendernode
+
Absolute path to a host's DRI device to be used for + rendering (for 'vhostuser' driver only, since 5.8.0). If none is specified, + libvirt will pick one available.
=20 diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 7006d9f508..40eb4a2d75 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3648,6 +3648,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6f81af2d4c..15fb8dea17 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2840,6 +2840,8 @@ virDomainVideoDefClear(virDomainVideoDefPtr def) =20 virDomainDeviceInfoClear(&def->info); =20 + if (def->accel) + VIR_FREE(def->accel->rendernode); VIR_FREE(def->accel); VIR_FREE(def->virtio); VIR_FREE(def->driver); @@ -6279,6 +6281,11 @@ virDomainVideoDefValidate(const virDomainVideoDef *v= ideo, break; case VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT: case VIR_DOMAIN_VIDEO_BACKEND_TYPE_QEMU: + if (video->accel && video->accel->rendernode) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("unsupported rendernode accel attribute witho= ut 'vhostuser'")); + return -1; + } break; case VIR_DOMAIN_VIDEO_BACKEND_TYPE_LAST: default: @@ -15341,6 +15348,7 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) int val; VIR_AUTOFREE(char *) accel2d =3D NULL; VIR_AUTOFREE(char *) accel3d =3D NULL; + VIR_AUTOFREE(char *) rendernode =3D NULL; =20 cur =3D node->children; while (cur !=3D NULL) { @@ -15349,12 +15357,13 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) virXMLNodeNameEqual(cur, "acceleration")) { accel3d =3D virXMLPropString(cur, "accel3d"); accel2d =3D virXMLPropString(cur, "accel2d"); + rendernode =3D virXMLPropString(cur, "rendernode"); } } cur =3D cur->next; } =20 - if (!accel3d && !accel2d) + if (!accel3d && !accel2d && !rendernode) return NULL; =20 if (VIR_ALLOC(def) < 0) @@ -15378,6 +15387,8 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) def->accel2d =3D val; } =20 + VIR_STEAL_PTR(def->rendernode, rendernode); + cleanup: return def; } @@ -26535,6 +26546,10 @@ virDomainVideoAccelDefFormat(virBufferPtr buf, virBufferAsprintf(buf, " accel2d=3D'%s'", virTristateBoolTypeToString(def->accel2d)); } + if (def->rendernode) { + virBufferAsprintf(buf, " rendernode=3D'%s'", + def->rendernode); + } virBufferAddLit(buf, "/>\n"); } =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7d60f3054c..16dacd4b43 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1417,6 +1417,7 @@ VIR_ENUM_DECL(virDomainVideoVGAConf); struct _virDomainVideoAccelDef { int accel2d; /* enum virTristateBool */ int accel3d; /* enum virTristateBool */ + char *rendernode; }; =20 =20 diff --git a/tests/qemuxml2argvdata/virtio-options.xml b/tests/qemuxml2argv= data/virtio-options.xml index bdfadca22d..dd9a4f4a01 100644 --- a/tests/qemuxml2argvdata/virtio-options.xml +++ b/tests/qemuxml2argvdata/virtio-options.xml @@ -75,7 +75,7 @@