All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vhost-net: add module alias
@ 2012-01-11  4:54 Stephen Hemminger
  2012-01-11  7:07 ` Michael Tokarev
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Stephen Hemminger @ 2012-01-11  4:54 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: netdev, kvm, virtualization

By adding the a module alias, programs (or users) won't have to explicitly
call modprobe. Vhost-net will always be available if built into the kernel.
It does require assigning a permanent minor number for depmod to work.
Choose one next to TUN since this driver is related to it.

Also, use C99 style initialization.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/vhost/net.c        |    8 +++++---
 include/linux/miscdevice.h |    1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

--- a/drivers/vhost/net.c	2012-01-10 10:56:58.883179194 -0800
+++ b/drivers/vhost/net.c	2012-01-10 19:48:23.650225892 -0800
@@ -856,9 +856,9 @@ static const struct file_operations vhos
 };
 
 static struct miscdevice vhost_net_misc = {
-	MISC_DYNAMIC_MINOR,
-	"vhost-net",
-	&vhost_net_fops,
+	.minor = VHOST_NET_MINOR,
+	.name = "vhost-net",
+	.fops = &vhost_net_fops,
 };
 
 static int vhost_net_init(void)
@@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1");
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Michael S. Tsirkin");
 MODULE_DESCRIPTION("Host kernel accelerator for virtio net");
+MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR);
+MODULE_ALIAS("devname:vhost-net");
--- a/include/linux/miscdevice.h	2012-01-10 10:56:59.779189436 -0800
+++ b/include/linux/miscdevice.h	2012-01-10 19:49:56.091748210 -0800
@@ -31,6 +31,7 @@
 #define I2O_MINOR		166
 #define MICROCODE_MINOR		184
 #define TUN_MINOR		200
+#define VHOST_NET_MINOR		201
 #define MWAVE_MINOR		219	/* ACP/Mwave Modem */
 #define MPT_MINOR		220
 #define MPT2SAS_MINOR		221

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2012-01-16 23:34 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11  4:54 [PATCH] vhost-net: add module alias Stephen Hemminger
2012-01-11  7:07 ` Michael Tokarev
2012-01-11  7:07 ` Michael Tokarev
2012-01-11 16:58   ` Stephen Hemminger
2012-01-11 17:02     ` Michael Tokarev
2012-01-11 17:02     ` Michael Tokarev
2012-01-11 17:03     ` Kay Sievers
2012-01-11 17:03     ` Kay Sievers
2012-01-11  7:43 ` Amos Kong
2012-01-11 16:54   ` Stephen Hemminger
2012-01-11 16:54   ` Stephen Hemminger
2012-01-11 18:15     ` Michael S. Tsirkin
2012-01-11 17:16 ` [PATCH] vhost-net: add module alias (v2) Stephen Hemminger
2012-01-11 18:09   ` Michael S. Tsirkin
2012-01-11 21:00   ` Ben Hutchings
2012-01-12  2:15   ` Zhi Yong Wu
2012-01-12  5:30     ` [PATCH] vhost-net: add module alias (v2.1) Stephen Hemminger
2012-01-13  4:07       ` David Miller
2012-01-13  4:19         ` Kay Sievers
2012-01-13 18:12           ` David Miller
2012-01-15 12:42         ` Michael S. Tsirkin
2012-01-16 12:26           ` Alan Cox
2012-01-16 15:52             ` Stephen Hemminger
2012-01-16 23:06               ` David Miller
2012-01-16 23:34               ` Alan Cox
2012-01-15 12:42         ` Michael S. Tsirkin
2012-01-12  2:15   ` [PATCH] vhost-net: add module alias (v2) Zhi Yong Wu
2012-01-12 20:04   ` Thadeu Lima de Souza Cascardo
2012-01-12 20:04   ` Thadeu Lima de Souza Cascardo
2012-01-16 12:28 ` [PATCH] vhost-net: add module alias Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.