Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio: let header files include virtio_ids.h

Rusty,

commit 3ca4f5ca73057a617f9444a91022d7127041970a
virtio: add virtio IDs file
moved all device IDs into a single file. While the change itself is
a very good one, it can break userspace applications. For example
if a userspace tool wanted to get the ID of virtio_net it used to
include virtio_net.h. This does no longer work, since virtio_net.h
does not include virtio_ids.h.
This patch moves all "#include <linux/virtio_ids.h>" from the C
files into the header files, making the header files compatible with
the old ones.

In addition, this patch exports virtio_ids.h to userspace.

CC: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

authored by

Christian Borntraeger and committed by
Rusty Russell
e95646c3 f8b12e51

+7 -7
-1
Documentation/lguest/lguest.c
··· 42 42 #include <signal.h> 43 43 #include "linux/lguest_launcher.h" 44 44 #include "linux/virtio_config.h" 45 - #include <linux/virtio_ids.h> 46 45 #include "linux/virtio_net.h" 47 46 #include "linux/virtio_blk.h" 48 47 #include "linux/virtio_console.h"
-1
drivers/block/virtio_blk.c
··· 3 3 #include <linux/blkdev.h> 4 4 #include <linux/hdreg.h> 5 5 #include <linux/virtio.h> 6 - #include <linux/virtio_ids.h> 7 6 #include <linux/virtio_blk.h> 8 7 #include <linux/scatterlist.h> 9 8
-1
drivers/char/hw_random/virtio-rng.c
··· 21 21 #include <linux/scatterlist.h> 22 22 #include <linux/spinlock.h> 23 23 #include <linux/virtio.h> 24 - #include <linux/virtio_ids.h> 25 24 #include <linux/virtio_rng.h> 26 25 27 26 /* The host will fill any buffer we give it with sweet, sweet randomness. We
-1
drivers/char/virtio_console.c
··· 31 31 #include <linux/err.h> 32 32 #include <linux/init.h> 33 33 #include <linux/virtio.h> 34 - #include <linux/virtio_ids.h> 35 34 #include <linux/virtio_console.h> 36 35 #include "hvc_console.h" 37 36
-1
drivers/net/virtio_net.c
··· 22 22 #include <linux/ethtool.h> 23 23 #include <linux/module.h> 24 24 #include <linux/virtio.h> 25 - #include <linux/virtio_ids.h> 26 25 #include <linux/virtio_net.h> 27 26 #include <linux/scatterlist.h> 28 27 #include <linux/if_vlan.h>
-1
drivers/virtio/virtio_balloon.c
··· 19 19 */ 20 20 //#define DEBUG 21 21 #include <linux/virtio.h> 22 - #include <linux/virtio_ids.h> 23 22 #include <linux/virtio_balloon.h> 24 23 #include <linux/swap.h> 25 24 #include <linux/kthread.h>
+1
include/linux/Kbuild
··· 364 364 unifdef-y += videodev2.h 365 365 unifdef-y += videodev.h 366 366 unifdef-y += virtio_config.h 367 + unifdef-y += virtio_ids.h 367 368 unifdef-y += virtio_blk.h 368 369 unifdef-y += virtio_net.h 369 370 unifdef-y += virtio_9p.h
+1
include/linux/virtio_9p.h
··· 2 2 #define _LINUX_VIRTIO_9P_H 3 3 /* This header is BSD licensed so anyone can use the definitions to implement 4 4 * compatible drivers/servers. */ 5 + #include <linux/virtio_ids.h> 5 6 #include <linux/virtio_config.h> 6 7 7 8 /* Maximum number of virtio channels per partition (1 for now) */
+1
include/linux/virtio_balloon.h
··· 2 2 #define _LINUX_VIRTIO_BALLOON_H 3 3 /* This header is BSD licensed so anyone can use the definitions to implement 4 4 * compatible drivers/servers. */ 5 + #include <linux/virtio_ids.h> 5 6 #include <linux/virtio_config.h> 6 7 7 8 /* The feature bitmap for virtio balloon */
+1
include/linux/virtio_blk.h
··· 3 3 /* This header is BSD licensed so anyone can use the definitions to implement 4 4 * compatible drivers/servers. */ 5 5 #include <linux/types.h> 6 + #include <linux/virtio_ids.h> 6 7 #include <linux/virtio_config.h> 7 8 8 9 /* Feature bits */
+1
include/linux/virtio_console.h
··· 1 1 #ifndef _LINUX_VIRTIO_CONSOLE_H 2 2 #define _LINUX_VIRTIO_CONSOLE_H 3 3 #include <linux/types.h> 4 + #include <linux/virtio_ids.h> 4 5 #include <linux/virtio_config.h> 5 6 /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so 6 7 * anyone can use the definitions to implement compatible drivers/servers. */
+1
include/linux/virtio_net.h
··· 3 3 /* This header is BSD licensed so anyone can use the definitions to implement 4 4 * compatible drivers/servers. */ 5 5 #include <linux/types.h> 6 + #include <linux/virtio_ids.h> 6 7 #include <linux/virtio_config.h> 7 8 #include <linux/if_ether.h> 8 9
+1
include/linux/virtio_rng.h
··· 2 2 #define _LINUX_VIRTIO_RNG_H 3 3 /* This header is BSD licensed so anyone can use the definitions to implement 4 4 * compatible drivers/servers. */ 5 + #include <linux/virtio_ids.h> 5 6 #include <linux/virtio_config.h> 6 7 7 8 #endif /* _LINUX_VIRTIO_RNG_H */
-1
net/9p/trans_virtio.c
··· 43 43 #include <net/9p/transport.h> 44 44 #include <linux/scatterlist.h> 45 45 #include <linux/virtio.h> 46 - #include <linux/virtio_ids.h> 47 46 #include <linux/virtio_9p.h> 48 47 49 48 #define VIRTQUEUE_NUM 128