diff options
author | Jason Wang <jasowang@redhat.com> | 2021-08-04 11:48:01 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-09-04 16:35:17 -0400 |
commit | dd014b4f4967e85c021033193d70d7526b7214cb (patch) | |
tree | 24ae9ae9ed3a19b9d8faded83ae02b598029eb50 /include/hw | |
parent | 2d050ed07c97a88202dac3eef64263e1f2556bfe (diff) | |
download | qemu-dd014b4f4967e85c021033193d70d7526b7214cb.zip qemu-dd014b4f4967e85c021033193d70d7526b7214cb.tar.gz qemu-dd014b4f4967e85c021033193d70d7526b7214cb.tar.bz2 |
virtio-bus: introduce iommu_enabled()
This patch introduce a new method for the virtio-bus for the transport
to report whether or not the IOMMU is enabled for the device.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20210804034803.1644-2-jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/virtio/virtio-bus.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h index ef8abe4..7ab8c9d 100644 --- a/include/hw/virtio/virtio-bus.h +++ b/include/hw/virtio/virtio-bus.h @@ -93,6 +93,7 @@ struct VirtioBusClass { */ bool has_variable_vring_alignment; AddressSpace *(*get_dma_as)(DeviceState *d); + bool (*iommu_enabled)(DeviceState *d); }; struct VirtioBusState { @@ -154,5 +155,6 @@ void virtio_bus_release_ioeventfd(VirtioBusState *bus); int virtio_bus_set_host_notifier(VirtioBusState *bus, int n, bool assign); /* Tell the bus that the ioeventfd handler is no longer required. */ void virtio_bus_cleanup_host_notifier(VirtioBusState *bus, int n); - +/* Whether the IOMMU is enabled for this device */ +bool virtio_bus_device_iommu_enabled(VirtIODevice *vdev); #endif /* VIRTIO_BUS_H */ |