diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-07-03 21:52:58 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-07-03 21:55:07 -0400 |
commit | e6dc0418bcb96e3cccb80571f35934ed72e9c99a (patch) | |
tree | 18c261f3b26dae4d07f560c6bf712b130ee2f5ce | |
parent | 9b9cd8024a2882e896c65222aa421d461354e3f2 (diff) |
lguest: fix example launcher compilation for broken glibc headers.
Somehow a naked u16 slipped into the glibc headers on my Ubuntu machine
(i386 2.17-0ubuntu5), breaking compile:
In file included from lguest.c:46:0:
/usr/include/linux/virtio_net.h:188:2: error: unknown type name ‘u16’
We use the kernel-style types anyway, just define them before the includes.
Also remove the advice on adding missing headers: that no longer works.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | tools/lguest/Makefile | 1 | ||||
-rw-r--r-- | tools/lguest/lguest.c | 17 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tools/lguest/Makefile b/tools/lguest/Makefile index 0ac34206f7a7..97bca4871ea3 100644 --- a/tools/lguest/Makefile +++ b/tools/lguest/Makefile | |||
@@ -1,5 +1,4 @@ | |||
1 | # This creates the demonstration utility "lguest" which runs a Linux guest. | 1 | # This creates the demonstration utility "lguest" which runs a Linux guest. |
2 | # Missing headers? Add "-I../../../include -I../../../arch/x86/include" | ||
3 | CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE | 2 | CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE |
4 | 3 | ||
5 | all: lguest | 4 | all: lguest |
diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index a64f5cb0c15b..68f67cf3d318 100644 --- a/tools/lguest/lguest.c +++ b/tools/lguest/lguest.c | |||
@@ -42,14 +42,6 @@ | |||
42 | #include <pwd.h> | 42 | #include <pwd.h> |
43 | #include <grp.h> | 43 | #include <grp.h> |
44 | 44 | ||
45 | #include <linux/virtio_config.h> | ||
46 | #include <linux/virtio_net.h> | ||
47 | #include <linux/virtio_blk.h> | ||
48 | #include <linux/virtio_console.h> | ||
49 | #include <linux/virtio_rng.h> | ||
50 | #include <linux/virtio_ring.h> | ||
51 | #include <asm/bootparam.h> | ||
52 | #include "../../include/linux/lguest_launcher.h" | ||
53 | /*L:110 | 45 | /*L:110 |
54 | * We can ignore the 43 include files we need for this program, but I do want | 46 | * We can ignore the 43 include files we need for this program, but I do want |
55 | * to draw attention to the use of kernel-style types. | 47 | * to draw attention to the use of kernel-style types. |
@@ -65,6 +57,15 @@ typedef uint16_t u16; | |||
65 | typedef uint8_t u8; | 57 | typedef uint8_t u8; |
66 | /*:*/ | 58 | /*:*/ |
67 | 59 | ||
60 | #include <linux/virtio_config.h> | ||
61 | #include <linux/virtio_net.h> | ||
62 | #include <linux/virtio_blk.h> | ||
63 | #include <linux/virtio_console.h> | ||
64 | #include <linux/virtio_rng.h> | ||
65 | #include <linux/virtio_ring.h> | ||
66 | #include <asm/bootparam.h> | ||
67 | #include "../../include/linux/lguest_launcher.h" | ||
68 | |||
68 | #define BRIDGE_PFX "bridge:" | 69 | #define BRIDGE_PFX "bridge:" |
69 | #ifndef SIOCBRADDIF | 70 | #ifndef SIOCBRADDIF |
70 | #define SIOCBRADDIF 0x89a2 /* add interface to bridge */ | 71 | #define SIOCBRADDIF 0x89a2 /* add interface to bridge */ |