Commit 7c7c7f01 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

vhost-net: add module alias (v2.1)

By adding some module aliases, 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.

Also:
  - use C99 style initialization.
  - add missing entry in documentation for loop-control
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Acked-By: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 252c3d84
...@@ -447,6 +447,9 @@ Your cooperation is appreciated. ...@@ -447,6 +447,9 @@ Your cooperation is appreciated.
234 = /dev/btrfs-control Btrfs control device 234 = /dev/btrfs-control Btrfs control device
235 = /dev/autofs Autofs control device 235 = /dev/autofs Autofs control device
236 = /dev/mapper/control Device-Mapper control device 236 = /dev/mapper/control Device-Mapper control device
237 = /dev/loop-control Loopback control device
238 = /dev/vhost-net Host kernel accelerator for virtio net
240-254 Reserved for local use 240-254 Reserved for local use
255 Reserved for MISC_DYNAMIC_MINOR 255 Reserved for MISC_DYNAMIC_MINOR
......
...@@ -856,9 +856,9 @@ static const struct file_operations vhost_net_fops = { ...@@ -856,9 +856,9 @@ static const struct file_operations vhost_net_fops = {
}; };
static struct miscdevice vhost_net_misc = { static struct miscdevice vhost_net_misc = {
MISC_DYNAMIC_MINOR, .minor = VHOST_NET_MINOR,
"vhost-net", .name = "vhost-net",
&vhost_net_fops, .fops = &vhost_net_fops,
}; };
static int vhost_net_init(void) static int vhost_net_init(void)
...@@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1"); ...@@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Michael S. Tsirkin"); MODULE_AUTHOR("Michael S. Tsirkin");
MODULE_DESCRIPTION("Host kernel accelerator for virtio net"); MODULE_DESCRIPTION("Host kernel accelerator for virtio net");
MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR);
MODULE_ALIAS("devname:vhost-net");
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#define AUTOFS_MINOR 235 #define AUTOFS_MINOR 235
#define MAPPER_CTRL_MINOR 236 #define MAPPER_CTRL_MINOR 236
#define LOOP_CTRL_MINOR 237 #define LOOP_CTRL_MINOR 237
#define VHOST_NET_MINOR 238
#define MISC_DYNAMIC_MINOR 255 #define MISC_DYNAMIC_MINOR 255
struct device; struct device;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment