This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH 2/4] xen: Add module alias to autoload backend driver

To: xen-devel@xxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2/4] xen: Add module alias to autoload backend drivers
From: Bastian Blank <waldi@xxxxxxxxxx>
Date: Wed, 29 Jun 2011 14:40:08 +0200
Cc: linux-kernel@xxxxxxxxxxxxxxx
Delivery-date: Wed, 29 Jun 2011 05:41:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Bastian Blank <waldi@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
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@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
 drivers/xen/xenbus/xenbus_probe.c         |    3 ++-
 drivers/xen/xenbus/xenbus_probe_backend.c |    3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_probe.c 
index 2ed0b04..bd2f90c 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -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[] = {
diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c 
index ec510e5..60adf91 100644
--- a/drivers/xen/xenbus/xenbus_probe_backend.c
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -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;

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 2/4] xen: Add module alias to autoload backend drivers, Bastian Blank <=