Skip to content

Commit

Permalink
virtio: let header files include virtio_ids.h
Browse files Browse the repository at this point in the history
Rusty,

commit 3ca4f5c
    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 <[email protected]>
Signed-off-by: Christian Borntraeger <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
borntraeger authored and rustyrussell committed Oct 22, 2009
1 parent f8b12e5 commit e95646c
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <signal.h>
#include "linux/lguest_launcher.h"
#include "linux/virtio_config.h"
#include <linux/virtio_ids.h>
#include "linux/virtio_net.h"
#include "linux/virtio_blk.h"
#include "linux/virtio_console.h"
Expand Down
1 change: 0 additions & 1 deletion drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_blk.h>
#include <linux/scatterlist.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/char/hw_random/virtio-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/scatterlist.h>
#include <linux/spinlock.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_rng.h>

/* The host will fill any buffer we give it with sweet, sweet randomness. We
Expand Down
1 change: 0 additions & 1 deletion drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <linux/err.h>
#include <linux/init.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_console.h>
#include "hvc_console.h"

Expand Down
1 change: 0 additions & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/ethtool.h>
#include <linux/module.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_net.h>
#include <linux/scatterlist.h>
#include <linux/if_vlan.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/virtio/virtio_balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
//#define DEBUG
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_balloon.h>
#include <linux/swap.h>
#include <linux/kthread.h>
Expand Down
1 change: 1 addition & 0 deletions include/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ unifdef-y += utsname.h
unifdef-y += videodev2.h
unifdef-y += videodev.h
unifdef-y += virtio_config.h
unifdef-y += virtio_ids.h
unifdef-y += virtio_blk.h
unifdef-y += virtio_net.h
unifdef-y += virtio_9p.h
Expand Down
1 change: 1 addition & 0 deletions include/linux/virtio_9p.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _LINUX_VIRTIO_9P_H
/* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers. */
#include <linux/virtio_ids.h>
#include <linux/virtio_config.h>

/* Maximum number of virtio channels per partition (1 for now) */
Expand Down
1 change: 1 addition & 0 deletions include/linux/virtio_balloon.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _LINUX_VIRTIO_BALLOON_H
/* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers. */
#include <linux/virtio_ids.h>
#include <linux/virtio_config.h>

/* The feature bitmap for virtio balloon */
Expand Down
1 change: 1 addition & 0 deletions include/linux/virtio_blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers. */
#include <linux/types.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_config.h>

/* Feature bits */
Expand Down
1 change: 1 addition & 0 deletions include/linux/virtio_console.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _LINUX_VIRTIO_CONSOLE_H
#define _LINUX_VIRTIO_CONSOLE_H
#include <linux/types.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_config.h>
/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
* anyone can use the definitions to implement compatible drivers/servers. */
Expand Down
1 change: 1 addition & 0 deletions include/linux/virtio_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers. */
#include <linux/types.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_config.h>
#include <linux/if_ether.h>

Expand Down
1 change: 1 addition & 0 deletions include/linux/virtio_rng.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _LINUX_VIRTIO_RNG_H
/* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers. */
#include <linux/virtio_ids.h>
#include <linux/virtio_config.h>

#endif /* _LINUX_VIRTIO_RNG_H */
1 change: 0 additions & 1 deletion net/9p/trans_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <net/9p/transport.h>
#include <linux/scatterlist.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_9p.h>

#define VIRTQUEUE_NUM 128
Expand Down

0 comments on commit e95646c

Please sign in to comment.