From patchwork Fri Aug 23 16:21:46 2019
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: Cole Robinson
X-Patchwork-Id: 172112
Delivered-To: patch@linaro.org
Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp885714ily;
Fri, 23 Aug 2019 09:22:11 -0700 (PDT)
X-Google-Smtp-Source: APXvYqySOUeZ3bbHm2nogKx2OYV/FHsMzppR2KQJquLDT/qblggljR9XwFNhjXTlzT/Si+oSBf9i
X-Received: by 2002:a05:6214:561:: with SMTP id
cj1mr4692653qvb.50.1566577331015;
Fri, 23 Aug 2019 09:22:11 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1566577331; cv=none;
d=google.com; s=arc-20160816;
b=g6Jgxf3ze0i4YMj4mxFk+TKgI9QJ0z/pwx9+YRbn6GlvhQ3sYjbNfgTvJ3W3KgJiQJ
3/wPxkWoMT94DGqraCceNiNfIrt/bBOEeFVSoNlmIg+KV89tJIHUtceN0heTrEX3KIZA
H1FMwwOHunyuDAk8jheW00jYXDwWnP9J1SrEoVnUv4BUPPIJs9HFMHOrpIfMLmrDUb1B
lJbhHuN6A1pUyIHNG80COvcmsih6AF0VRcJyRINZE/9tRRgN+siE8M2zjaJnm7BRjzkp
u39P3RYtpjd8xuuiDp+BNmvlKDfWa/29WAcxyAgSemBkVG66qxe7ShAe5Q9n3y22kPFK
+s1A==
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=AU1kwMhv3k0LIn3YvkuXKA6Cwtzzl6l0+lWUOTPKBfs=;
b=VXBorI8Qef6+VIkV45ge6NTlG1lOjkpVj+H+3BSJX5hKsuFT6FAvucsU6Ifejyy1zf
HeT7S5Ay2Hl+Xlvt6Gsq4gRb8h1Q8XEbGp8KqaLLe4P91XvHV3rolbDVv+4VKKoi1vqY
946Fs2srNXzzILli0TUsqVf6itYXjUVuNLcZ+alN47wCl/N7DR9acflJNT6K5X0QOAVm
Z4xyP2pQopA/tLp/nsLJK1l5bO5CyCz4hmZIqZAgFgLZHQcW2POLdwUkI73AYdea0th5
slEhw14tbMqSpiyi5IBXdRXsUZMUBKn+kYaMvHWO/RXAEJQsRadGHVfChsez1fjpB7rl
nqGA==
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
124si2098437qkh.244.2019.08.23.09.22.10
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Fri, 23 Aug 2019 09:22:11 -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 9492618DE768;
Fri, 23 Aug 2019 16:22:09 +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 171A24142;
Fri, 23 Aug 2019 16:22:09 +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 5137324F35;
Fri, 23 Aug 2019 16:22:07 +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 x7NGM51R005984 for ;
Fri, 23 Aug 2019 12:22:05 -0400
Received: by smtp.corp.redhat.com (Postfix)
id 0724C60605; 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 89E0F6092D;
Fri, 23 Aug 2019 16:22:04 +0000 (UTC)
From: Cole Robinson
To: libvirt-list@redhat.com
Date: Fri, 23 Aug 2019 12:21:46 -0400
Message-Id: <76dadadc00b9c519e4b25f321776347672781cb9.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 02/16] domain: add "vhostuser" attribute to
virtio video model
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.63]);
Fri, 23 Aug 2019 16:22:10 +0000 (UTC)
From: Marc-André Lureau
Accept a new attribute to specify usage of helper process, ex:
Signed-off-by: Marc-André Lureau
Signed-off-by: Cole Robinson
---
docs/formatdomain.html.in | 6 ++++++
docs/schemas/domaincommon.rng | 11 ++++++++++-
src/conf/domain_conf.c | 14 ++++++++++++++
src/conf/domain_conf.h | 1 +
4 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index fcb7c59c00..ec650fbe17 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7039,6 +7039,12 @@ qemu-kvm -net nic,model=? /dev/null
Attribute vram64
(since 1.3.3)
extends secondary bar and makes it addressable as 64bit memory.
+
+ For guest type "kvm" and model type "virtio" there are
+ optional attributes. Attribute vhost-user
+ (since 5.5.0) specify that a
+ vhost-user helper process should be associated with the GPU.
+
acceleration
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index c48f8c4f56..bac566855d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3581,7 +3581,6 @@
vmvga
xen
vbox
- virtio
gop
none
bochs
@@ -3607,6 +3606,16 @@
+
+
+ virtio
+
+
+
+
+
+
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b7a342bb91..f51575d57d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15358,6 +15358,7 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt,
xmlNodePtr cur;
VIR_XPATH_NODE_AUTORESTORE(ctxt);
VIR_AUTOFREE(char *) type = NULL;
+ VIR_AUTOFREE(char *) vhostuser = NULL;
VIR_AUTOFREE(char *) heads = NULL;
VIR_AUTOFREE(char *) vram = NULL;
VIR_AUTOFREE(char *) vram64 = NULL;
@@ -15376,6 +15377,7 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt,
if (!type && !vram && !ram && !heads &&
virXMLNodeNameEqual(cur, "model")) {
type = virXMLPropString(cur, "type");
+ vhostuser = virXMLPropString(cur, "vhostuser");
ram = virXMLPropString(cur, "ram");
vram = virXMLPropString(cur, "vram");
vram64 = virXMLPropString(cur, "vram64");
@@ -15408,6 +15410,16 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt,
def->type = virDomainVideoDefaultType(dom);
}
+ if (vhostuser != NULL) {
+ if (virStringParseYesNo(vhostuser, &def->vhostuser) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown vhostuser value '%s'"), vhostuser);
+ goto cleanup;
+ }
+ } else {
+ def->vhostuser = false;
+ }
+
if (ram) {
if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
virReportError(VIR_ERR_XML_ERROR, "%s",
@@ -26486,6 +26498,8 @@ virDomainVideoDefFormat(virBufferPtr buf,
virBufferAsprintf(buf, " heads='%u'", def->heads);
if (def->primary)
virBufferAddLit(buf, " primary='yes'");
+ if (def->vhostuser)
+ virBufferAddLit(buf, " vhostuser='yes'");
if (def->accel) {
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 33cef5b75c..bc2450f25e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1424,6 +1424,7 @@ struct _virDomainVideoDef {
virDomainVideoDriverDefPtr driver;
virDomainDeviceInfo info;
virDomainVirtioOptionsPtr virtio;
+ bool vhostuser;
};
/* graphics console modes */