On Wed, 2010-12-15 at 22:15 +0000, Martinx - ããããã wrote:
>
> Â Â Â Â gcc Â-O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls
> Â Â Â Â -m32 -march=i686 -g -fno-strict-aliasing -std=gnu99 -Wall
> Â Â Â Â -Wstrict-prototypes -Wno-unused-value
> Â Â Â Â -Wdeclaration-after-statement Â-D__XEN_TOOLS__ -MMD
> Â Â Â Â -MF .blk_linux.o.d -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> Â Â Â Â -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> Â Â Â Â -mno-tls-direct-seg-refs -Werror -Wno-unused -I../lib
> Â Â Â Â -I../../../tools/libxc -I../../../tools/include
> Â Â Â Â -I../../../tools/xenstore -I../../../tools/include
> Â Â Â Â -I ../../libaio/src -I ../../memshr -D_GNU_SOURCE -DMEMSHR -c
> Â Â Â Â -o blk_linux.o blk_linux.c
> Â Â Â Â cc1: warnings being treated as errors
> Â Â Â Â In file included from tapdisk.h:62:0,
> Â Â Â Â Â Â Â Â Â Â Â Â Âfrom blk_linux.c:4:
> Â Â Â Â ../lib/blktaplib.h:199:0: error: "WRITE" redefined
> Â Â Â Â /usr/include/linux/fs.h:160:0: note: this is the location of
> Â Â Â Â the previous definition
The headers on natty appear to include a definition of WRITE which
conflicts with the use of that name in blktap.
This should avoid the issue.
Ian.
8<---------------------------------------
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1292492034 0
# Node ID 0236d8adb081b93e509ec52654201ce88ad6570b
# Parent Âd70d7c3311c495305ac1bde256122b09c58463e5
blktap[12]: include <sys/mount.h> instead of <linux/fs.h>
The former is a userspace sanitised header which contains the
definitions we need. In some distros linux/fs.h defines WRITE which
conflicts with blktaps own use of that name.
Also there is no reason to use <linux/errno.h> over the more normal
<errno.h>.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r d70d7c3311c4 -r 0236d8adb081 tools/blktap/drivers/blk_linux.c
--- a/tools/blktap/drivers/blk_linux.c ÂTue Dec 14 17:10:49 2010 +0000
+++ b/tools/blktap/drivers/blk_linux.c ÂThu Dec 16 09:33:54 2010 +0000
@@ -1,6 +1,6 @@
Â#include <inttypes.h>
Â#include <sys/ioctl.h>
-#include <linux/fs.h>
+#include <sys/mount.h>
Â#include "tapdisk.h"
Â#include "blk.h"
diff -r d70d7c3311c4 -r 0236d8adb081 tools/blktap2/drivers/blk_linux.c
--- a/tools/blktap2/drivers/blk_linux.c Tue Dec 14 17:10:49 2010 +0000
+++ b/tools/blktap2/drivers/blk_linux.c Thu Dec 16 09:33:54 2010 +0000
@@ -1,7 +1,7 @@
Â#include <inttypes.h>
+#include <errno.h>
Â#include <sys/ioctl.h>
-#include <linux/fs.h>
-#include <linux/errno.h>
+#include <sys/mount.h>
Â#include "tapdisk.h"
Â#include "blk.h"