Example: Adding a disk to a guest running in secure execution mode

Procedure

  1. Configure the disk in a separate device configuration XML file. This configuration must include the iommu=on setting.
    Specify iommu=on in the XML file as an attribute of the driver element within the disk configuration.
    For example, in this MyDisk.xml file, iommu is set to on for a disk:
    <disk type="block" device="disk">
        <driver name="qemu" type="raw" cache="none" io="native"
         iothread="2" iommu=on/>
    ...
  2. Specify this device configuration XML file as an argument for the virsh attach-device command when you hotplug the disk.
    For example, this command picks up the MyDisk.xml configuration file for the disk:
    # virsh attach-device --config Guest1 ~/MyDisk.xml
    Tip: Also use the virsh attach-device command to attach interfaces.