event device passed through to guests. (KVM only)
</p>
+ <p>
+ The subelement <code>driver</code> can be used to tune the virtio
+ options of the device:
+ <a href="#elementsVirtio">Virtio-specific options</a> can also be
+ set. (<span class="since">Since 3.5.0</span>)
+ </p>
+
<h4><a name="elementsHub">Hub devices</a></h4>
<p>
virDomainDeviceInfoClear(&def->info);
VIR_FREE(def->source.evdev);
+ VIR_FREE(def->virtio);
VIR_FREE(def);
}
goto error;
}
+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0)
+ goto error;
+
cleanup:
VIR_FREE(evdev);
VIR_FREE(type);
return false;
}
+ if (src->virtio && dst->virtio &&
+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio))
+ return false;
+
if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info))
return false;
const char *type = virDomainInputTypeToString(def->type);
const char *bus = virDomainInputBusTypeToString(def->bus);
virBuffer childbuf = VIR_BUFFER_INITIALIZER;
+ virBuffer driverBuf = VIR_BUFFER_INITIALIZER;
/* don't format keyboard into migratable XML for backward compatibility */
if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE &&
type, bus);
virBufferAdjustIndent(&childbuf, virBufferGetIndent(buf, false) + 2);
+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
+ if (virBufferCheckError(&driverBuf) < 0)
+ return -1;
+
+ if (virBufferUse(&driverBuf)) {
+ virBufferAddLit(&childbuf, "<driver");
+ virBufferAddBuffer(&childbuf, &driverBuf);
+ virBufferAddLit(&childbuf, "/>\n");
+ }
virBufferEscapeString(&childbuf, "<source evdev='%s'/>\n", def->source.evdev);
if (virDomainDeviceInfoFormat(&childbuf, &def->info, flags) < 0)
return -1;
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</interface>
<input type='mouse' bus='virtio'>
+ <driver iommu='on' ats='on'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
</input>
<input type='keyboard' bus='virtio'>
+ <driver iommu='on' ats='on'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
</input>
<input type='tablet' bus='virtio'>
+ <driver iommu='on' ats='on'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x11' function='0x0'/>
</input>
<input type='passthrough' bus='virtio'>
+ <driver iommu='on' ats='on'/>
<source evdev='/dev/input/event1234'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>
</input>