Thread (25 messages) 25 messages, 3 authors, 2019-10-10
STALE2446d
Revisions (27)
  1. rfc [diff vs current]
  2. v2 [diff vs current]
  3. v2 [diff vs current]
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v2 [diff vs current]
  7. v2 current
  8. v3 [diff vs current]
  9. v3 [diff vs current]
  10. v4 [diff vs current]
  11. v4 [diff vs current]
  12. v5 [diff vs current]
  13. v5 [diff vs current]
  14. v6 [diff vs current]
  15. v6 [diff vs current]
  16. v7 [diff vs current]
  17. v7 [diff vs current]
  18. v8 [diff vs current]
  19. v8 [diff vs current]
  20. v9 [diff vs current]
  21. v9 [diff vs current]
  22. v10 [diff vs current]
  23. v10 [diff vs current]
  24. v11 [diff vs current]
  25. v11 [diff vs current]
  26. v12 [diff vs current]
  27. v13 [diff vs current]

[PATCH V2 3/8] mdev: bus uevent support

From: Jason Wang <jasowang@redhat.com>
Date: 2019-09-24 13:55:21
Also in: dri-devel, intel-gfx, kvm, linux-s390, lkml
Subsystem: the rest, vfio driver, vfio mediated device drivers · Maintainers: Linus Torvalds, Alex Williamson, Kirti Wankhede

This patch adds bus uevent support for mdev bus in order to allow
cooperation with userspace.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/vfio/mdev/mdev_driver.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/vfio/mdev/mdev_driver.c b/drivers/vfio/mdev/mdev_driver.c
index b7c40ce86ee3..319d886ffaf7 100644
--- a/drivers/vfio/mdev/mdev_driver.c
+++ b/drivers/vfio/mdev/mdev_driver.c
@@ -82,9 +82,17 @@ static int mdev_match(struct device *dev, struct device_driver *drv)
 	return 0;
 }
 
+static int mdev_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+	struct mdev_device *mdev = to_mdev_device(dev);
+
+	return add_uevent_var(env, "MODALIAS=mdev:c%02X", mdev->class_id);
+}
+
 struct bus_type mdev_bus_type = {
 	.name		= "mdev",
 	.match		= mdev_match,
+	.uevent		= mdev_uevent,
 	.probe		= mdev_probe,
 	.remove		= mdev_remove,
 };
-- 
2.19.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help