Skip to contentSkip to conversation

xen: Add alias to autoload backend drivers

PATCH In review Bastian Blank 3 participants 16 messages Jun 24, 2011 – Jun 28, 2011

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 xen: Add alias to autoload backend drivers

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

This patch defines xen-backend:* aliases on the modules and exports this names through modalias and uevent.

---
 drivers/block/xen-blkback/blkback.c       |    1 +
 drivers/net/xen-netback/netback.c         |    1 +
 drivers/xen/xenbus/xenbus_probe.c         |    3 ++-
 drivers/xen/xenbus/xenbus_probe_backend.c |    3 +++
 4 files changed, 7 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +1 -0
index 5cf2993..ed62008 100644
@@ -824,3 +824,4 @@ static int __init xen_blkif_init(void)
 module_init(xen_blkif_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vbd");
drivers/net/xen-netback/netback.c +1 -0
index 0e4851b..fd00f25 100644
@@ -1743,3 +1743,4 @@ failed_init:
 module_init(netback_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vif");
drivers/xen/xenbus/xenbus_probe.c +2 -1
index 2ed0b04..bd2f90c 100644
@@ -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[] = {
drivers/xen/xenbus/xenbus_probe_backend.c +3 -0
index ec510e5..60adf91 100644
@@ -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;
Signature · 1 line
1.7.5.4
Acked-by on v1 2/2
#1 lore raw
Quoted 5 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

This patch defines xen-backend:* aliases on the modules and exports this names through modalias and uevent.

Excellent, this was a big missing piece of functionality for distros. Thanks!

Quoted 1 line
Quoted 53 lines
---
 drivers/block/xen-blkback/blkback.c       |    1 +
 drivers/net/xen-netback/netback.c         |    1 +
 drivers/xen/xenbus/xenbus_probe.c         |    3 ++-
 drivers/xen/xenbus/xenbus_probe_backend.c |    3 +++
 4 files changed, 7 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +1 -0
index 5cf2993..ed62008 100644
@@ -824,3 +824,4 @@ static int __init xen_blkif_init(void)
 module_init(xen_blkif_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vbd");
drivers/net/xen-netback/netback.c +1 -0
index 0e4851b..fd00f25 100644
@@ -1743,3 +1743,4 @@ failed_init:
 module_init(netback_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vif");
drivers/xen/xenbus/xenbus_probe.c +2 -1
index 2ed0b04..bd2f90c 100644
@@ -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[] = {
drivers/xen/xenbus/xenbus_probe_backend.c +3 -0
index ec510e5..60adf91 100644
@@ -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;
Acked-by on v1 2/2
#2 lore raw
In reply to Bastian Blank
Quoted 5 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

This patch defines xen-backend:* aliases on the modules and exports this names through modalias and uevent.

Excellent, this was a big missing piece of functionality for distros. Thanks!

Quoted 1 line
Quoted 53 lines
---
 drivers/block/xen-blkback/blkback.c       |    1 +
 drivers/net/xen-netback/netback.c         |    1 +
 drivers/xen/xenbus/xenbus_probe.c         |    3 ++-
 drivers/xen/xenbus/xenbus_probe_backend.c |    3 +++
 4 files changed, 7 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +1 -0
index 5cf2993..ed62008 100644
@@ -824,3 +824,4 @@ static int __init xen_blkif_init(void)
 module_init(xen_blkif_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vbd");
drivers/net/xen-netback/netback.c +1 -0
index 0e4851b..fd00f25 100644
@@ -1743,3 +1743,4 @@ failed_init:
 module_init(netback_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vif");
drivers/xen/xenbus/xenbus_probe.c +2 -1
index 2ed0b04..bd2f90c 100644
@@ -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[] = {
drivers/xen/xenbus/xenbus_probe_backend.c +3 -0
index ec510e5..60adf91 100644
@@ -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;
#3 lore raw
In reply to Bastian Blank
Quoted 2 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

Is there a specific version of udev that would take advantage of this?

Quoted 66 lines

This patch defines xen-backend:* aliases on the modules and exports this names through modalias and uevent.

---
 drivers/block/xen-blkback/blkback.c       |    1 +
 drivers/net/xen-netback/netback.c         |    1 +
 drivers/xen/xenbus/xenbus_probe.c         |    3 ++-
 drivers/xen/xenbus/xenbus_probe_backend.c |    3 +++
 4 files changed, 7 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +1 -0
index 5cf2993..ed62008 100644
@@ -824,3 +824,4 @@ static int __init xen_blkif_init(void)
 module_init(xen_blkif_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vbd");
drivers/net/xen-netback/netback.c +1 -0
index 0e4851b..fd00f25 100644
@@ -1743,3 +1743,4 @@ failed_init:
 module_init(netback_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vif");
drivers/xen/xenbus/xenbus_probe.c +2 -1
index 2ed0b04..bd2f90c 100644
@@ -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[] = {
drivers/xen/xenbus/xenbus_probe_backend.c +3 -0
index ec510e5..60adf91 100644
@@ -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;
Signature · 7 lines
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#4 lore raw
Quoted 4 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

Is there a specific version of udev that would take advantage of this?

Was there a version within the last three years that can't? The patch is tested and udev does its work.

Bastian

Signature · 2 lines
Pain is a thing of the mind.  The mind can be controlled.
		-- Spock, "Operation -- Annihilate!" stardate 3287.2
#5 lore raw
Quoted 8 lines · Bastian Blank
Quoted 4 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

Is there a specific version of udev that would take advantage of this?

Was there a version within the last three years that can't? The patch is tested and udev does its work.

Ok, that answers that question. Queue up for 3.1

#6 lore raw
Quoted 11 lines · Konrad Rzeszutek Wilk
Quoted 8 lines · Bastian Blank
Quoted 4 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

Is there a specific version of udev that would take advantage of this?

Was there a version within the last three years that can't? The patch is tested and udev does its work.

Ok, that answers that question. Queue up for 3.1

Ugh actually no I can't.

Bastian,

Can you re-submit these two patches (and stick on Acked-by Ian on them) and split the "xen: Add alias to autoload backend driver" in three patches:
1) the xen-netback (and copy David Miller)
2) the xen-blkback (and copy Jens Axboe)
3) the xenbus one

and add Acked-by on the two backends from me and from Ian?

That should be five patches total.

I will take the xenbus patches and have them in a 3.1 branch and the backends patches will go to the appropiate maintainer.

Thanks!

#7 lore raw
Quoted 1 line · Konrad Rzeszutek Wilk

Ugh actually no I can't.

Why? It does not actually change things.

Quoted 5 lines

Can you re-submit these two patches (and stick on Acked-by Ian on them) and split the "xen: Add alias to autoload backend driver" in three patches:
1) the xen-netback (and copy David Miller)
2) the xen-blkback (and copy Jens Axboe)
3) the xenbus one

That is silly.

Quoted 1 line

That should be five patches total.

No, 2+2 is 4, not five.

Bastian

Signature · 3 lines
Each kiss is as the first.
		-- Miramanee, Kirk's wife, "The Paradise Syndrome",
		   stardate 4842.6
#8 lore raw
Quoted 5 lines · Bastian Blank
Quoted 1 line · Konrad Rzeszutek Wilk

Ugh actually no I can't.

Why? It does not actually change things.

Quoted 7 lines
Quoted 5 lines

Can you re-submit these two patches (and stick on Acked-by Ian on them) and split the "xen: Add alias to autoload backend driver" in three patches:
1) the xen-netback (and copy David Miller)
2) the xen-blkback (and copy Jens Axboe)
3) the xenbus one

That is silly.

Please do it.

Quoted 4 lines
Quoted 2 lines

That should be five patches total.

No, 2+2 is 4, not five.

Right. Got my math wrong.

#9 lore raw
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Bastian Blank
Quoted 1 line · Konrad Rzeszutek Wilk

Ugh actually no I can't.

Why? It does not actually change things.

There are two ways of doing this:

1). Split the patch in three b/c:

The backends are owned by different maintainers. The xen-netback is owned by David Miller and he is the one that will take the patch and send it to Linus during the next merge window. The xen-blkback is the same thing - Jens will take it (or I can stick it in my #stable/for-jens branch and ask him to pull everything there). Either way, for both backends, those two folks are the ones that Linus will take the patch from - not me.

I am going to take the xenbus patches and ask Linus to pull them.

In other words, this last patch crosses three different maintainers - hence you can either split the patch in three parts.

2). Ask each of the maintainers (David, Jens) to give you an Ack so that this patch has both of them and then I can send it directly to Linus.

#10 lore raw
In reply to Bastian Blank
Quoted 5 lines · Bastian Blank
Quoted 1 line · Konrad Rzeszutek Wilk

Ugh actually no I can't.

Why? It does not actually change things.

Quoted 7 lines
Quoted 5 lines

Can you re-submit these two patches (and stick on Acked-by Ian on them) and split the "xen: Add alias to autoload backend driver" in three patches:
1) the xen-netback (and copy David Miller)
2) the xen-blkback (and copy Jens Axboe)
3) the xenbus one

That is silly.

Please do it.

Quoted 4 lines
Quoted 2 lines

That should be five patches total.

No, 2+2 is 4, not five.

Right. Got my math wrong.

#11 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 1 line · Konrad Rzeszutek Wilk

Ugh actually no I can't.

Why? It does not actually change things.

Quoted 5 lines

Can you re-submit these two patches (and stick on Acked-by Ian on them) and split the "xen: Add alias to autoload backend driver" in three patches:
1) the xen-netback (and copy David Miller)
2) the xen-blkback (and copy Jens Axboe)
3) the xenbus one

That is silly.

Quoted 1 line

That should be five patches total.

No, 2+2 is 4, not five.

Bastian

Signature · 3 lines
Each kiss is as the first.
		-- Miramanee, Kirk's wife, "The Paradise Syndrome",
		   stardate 4842.6
#12 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 11 lines · Konrad Rzeszutek Wilk
Quoted 8 lines · Bastian Blank
Quoted 4 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

Is there a specific version of udev that would take advantage of this?

Was there a version within the last three years that can't? The patch is tested and udev does its work.

Ok, that answers that question. Queue up for 3.1

Ugh actually no I can't.

Bastian,

Can you re-submit these two patches (and stick on Acked-by Ian on them) and split the "xen: Add alias to autoload backend driver" in three patches:
1) the xen-netback (and copy David Miller)
2) the xen-blkback (and copy Jens Axboe)
3) the xenbus one

and add Acked-by on the two backends from me and from Ian?

That should be five patches total.

I will take the xenbus patches and have them in a 3.1 branch and the backends patches will go to the appropiate maintainer.

Thanks!

#13 lore raw
In reply to Bastian Blank
Quoted 8 lines · Bastian Blank
Quoted 4 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

Is there a specific version of udev that would take advantage of this?

Was there a version within the last three years that can't? The patch is tested and udev does its work.

Ok, that answers that question. Queue up for 3.1

#14 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 4 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

Is there a specific version of udev that would take advantage of this?

Was there a version within the last three years that can't? The patch is tested and udev does its work.

Bastian

Signature · 2 lines
Pain is a thing of the mind.  The mind can be controlled.
		-- Spock, "Operation -- Annihilate!" stardate 3287.2
#15 lore raw
In reply to Bastian Blank
Quoted 2 lines · Bastian Blank

All the Xen backend drivers are assigned to a special bus type xen-backend. This allows userspace to load the modules on request.

Is there a specific version of udev that would take advantage of this?

Quoted 66 lines

This patch defines xen-backend:* aliases on the modules and exports this names through modalias and uevent.

---
 drivers/block/xen-blkback/blkback.c       |    1 +
 drivers/net/xen-netback/netback.c         |    1 +
 drivers/xen/xenbus/xenbus_probe.c         |    3 ++-
 drivers/xen/xenbus/xenbus_probe_backend.c |    3 +++
 4 files changed, 7 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +1 -0
index 5cf2993..ed62008 100644
@@ -824,3 +824,4 @@ static int __init xen_blkif_init(void)
 module_init(xen_blkif_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vbd");
drivers/net/xen-netback/netback.c +1 -0
index 0e4851b..fd00f25 100644
@@ -1743,3 +1743,4 @@ failed_init:
 module_init(netback_init);
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("xen-backend:vif");
drivers/xen/xenbus/xenbus_probe.c +2 -1
index 2ed0b04..bd2f90c 100644
@@ -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[] = {
drivers/xen/xenbus/xenbus_probe_backend.c +3 -0
index ec510e5..60adf91 100644
@@ -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;
Signature · 7 lines
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/