From nobody Tue Feb 10 01:15:14 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=1569235524; cv=none; d=zoho.com; s=zohoarc; b=WiGBrZduXuLvEMABuKp4lWfTa40DHwEfTnvUeUSTukhoy0yUW8svXrbH3Cgk1fPMUMac4pwLXpqY+g5mZBwy0NBYaLMDZvvIMMn1x4nJAoa+zm8TeZbVVU1Z8Ld0mbVwWvdAbcbb9b5CRN0QzMvPl/xFvkfLxHkQKkKD0ydP9Gk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569235524; 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=N+H7QwyCCqP/T5DRc2vP86/qVsyAUYlbbDbXXDz7Rl0=; b=MZzyWT5ixCPRFcM7G2hQ3izGLxAZ28un0dfn44NbRja/eh0a2WonphHCBAvDsH2ucUniIOTcBCIsj/T7p7oIg7WM1WCEtqtO5BUxccWP0qeAXRZI9ekvL6/rvbnPZjyqCe6zDgb7GOPG2QIP/oCVGxl5YAtSraEykQaxOM1MMS0= 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 1569235524715304.62880478542843; Mon, 23 Sep 2019 03:45:24 -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 5495F8AC6F9; Mon, 23 Sep 2019 10:45:23 +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 C7969601B6; Mon, 23 Sep 2019 10:45:22 +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 784B34EDA5; Mon, 23 Sep 2019 10:45:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8NAjKBw025553 for ; Mon, 23 Sep 2019 06:45:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id D67D9100197A; Mon, 23 Sep 2019 10:45:20 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3E5C10027C5; Mon, 23 Sep 2019 10:45:14 +0000 (UTC) From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 14:44:26 +0400 Message-Id: <20190923104443.17931-4-marcandre.lureau@redhat.com> In-Reply-To: <20190923104443.17931-1-marcandre.lureau@redhat.com> References: <20190923104443.17931-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , jtomko@redhat.com Subject: [libvirt] [PATCH v5 03/20] 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.6.2 (mx1.redhat.com [10.5.110.69]); Mon, 23 Sep 2019 10:45:23 +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 Reviewed-by: J=C3=A1n Tomko --- 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 86a5261e47..60a47c812b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6997,6 +6997,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> ... @@ -7097,7 +7098,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 cae3be639e..7006d9f508 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3565,6 +3565,14 @@ + + + + qemu + vhostuser + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 76aaa63f57..92f30c6f7f 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", @@ -6262,6 +6269,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 @@ -15405,6 +15429,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; @@ -15440,6 +15465,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; @@ -15455,6 +15481,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", @@ -26493,13 +26529,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, "