From patchwork Fri Aug 23 16:21:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 172114 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp885976ily; Fri, 23 Aug 2019 09:22:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3oBBM4hcDvd7rCjWBHdc5nP02rGEUusuaFX573zQdy8v7+RvknFiD2M9wquxjv8a3KsjH X-Received: by 2002:aed:2e24:: with SMTP id j33mr5658729qtd.179.1566577347099; Fri, 23 Aug 2019 09:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566577347; cv=none; d=google.com; s=arc-20160816; b=cSoavWayk02cLqLjzWENyWgx82XCvd8Y57OA+qh9hk/OfD/mzbyZAHO61Yx5KkRnJz alSFqSZViQK7eIX7GnwSk9YcUqmNNuwOeVRvsQmMdjGrYyfzu+AV6AndPFeI1eZaCQbr ZkrB+ikd7BRGPNpyDBYei4skW9nwTQOAi0DDwSc/g8Ii8obkxtisuymt9Pdhev/ZObZG PKAB9o3PvRa1hEMDd6LoBusV0RjVxaeE/6GAyHp+5ZSIHLAqA+VojLqMvZdaYbh9OJqN P4dHDXrXVKjcT5yEy/uJMf+Zz4T3i5uz7FUjArwO467tWZmUPdvR5QfrVqJ7kMbrDQLL vm0w== 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=UHRQzObOpVvU0jfgn71csAfJ83VE4aCGzVCZC2cdleI=; b=iFsokf7XnmKKdLhOWrHX2z3+g9pnUY4lWhzYjauusyI8lAhQg39zzhpRtey9IQyQeR EwmY9I5LxoGWzftV5/VAg8fLW3/Wa/f16ep0sOxdmB9CrVjwNtA+hNqLt4dbDGbZ5Y4l ++VuzZR/b1N9xnCOp9+zlMDhVGSoQkW7FzJlSMSzW8FF9/TfeYhiMTGd7tF9X2sxvTxS IwOfsDwvb4QFlf6UB6+RkqDSg8+pr3v4i8VCsu0+sI0P3bcE7+h3YFghcHrq8+rmhS2w qhBGzjhi4XH6wOp49A4CDGQBWTf/JBMaa4llqOZ6OiZ0j4Dc6Rs8uuhly9+Ufr86ms1c kipg== 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 b37si2390950qtb.269.2019.08.23.09.22.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Aug 2019 09:22:27 -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-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D61FC3CA16; Fri, 23 Aug 2019 16:22:25 +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 B56465D784; Fri, 23 Aug 2019 16:22: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 790531802220; Fri, 23 Aug 2019 16:22:25 +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 x7NGM5tc005992 for ; Fri, 23 Aug 2019 12:22:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3A7760605; Fri, 23 Aug 2019 16:22:05 +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 3045160872; Fri, 23 Aug 2019 16:22:05 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 23 Aug 2019 12:21:47 -0400 Message-Id: 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 03/16] 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 23 Aug 2019 16:22:26 +0000 (UTC) From: Marc-André Lureau vhost-user-gpu helper may accept --render-node option to specify on which GPU should the renderning be done. (by comparison rendernode is the target/display rendering) Signed-off-by: Marc-André Lureau Signed-off-by: Cole Robinson --- docs/formatdomain.html.in | 5 +++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 18 +++++++++++++++++- src/conf/domain_conf.h | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index ec650fbe17..5a4807d937 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -7059,6 +7059,11 @@ qemu-kvm -net nic,model=? /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 vhost-user driver only, since 5.5.0)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index bac566855d..6e91fe6cef 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3644,6 +3644,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f51575d57d..2cc055491d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2832,6 +2832,8 @@ virDomainVideoDefClear(virDomainVideoDefPtr def) virDomainDeviceInfoClear(&def->info); + if (def->accel) + VIR_FREE(def->accel->rendernode); VIR_FREE(def->accel); VIR_FREE(def->virtio); VIR_FREE(def->driver); @@ -15270,6 +15272,7 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) int val; VIR_AUTOFREE(char *) accel2d = NULL; VIR_AUTOFREE(char *) accel3d = NULL; + VIR_AUTOFREE(char *) rendernode = NULL; cur = node->children; while (cur != NULL) { @@ -15278,12 +15281,13 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) virXMLNodeNameEqual(cur, "acceleration")) { accel3d = virXMLPropString(cur, "accel3d"); accel2d = virXMLPropString(cur, "accel2d"); + rendernode = virXMLPropString(cur, "rendernode"); } } cur = cur->next; } - if (!accel3d && !accel2d) + if (!accel3d && !accel2d && !rendernode) return NULL; if (VIR_ALLOC(def) < 0) @@ -15307,6 +15311,9 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) def->accel2d = val; } + if (VIR_STRDUP(def->rendernode, rendernode) < 0) + goto cleanup; + cleanup: return def; } @@ -15474,6 +15481,11 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt, goto error; } } + if (!def->vhostuser && def->accel && def->accel->rendernode) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unsupported rendernode accel attribute without 'vhost-user'")); + goto error; + } if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0) goto error; @@ -26452,6 +26464,10 @@ virDomainVideoAccelDefFormat(virBufferPtr buf, virBufferAsprintf(buf, " accel2d='%s'", virTristateBoolTypeToString(def->accel2d)); } + if (def->rendernode) { + virBufferAsprintf(buf, " rendernode='%s'", + def->rendernode); + } virBufferAddLit(buf, "/>\n"); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index bc2450f25e..707fbd1cd3 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1405,6 +1405,7 @@ VIR_ENUM_DECL(virDomainVideoVGAConf); struct _virDomainVideoAccelDef { int accel2d; /* enum virTristateBool */ int accel3d; /* enum virTristateBool */ + char *rendernode; };