...
<devices>
<hostdev mode='subsystem' type='pci' managed='yes'>
- <source>
+ <source writeFiltering='no'>
<address domain='0x0000' bus='0x06' slot='0x02' function='0x0'/>
</source>
<boot order='1'/>
``pci``
PCI devices can only be described by their ``address``.
+ :since:`Since 6.8.0 (Xen only)` , the ``source`` element of a PCI device
+ may contain the ``writeFiltering`` attribute to control write access to
+ the PCI configuration space. By default Xen only allows writes of known
+ safe values to the configuration space. Setting ``writeFiltering='no'``
+ will allow all writes to the device's PCI configuration space.
``scsi``
SCSI devices are described by both the ``adapter`` and ``address``
elements. The ``address`` element includes a ``bus`` attribute (a 2-digit
<optional>
<ref name="startupPolicy"/>
</optional>
+ <optional>
+ <attribute name="writeFiltering">
+ <ref name="virYesNo"/>
+ </attribute>
+ </optional>
<element name="address">
<ref name="pciaddress"/>
</element>
virDomainHostdevDefPtr def,
unsigned int flags)
{
+ g_autofree char *filtering = NULL;
xmlNodePtr cur;
+ if ((filtering = virXMLPropString(node, "writeFiltering"))) {
+ if ((def->writeFiltering = virTristateBoolTypeFromString(filtering)) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("unknown pci writeFiltering setting '%s'"),
+ filtering);
+ return -1;
+ }
+ }
+
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
g_auto(virBuffer) origstatesChildBuf = VIR_BUFFER_INIT_CHILD(&sourceChildBuf);
virDomainHostdevSubsysPCIPtr pcisrc = &def->source.subsys.u.pci;
+ if (def->writeFiltering != VIR_TRISTATE_BOOL_ABSENT)
+ virBufferAsprintf(&sourceAttrBuf, " writeFiltering='%s'",
+ virTristateBoolTypeToString(def->writeFiltering));
+
if (pcisrc->backend != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT) {
const char *backend = virDomainHostdevSubsysPCIBackendTypeToString(pcisrc->backend);
bool missing;
bool readonly;
bool shareable;
+ virTristateBool writeFiltering;
union {
virDomainHostdevSubsys subsys;
virDomainHostdevCaps caps;
pcidev->bus = pcisrc->addr.bus;
pcidev->dev = pcisrc->addr.slot;
pcidev->func = pcisrc->addr.function;
+ pcidev->permissive = hostdev->writeFiltering == VIR_TRISTATE_BOOL_NO;
return 0;
}
return -1;
}
}
+
+ if (hostdev->writeFiltering != VIR_TRISTATE_BOOL_ABSENT) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Write filtering of PCI device configuration "
+ "space is not supported by qemu"));
+ return -1;
+ }
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
"dev": 16,
"bus": 10,
"rdm_policy": "invalid"
+ },
+ {
+ "dev": 8,
+ "bus": 10,
+ "permissive": true,
+ "rdm_policy": "invalid"
}
],
"vfbs": [
<address type='pci' domain='0x0000' bus='0x0a' slot='0x10' function='0x0'/>
</source>
</interface>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <source writeFiltering='no'>
+ <address domain='0x0000' bus='0x0a' slot='0x08' function='0x0'/>
+ </source>
+ </hostdev>
<graphics type='vnc'/>
<video>
<model type='cirrus' vram='8192' heads='1' primary='yes'/>