From nobody Mon Feb 9 21:21:46 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=1567188169; cv=none; d=zoho.com; s=zohoarc; b=VDmwtU4VD5ESDRMtj55qOhIPE7CUXjLuW78Vepj99thG2oEgkUESOhKWlwIQWY0FScPl3Kk0oHhiOAM2wOfpHfsoQqlwCArsJvpTNL0JkKu2nLVhHdb8q509SycpAwtVZA6JHUVvqdsE3dnarFzB+dsfLiCil14mHJrNKCVUzFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567188169; 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=3C9a7AZOagNE+RvGKY3E1lSNJVgUROyRPzJPZmPK0ns=; b=H8tCN52xpbfZPKKvmTgAOJLxlNSS42RqMc3QzNQDvpW0esHFL/CVNs96w1JgqQhWRh6J3okCTNKnsk45LdEVMfmBjzrrfafUVehYBe0tCyz6kE84mm8e4cmFNA1CYUmQ6i/HZNthHq7iRgysjgDA9BbOUIJPxJzHjY/pUDr+Qa4= 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 1567188169035695.2681838393822; Fri, 30 Aug 2019 11:02:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 00FA43086208; Fri, 30 Aug 2019 18:02:48 +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 CDA3D600F8; Fri, 30 Aug 2019 18:02:47 +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 91F9824FDF; Fri, 30 Aug 2019 18:02:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7UI2e6U031176 for ; Fri, 30 Aug 2019 14:02:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6E4745B681; Fri, 30 Aug 2019 18:02:40 +0000 (UTC) Received: from localhost (ovpn-112-53.ams2.redhat.com [10.36.112.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id F32565EE1D; Fri, 30 Aug 2019 18:02:34 +0000 (UTC) From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Date: Fri, 30 Aug 2019 22:01:46 +0400 Message-Id: <20190830180202.22278-4-marcandre.lureau@redhat.com> In-Reply-To: <20190830180202.22278-1-marcandre.lureau@redhat.com> References: <20190830180202.22278-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , jtomko@redhat.com Subject: [libvirt] [PATCH v3 03/19] conf: format/parse/rng/docs for video 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 30 Aug 2019 18:02:48 +0000 (UTC) From: Marc-Andr=C3=A9 Lureau Accept a new driver name attribute to specify usage of helper process, ex: Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/formatdomain.html.in | 12 ++++++- docs/schemas/domaincommon.rng | 8 +++++ src/conf/domain_conf.c | 42 ++++++++++++++++++++++- src/conf/domain_conf.h | 12 +++++++ tests/qemuxml2argvdata/virtio-options.xml | 2 +- 5 files changed, 73 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index fcb7c59c00..f56d04eac3 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6969,6 +6969,7 @@ qemu-kvm -net nic,model=3D? /dev/null <model type=3D'vga' vram=3D'16384' heads=3D'1'> <acceleration accel3d=3D'yes' accel2d=3D'yes'/> </model> + <driver name=3D'qemu'/> </video> </devices> ... @@ -7069,7 +7070,16 @@ qemu-kvm -net nic,model=3D? /dev/null
The subelement driver can be used to tune the device:
-
virtio options
+
name
+
+ Specify the backend driver to use, either "qemu" or + "vhostuser" depending on the hypervisor features available + (since 5.8.0). "qemu" is the + default QEMU backend. "vhostuser" will use a separate + vhost-user process backend (for virtio + device). +
+
virtio options
Virtio-specific options can also= be set (Since 3.5.0) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index c48f8c4f56..7e0b63f0a6 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3560,6 +3560,14 @@ + + + + qemu + vhostuser + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b7a342bb91..dc5b7eac5c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -728,6 +728,13 @@ VIR_ENUM_IMPL(virDomainPanicModel, "s390", ); =20 +VIR_ENUM_IMPL(virDomainVideoBackend, + VIR_DOMAIN_VIDEO_BACKEND_TYPE_LAST, + "default", + "qemu", + "vhostuser", +); + VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "default", @@ -6249,6 +6256,23 @@ virDomainVideoDefValidate(const virDomainVideoDef *v= ideo, } } =20 + switch (video->backend) { + case VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER: + if (video->type !=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'vhostuser' driver is only supported with 'v= irtio' device")); + return -1; + } + break; + case VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT: + case VIR_DOMAIN_VIDEO_BACKEND_TYPE_QEMU: + break; + case VIR_DOMAIN_VIDEO_BACKEND_TYPE_LAST: + default: + virReportEnumRangeError(virDomainInputType, video->backend); + return -1; + } + return 0; } =20 @@ -15358,6 +15382,7 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xml= opt, xmlNodePtr cur; VIR_XPATH_NODE_AUTORESTORE(ctxt); VIR_AUTOFREE(char *) type =3D NULL; + VIR_AUTOFREE(char *) driver_name =3D NULL; VIR_AUTOFREE(char *) heads =3D NULL; VIR_AUTOFREE(char *) vram =3D NULL; VIR_AUTOFREE(char *) vram64 =3D NULL; @@ -15393,6 +15418,7 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xml= opt, if (virXMLNodeNameEqual(cur, "driver")) { if (virDomainVirtioOptionsParseXML(cur, &def->virtio) < 0) goto error; + driver_name =3D virXMLPropString(cur, "name"); } } cur =3D cur->next; @@ -15408,6 +15434,16 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xm= lopt, def->type =3D virDomainVideoDefaultType(dom); } =20 + if (driver_name) { + if ((def->backend =3D virDomainVideoBackendTypeFromString(driver_n= ame)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown video driver '%s'"), driver_name); + goto error; + } + } else { + def->backend =3D VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT; + } + if (ram) { if (def->type !=3D VIR_DOMAIN_VIDEO_TYPE_QXL) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -26463,13 +26499,17 @@ virDomainVideoDefFormat(virBufferPtr buf, virDomainVirtioOptionsFormat(&driverBuf, def->virtio); if (virBufferCheckError(&driverBuf) < 0) goto cleanup; - if (virBufferUse(&driverBuf) || (def->driver && def->driver->vgaconf))= { + if (virBufferUse(&driverBuf) || (def->driver && def->driver->vgaconf) = || + def->backend !=3D VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT) { virBufferAddLit(buf, "driver && def->driver->vgaconf) virBufferAsprintf(buf, " vgaconf=3D'%s'", virDomainVideoVGAConfTypeToString(def->drive= r->vgaconf)); + if (def->backend !=3D VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT) + virBufferAsprintf(buf, " name=3D'%s'", + virDomainVideoBackendTypeToString(def->backe= nd)); virBufferAddLit(buf, "/>\n"); } virBufferAsprintf(buf, "