mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: format/parse/rng/docs for video <driver name='qemu|vhostuser'/>
Accept a new driver name attribute to specify usage of helper process, ex: <video> <driver name='vhostuser'/> <model type='virtio'/> </video> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
58a76d45ca
commit
bc1e924cf0
@ -6997,6 +6997,7 @@ qemu-kvm -net nic,model=? /dev/null
|
|||||||
<model type='vga' vram='16384' heads='1'>
|
<model type='vga' vram='16384' heads='1'>
|
||||||
<acceleration accel3d='yes' accel2d='yes'/>
|
<acceleration accel3d='yes' accel2d='yes'/>
|
||||||
</model>
|
</model>
|
||||||
|
<driver name='qemu'/>
|
||||||
</video>
|
</video>
|
||||||
</devices>
|
</devices>
|
||||||
...</pre>
|
...</pre>
|
||||||
@ -7097,7 +7098,16 @@ qemu-kvm -net nic,model=? /dev/null
|
|||||||
<dd>
|
<dd>
|
||||||
The subelement <code>driver</code> can be used to tune the device:
|
The subelement <code>driver</code> can be used to tune the device:
|
||||||
<dl>
|
<dl>
|
||||||
<dt>virtio options</dt>
|
<dt><code>name</code></dt>
|
||||||
|
<dd>
|
||||||
|
Specify the backend driver to use, either "qemu" or
|
||||||
|
"vhostuser" depending on the hypervisor features available
|
||||||
|
(<span class="since">since 5.8.0</span>). "qemu" is the
|
||||||
|
default QEMU backend. "vhostuser" will use a separate
|
||||||
|
vhost-user process backend (for <code>virtio</code>
|
||||||
|
device).
|
||||||
|
</dd>
|
||||||
|
<dt>virtio options</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<a href="#elementsVirtio">Virtio-specific options</a> can also be
|
<a href="#elementsVirtio">Virtio-specific options</a> can also be
|
||||||
set (<span class="since">Since 3.5.0</span>)
|
set (<span class="since">Since 3.5.0</span>)
|
||||||
|
@ -3565,6 +3565,14 @@
|
|||||||
<optional>
|
<optional>
|
||||||
<ref name="virtioOptions"/>
|
<ref name="virtioOptions"/>
|
||||||
</optional>
|
</optional>
|
||||||
|
<optional>
|
||||||
|
<attribute name="name">
|
||||||
|
<choice>
|
||||||
|
<value>qemu</value>
|
||||||
|
<value>vhostuser</value>
|
||||||
|
</choice>
|
||||||
|
</attribute>
|
||||||
|
</optional>
|
||||||
<optional>
|
<optional>
|
||||||
<attribute name="vgaconf">
|
<attribute name="vgaconf">
|
||||||
<choice>
|
<choice>
|
||||||
|
@ -728,6 +728,13 @@ VIR_ENUM_IMPL(virDomainPanicModel,
|
|||||||
"s390",
|
"s390",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
VIR_ENUM_IMPL(virDomainVideoBackend,
|
||||||
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_LAST,
|
||||||
|
"default",
|
||||||
|
"qemu",
|
||||||
|
"vhostuser",
|
||||||
|
);
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainVideo,
|
VIR_ENUM_IMPL(virDomainVideo,
|
||||||
VIR_DOMAIN_VIDEO_TYPE_LAST,
|
VIR_DOMAIN_VIDEO_TYPE_LAST,
|
||||||
"default",
|
"default",
|
||||||
@ -6262,6 +6269,23 @@ virDomainVideoDefValidate(const virDomainVideoDef *video,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (video->backend) {
|
||||||
|
case VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER:
|
||||||
|
if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("'vhostuser' driver is only supported with 'virtio' 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15405,6 +15429,7 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt,
|
|||||||
xmlNodePtr cur;
|
xmlNodePtr cur;
|
||||||
VIR_XPATH_NODE_AUTORESTORE(ctxt);
|
VIR_XPATH_NODE_AUTORESTORE(ctxt);
|
||||||
VIR_AUTOFREE(char *) type = NULL;
|
VIR_AUTOFREE(char *) type = NULL;
|
||||||
|
VIR_AUTOFREE(char *) driver_name = NULL;
|
||||||
VIR_AUTOFREE(char *) heads = NULL;
|
VIR_AUTOFREE(char *) heads = NULL;
|
||||||
VIR_AUTOFREE(char *) vram = NULL;
|
VIR_AUTOFREE(char *) vram = NULL;
|
||||||
VIR_AUTOFREE(char *) vram64 = NULL;
|
VIR_AUTOFREE(char *) vram64 = NULL;
|
||||||
@ -15440,6 +15465,7 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt,
|
|||||||
if (virXMLNodeNameEqual(cur, "driver")) {
|
if (virXMLNodeNameEqual(cur, "driver")) {
|
||||||
if (virDomainVirtioOptionsParseXML(cur, &def->virtio) < 0)
|
if (virDomainVirtioOptionsParseXML(cur, &def->virtio) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
driver_name = virXMLPropString(cur, "name");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
@ -15455,6 +15481,16 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt,
|
|||||||
def->type = virDomainVideoDefaultType(dom);
|
def->type = virDomainVideoDefaultType(dom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (driver_name) {
|
||||||
|
if ((def->backend = virDomainVideoBackendTypeFromString(driver_name)) < 0) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("unknown video driver '%s'"), driver_name);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
def->backend = VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
if (ram) {
|
if (ram) {
|
||||||
if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
|
if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
@ -26493,13 +26529,17 @@ virDomainVideoDefFormat(virBufferPtr buf,
|
|||||||
virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
|
virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
|
||||||
if (virBufferCheckError(&driverBuf) < 0)
|
if (virBufferCheckError(&driverBuf) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if (virBufferUse(&driverBuf) || (def->driver && def->driver->vgaconf)) {
|
if (virBufferUse(&driverBuf) || (def->driver && def->driver->vgaconf) ||
|
||||||
|
def->backend != VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT) {
|
||||||
virBufferAddLit(buf, "<driver");
|
virBufferAddLit(buf, "<driver");
|
||||||
if (virBufferUse(&driverBuf))
|
if (virBufferUse(&driverBuf))
|
||||||
virBufferAddBuffer(buf, &driverBuf);
|
virBufferAddBuffer(buf, &driverBuf);
|
||||||
if (def->driver && def->driver->vgaconf)
|
if (def->driver && def->driver->vgaconf)
|
||||||
virBufferAsprintf(buf, " vgaconf='%s'",
|
virBufferAsprintf(buf, " vgaconf='%s'",
|
||||||
virDomainVideoVGAConfTypeToString(def->driver->vgaconf));
|
virDomainVideoVGAConfTypeToString(def->driver->vgaconf));
|
||||||
|
if (def->backend != VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT)
|
||||||
|
virBufferAsprintf(buf, " name='%s'",
|
||||||
|
virDomainVideoBackendTypeToString(def->backend));
|
||||||
virBufferAddLit(buf, "/>\n");
|
virBufferAddLit(buf, "/>\n");
|
||||||
}
|
}
|
||||||
virBufferAsprintf(buf, "<model type='%s'",
|
virBufferAsprintf(buf, "<model type='%s'",
|
||||||
|
@ -1376,6 +1376,16 @@ struct _virDomainWatchdogDef {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* the backend driver used for virtio interfaces */
|
||||||
|
typedef enum {
|
||||||
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT,
|
||||||
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_QEMU,
|
||||||
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER,
|
||||||
|
|
||||||
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_LAST
|
||||||
|
} virDomainVideoBackendType;
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIR_DOMAIN_VIDEO_TYPE_DEFAULT,
|
VIR_DOMAIN_VIDEO_TYPE_DEFAULT,
|
||||||
VIR_DOMAIN_VIDEO_TYPE_VGA,
|
VIR_DOMAIN_VIDEO_TYPE_VGA,
|
||||||
@ -1426,6 +1436,7 @@ struct _virDomainVideoDef {
|
|||||||
virDomainVideoDriverDefPtr driver;
|
virDomainVideoDriverDefPtr driver;
|
||||||
virDomainDeviceInfo info;
|
virDomainDeviceInfo info;
|
||||||
virDomainVirtioOptionsPtr virtio;
|
virDomainVirtioOptionsPtr virtio;
|
||||||
|
virDomainVideoBackendType backend;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* graphics console modes */
|
/* graphics console modes */
|
||||||
@ -3423,6 +3434,7 @@ VIR_ENUM_DECL(virDomainWatchdogModel);
|
|||||||
VIR_ENUM_DECL(virDomainWatchdogAction);
|
VIR_ENUM_DECL(virDomainWatchdogAction);
|
||||||
VIR_ENUM_DECL(virDomainPanicModel);
|
VIR_ENUM_DECL(virDomainPanicModel);
|
||||||
VIR_ENUM_DECL(virDomainVideo);
|
VIR_ENUM_DECL(virDomainVideo);
|
||||||
|
VIR_ENUM_DECL(virDomainVideoBackend);
|
||||||
VIR_ENUM_DECL(virDomainHostdevMode);
|
VIR_ENUM_DECL(virDomainHostdevMode);
|
||||||
VIR_ENUM_DECL(virDomainHostdevSubsys);
|
VIR_ENUM_DECL(virDomainHostdevSubsys);
|
||||||
VIR_ENUM_DECL(virDomainHostdevCaps);
|
VIR_ENUM_DECL(virDomainHostdevCaps);
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
<input type='mouse' bus='ps2'/>
|
<input type='mouse' bus='ps2'/>
|
||||||
<input type='keyboard' bus='ps2'/>
|
<input type='keyboard' bus='ps2'/>
|
||||||
<video>
|
<video>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' name='vhostuser'/>
|
||||||
<model type='virtio' heads='1' primary='yes'>
|
<model type='virtio' heads='1' primary='yes'>
|
||||||
<acceleration accel3d='yes'/>
|
<acceleration accel3d='yes'/>
|
||||||
</model>
|
</model>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user