diff options
author | stephen hemminger <shemminger@vyatta.com> | 2012-01-11 14:30:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-13 13:12:23 -0500 |
commit | 7c7c7f01cc5e3e423120a4848a73dd5e4586f2f9 (patch) | |
tree | bdd15c5e435b1a380adbf5c4a7d05e7ef44d7403 | |
parent | 252c3d84ed398b090ac2dace46fc6faa6cfaea99 (diff) |
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: Stephen Hemminger <shemminger@vyatta.com>
Acked-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/devices.txt | 3 | ||||
-rw-r--r-- | drivers/vhost/net.c | 8 | ||||
-rw-r--r-- | include/linux/miscdevice.h | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/Documentation/devices.txt b/Documentation/devices.txt index cec8864ce4e8..00383186d8fb 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt | |||
@@ -447,6 +447,9 @@ Your cooperation is appreciated. | |||
447 | 234 = /dev/btrfs-control Btrfs control device | 447 | 234 = /dev/btrfs-control Btrfs control device |
448 | 235 = /dev/autofs Autofs control device | 448 | 235 = /dev/autofs Autofs control device |
449 | 236 = /dev/mapper/control Device-Mapper control device | 449 | 236 = /dev/mapper/control Device-Mapper control device |
450 | 237 = /dev/loop-control Loopback control device | ||
451 | 238 = /dev/vhost-net Host kernel accelerator for virtio net | ||
452 | |||
450 | 240-254 Reserved for local use | 453 | 240-254 Reserved for local use |
451 | 255 Reserved for MISC_DYNAMIC_MINOR | 454 | 255 Reserved for MISC_DYNAMIC_MINOR |
452 | 455 | ||
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 882a51fe7b3c..9dab1f51dd43 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -856,9 +856,9 @@ static const struct file_operations vhost_net_fops = { | |||
856 | }; | 856 | }; |
857 | 857 | ||
858 | static struct miscdevice vhost_net_misc = { | 858 | static struct miscdevice vhost_net_misc = { |
859 | MISC_DYNAMIC_MINOR, | 859 | .minor = VHOST_NET_MINOR, |
860 | "vhost-net", | 860 | .name = "vhost-net", |
861 | &vhost_net_fops, | 861 | .fops = &vhost_net_fops, |
862 | }; | 862 | }; |
863 | 863 | ||
864 | static int vhost_net_init(void) | 864 | static int vhost_net_init(void) |
@@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1"); | |||
879 | MODULE_LICENSE("GPL v2"); | 879 | MODULE_LICENSE("GPL v2"); |
880 | MODULE_AUTHOR("Michael S. Tsirkin"); | 880 | MODULE_AUTHOR("Michael S. Tsirkin"); |
881 | MODULE_DESCRIPTION("Host kernel accelerator for virtio net"); | 881 | MODULE_DESCRIPTION("Host kernel accelerator for virtio net"); |
882 | MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR); | ||
883 | MODULE_ALIAS("devname:vhost-net"); | ||
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 32085249e9cb..0549d2115507 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -42,6 +42,7 @@ | |||
42 | #define AUTOFS_MINOR 235 | 42 | #define AUTOFS_MINOR 235 |
43 | #define MAPPER_CTRL_MINOR 236 | 43 | #define MAPPER_CTRL_MINOR 236 |
44 | #define LOOP_CTRL_MINOR 237 | 44 | #define LOOP_CTRL_MINOR 237 |
45 | #define VHOST_NET_MINOR 238 | ||
45 | #define MISC_DYNAMIC_MINOR 255 | 46 | #define MISC_DYNAMIC_MINOR 255 |
46 | 47 | ||
47 | struct device; | 48 | struct device; |