Skip to content

Commit

Permalink
xen: Add module alias to autoload backend drivers
Browse files Browse the repository at this point in the history
All the Xen backend drivers are assigned to a special bus type
xen-backend. This patch exports xen-backend:* names through modalias and
uevent to autoload them.

Signed-off-by: Bastian Blank <waldi@debian.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Bastian Blank authored and Konrad Rzeszutek Wilk committed Jun 30, 2011
1 parent cc85e93 commit 149bb2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/xen/xenbus/xenbus_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ static ssize_t devtype_show(struct device *dev,
static ssize_t modalias_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "xen:%s\n", to_xenbus_device(dev)->devicetype);
return sprintf(buf, "%s:%s\n", dev->bus->name,
to_xenbus_device(dev)->devicetype);
}

struct device_attribute xenbus_dev_attrs[] = {
Expand Down
3 changes: 3 additions & 0 deletions drivers/xen/xenbus/xenbus_probe_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ static int xenbus_uevent_backend(struct device *dev,
if (xdev == NULL)
return -ENODEV;

if (add_uevent_var(env, "MODALIAS=xen-backend:%s", xdev->devicetype))
return -ENOMEM;

/* stuff we want to pass to /sbin/hotplug */
if (add_uevent_var(env, "XENBUS_TYPE=%s", xdev->devicetype))
return -ENOMEM;
Expand Down

0 comments on commit 149bb2f

Please sign in to comment.