pc/q35: Disallow vfio-pci hotplug without VT-d caching mode
commitc6cbc29d36fe8df078776ed715c37cebac582238
authorPeter Xu <peterx@redhat.com>
Mon, 16 Sep 2019 08:07:17 +0000 (16 16:07 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 16 Sep 2019 10:57:24 +0000 (16 06:57 -0400)
treeb2e49962a3fd20c243d72b052717ce422e89f048
parentd2321d31ff98b75b652c2b1594f00a4cfd48102a
pc/q35: Disallow vfio-pci hotplug without VT-d caching mode

Instead of bailing out when trying to hotplug a vfio-pci device with
below configuration:

  -device intel-iommu,caching-mode=off

With this we can return a warning message to the user via QMP/HMP and
the VM will continue to work after failing the hotplug:

  (qemu) device_add vfio-pci,bus=root.3,host=05:00.0,id=vfio1
  Error: Device assignment is not allowed without enabling caching-mode=on for Intel IOMMU.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20190916080718.3299-4-peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/pc.c