Enable each device separately to use the bounce buffer

You can enable each virtio device separately to use the bounce buffer.
Before you begin: Preferably, enable all virtio devices of your virtual server by default, see Preparing the virtual server. Enable individual virtio devices to use the bounce buffer only as a fallback method.
Important: With the bounce buffer as a default, do not override this setting by configuring iommu="off" for any virtio device.
If you must enable individual virtio devices to use the bounce buffer, do not overlook virtio SCSI devices, serial devices, shared file systems, or hotplug devices that are configured in separate device configuration-XML files.
Tip: Scan the libvirt-internal configuration for address elements that have a type, cssid, ssid, and devno attribute, where the type attribute has a value ccw, as in the following example:
<address type="ccw" cssid="0xfe" ssid="0x1" devno="0xe714"/>

To enable the bounce buffer for an individual device, specify the iommu="on" attribute for the driver element that is nested within the element that represents the virtio device. You might have to add the driver element.

Example for disk devices
For disk devices, add the iommu="on" attribute to the existing driver element.
<domain>
    ...
    <devices>
        ...
        <disk type="block" device="disk">
            <driver name="qemu" type="raw" cache="none" io="native" 
                    iothread="1" iommu="on"/>
            ...
        </disk>
        ...
    </devices>
    ...
</domain>
Example for network interfaces
Network interface devices might not have a driver element. If necessary, add one with the iommu="on" attribute.
<domain>
    ...
    <devices>
        ...
        <interface type="direct">
           <source dev="bond0" mode="bridge"/>
           <model type="virtio"/>
           <driver iommu="on"/>
        </interface>
        ...
    </devices>
    ...
</domain>
Example for SCSI devices

Individual SCSI device configurations reference a SCSI controller element. You enable the bounce buffer for the controller element to cover all associated SCSI devices.

Specify the iommu="on" attribute for a driver element that is nested in the controller element. You might have to split the controller element into a start and end tag to insert the driver element.
<domain>
    ...
    <devices>
        ...
        <controller type="scsi" model="virtio-scsi" index="0">
           <driver iommu="on"/>
        </controller>
        ...
        <disk type="file" device="cdrom">
            ...
            <address type="drive" controller="0" bus="0" target="0" unit="0"/>
            ...
        </disk>
        ...
    </devices>
    ...
</domain>
Example for serial devices
<domain>
   ...
   <devices>
      ...
      <controller type="virtio-serial" index="0">
         <driver iommu="on"/>
      </controller>
      ...
   </devices>
   ...
</domain>

Virtio hotplug devices must also use the bounce buffer. Always use device configuration-XML files to enable such devices and use virsh attach-device to attach the device to a running virtual server. Attaching devices with virsh attach-disk is likely to crash the virtual server.