The optional <code>address</code> sub-element can be used to
tie the video device to a particular PCI slot.
</dd>
+
+ <dt><code>driver</code></dt>
+ <dd>
+ The subelement <code>driver</code> can be used to tune the device:
+ <dl>
+ <dt>virtio options</dt>
+ <dd>
+ <a href="#elementsVirtio">Virtio-specific options</a> can also be
+ set. (<span class="since">Since 3.5.0</span>)
+ </dd>
+ </dl>
+ </dd>
</dl>
<h4><a name="elementsConsole">Consoles, serial, parallel & channel devices</a></h4>
virDomainDeviceInfoClear(&def->info);
VIR_FREE(def->accel);
+ VIR_FREE(def->virtio);
VIR_FREE(def);
}
static virDomainVideoDefPtr
virDomainVideoDefParseXML(xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
const virDomainDef *dom,
unsigned int flags)
{
virDomainVideoDefPtr def;
xmlNodePtr cur;
+ xmlNodePtr saved = ctxt->node;
char *type = NULL;
char *heads = NULL;
char *vram = NULL;
char *vgamem = NULL;
char *primary = NULL;
+ ctxt->node = node;
+
if (VIR_ALLOC(def) < 0)
return NULL;
if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0)
goto error;
+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0)
+ goto error;
+
cleanup:
+ ctxt->node = saved;
+
VIR_FREE(type);
VIR_FREE(ram);
VIR_FREE(vram);
goto error;
break;
case VIR_DOMAIN_DEVICE_VIDEO:
- if (!(dev->data.video = virDomainVideoDefParseXML(node, def, flags)))
+ if (!(dev->data.video = virDomainVideoDefParseXML(node, ctxt, def, flags)))
goto error;
break;
case VIR_DOMAIN_DEVICE_HOSTDEV:
virDomainVideoDefPtr video;
ssize_t insertAt = -1;
- if (!(video = virDomainVideoDefParseXML(nodes[i], def, flags)))
+ if (!(video = virDomainVideoDefParseXML(nodes[i], ctxt, def, flags)))
goto error;
if (video->primary) {
}
}
+ if (src->virtio && dst->virtio &&
+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio))
+ return false;
+
if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info))
return false;
unsigned int flags)
{
const char *model = virDomainVideoTypeToString(def->type);
+ virBuffer driverBuf = VIR_BUFFER_INITIALIZER;
if (!model) {
virReportError(VIR_ERR_INTERNAL_ERROR,
virBufferAddLit(buf, "<video>\n");
virBufferAdjustIndent(buf, 2);
+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
+ if (virBufferCheckError(&driverBuf) < 0)
+ return -1;
+ if (virBufferUse(&driverBuf)) {
+ virBufferAddLit(buf, "<driver");
+ virBufferAddBuffer(buf, &driverBuf);
+ virBufferAddLit(buf, "/>\n");
+ }
virBufferAsprintf(buf, "<model type='%s'",
model);
if (def->ram)