virtio: add dma-buf support for exported objects

This change adds a new flavor of dma-bufs that can be used by virtio
drivers to share exported objects. A virtio dma-buf can be queried by
virtio drivers to obtain the UUID which identifies the underlying
exported object.

Signed-off-by: David Stevens <stevensd@chromium.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200818071343.3461203-2-stevensd@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
David Stevens
2020-08-18 16:13:41 +09:00
committed by Gerd Hoffmann
parent bbaac1354c
commit a0308938ec
5 changed files with 130 additions and 1 deletions

View File

@@ -357,6 +357,12 @@ out:
}
EXPORT_SYMBOL_GPL(register_virtio_device);
bool is_virtio_device(struct device *dev)
{
return dev->bus == &virtio_bus;
}
EXPORT_SYMBOL_GPL(is_virtio_device);
void unregister_virtio_device(struct virtio_device *dev)
{
int index = dev->index; /* save for after device release */