Skip to contentSkip to conversation

virtio_ids: let virtio header files include virtio_ids.h and export it

PATCH Applied Christian Borntraeger 2 participants 3 messages Sep 30, 2009

Subsystems (12)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio_ids: let virtio header files include virtio_ids.h and export it

[PATCH] virtio_ids: 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.

CCed: Fernando Luis Vazquez Cao <[email protected]>

---
 Documentation/lguest/lguest.c       |    1 -
 drivers/block/virtio_blk.c          |    1 -
 drivers/char/hw_random/virtio-rng.c |    1 -
 drivers/char/virtio_console.c       |    1 -
 drivers/net/virtio_net.c            |    1 -
 drivers/virtio/virtio_balloon.c     |    1 -
 include/linux/Kbuild                |    1 +
 include/linux/virtio_9p.h           |    1 +
 include/linux/virtio_balloon.h      |    1 +
 include/linux/virtio_blk.h          |    1 +
 include/linux/virtio_console.h      |    1 +
 include/linux/virtio_net.h          |    1 +
 include/linux/virtio_rng.h          |    1 +
 net/9p/trans_virtio.c               |    1 -
 14 files changed, 7 insertions(+), 7 deletions(-)
Documentation/lguest/lguest.c +0 -1
Index: linux-2.6/Documentation/lguest/lguest.c
===================================================================
@@ -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"
drivers/block/virtio_blk.c +0 -1
Index: linux-2.6/drivers/block/virtio_blk.c
===================================================================
@@ -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>
 
drivers/char/hw_random/virtio-rng.c +0 -1
Index: linux-2.6/drivers/char/hw_random/virtio-rng.c
===================================================================
@@ -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
drivers/char/virtio_console.c +0 -1
Index: linux-2.6/drivers/char/virtio_console.c
===================================================================
@@ -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"
 
drivers/net/virtio_net.c +0 -1
Index: linux-2.6/drivers/net/virtio_net.c
===================================================================
@@ -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>
drivers/virtio/virtio_balloon.c +0 -1
Index: linux-2.6/drivers/virtio/virtio_balloon.c
===================================================================
@@ -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>
include/linux/Kbuild +1 -0
Index: linux-2.6/include/linux/Kbuild
===================================================================
@@ -363,6 +363,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
include/linux/virtio_9p.h +1 -0
Index: linux-2.6/include/linux/virtio_9p.h
===================================================================
@@ -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) */
include/linux/virtio_balloon.h +1 -0
Index: linux-2.6/include/linux/virtio_balloon.h
===================================================================
@@ -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 */
include/linux/virtio_blk.h +1 -0
Index: linux-2.6/include/linux/virtio_blk.h
===================================================================
@@ -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 */
include/linux/virtio_console.h +1 -0
Index: linux-2.6/include/linux/virtio_console.h
===================================================================
@@ -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. */
include/linux/virtio_net.h +1 -0
Index: linux-2.6/include/linux/virtio_net.h
===================================================================
@@ -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>
 
include/linux/virtio_rng.h +1 -0
Index: linux-2.6/include/linux/virtio_rng.h
===================================================================
@@ -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 */
net/9p/trans_virtio.c +0 -1
Index: linux-2.6/net/9p/trans_virtio.c
===================================================================
@@ -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
#1 lore raw
Quoted 1 line · Christian Borntraeger

[PATCH] virtio_ids: let header files include virtio_ids.h

Thanks, applied.

Rusty.