提交 149bb2fa 编写于 作者: B Bastian Blank 提交者: Konrad Rzeszutek Wilk

xen: Add module alias to autoload backend drivers

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: NBastian Blank <waldi@debian.org>
Acked-by: NIan Campbell <ian.campbell@citrix.com>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 cc85e933
......@@ -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[] = {
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册