ia64/xen-unstable

view tools/blktap2/drivers/Makefile @ 19795:4f779d41b0ba

blktap: re-enable blktap1 if blktap2 is disabled

This patch re-enables a useful blktap1 for users who disable blktap2.
Itremoves tapdisk and blktapctrl from blktap2, both of which cause
problems with blktap operation. In addition, this patch modifies xend
to check for blktap2 installation. If the blktap2 driver isn't
running (hopefully because the dom0 kernel option wasn't selected) we
fall back to blktap.

Signed-off-by: Dutch Meyer <dmeyer@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 18 10:29:58 2009 +0100 (2009-06-18)
parents 241607f414c8
children b7f73a7f3078
line source
1 XEN_ROOT=../../../
2 BLKTAP_ROOT= ..
3 include $(XEN_ROOT)/tools/Rules.mk
5 LIBVHDDIR = $(BLKTAP_ROOT)/vhd/lib
7 IBIN = tapdisk2 td-util tapdisk-client tapdisk-stream tapdisk-diff
8 QCOW_UTIL = img2qcow qcow-create qcow2raw
9 LOCK_UTIL = lock-util
10 INST_DIR = $(SBINDIR)
12 CFLAGS += -Werror -g -O0
13 CFLAGS += -Wno-unused
14 CFLAGS += -fno-strict-aliasing
15 CFLAGS += -I../lib -I../../libxc
16 CFLAGS += -I../include -I../../include
17 CFLAGS += -I $(LIBAIO_DIR)
18 CFLAGS += -D_GNU_SOURCE
19 CFLAGS += -DUSE_NFS_LOCKS
21 ifeq ($(CONFIG_X86_64),y)
22 CFLAGS += -fPIC
23 endif
25 LIBS += -lrt -lz
27 ifeq ($(shell . ./check_gcrypt $(CC)),yes)
28 CFLAGS += -DUSE_GCRYPT
29 CRYPT_LIB += -lgcrypt
30 else
31 CRYPT_LIB += -lcrypto
32 $(warning === libgcrypt not installed: falling back to libcrypto ===)
33 endif
35 LDFLAGS_img := $(CRYPT_LIB) -lpthread -lz
37 tapdisk2 td-util tapdisk-stream tapdisk-diff $(QCOW_UTIL): LIBS += -L$(LIBVHDDIR) -lvhd -luuid
39 LIBAIO_DIR = $(XEN_ROOT)/tools/libaio/src
40 tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := $(LIBAIO_DIR)/libaio.a
41 tapdisk-client tapdisk-stream tapdisk-diff $(QCOW_UTIL): CFLAGS += -I$(LIBAIO_DIR) -I$(XEN_LIBXC)
43 ifeq ($(VHD_STATIC),y)
44 td-util: CFLAGS += -static
45 endif
47 TAP-OBJS-y := scheduler.o
48 TAP-OBJS-y += tapdisk-ipc.o
49 TAP-OBJS-y += tapdisk-vbd.o
50 TAP-OBJS-y += tapdisk-image.o
51 TAP-OBJS-y += tapdisk-driver.o
52 TAP-OBJS-y += tapdisk-interface.o
53 TAP-OBJS-y += tapdisk-server.o
54 TAP-OBJS-y += tapdisk-queue.o
55 TAP-OBJS-y += tapdisk-filter.o
56 TAP-OBJS-y += tapdisk-log.o
57 TAP-OBJS-y += tapdisk-utils.o
58 TAP-OBJS-y += io-optimize.o
59 TAP-OBJS-y += lock.o
60 TAP-OBJS-$(CONFIG_Linux) += blk_linux.o
62 MISC-OBJS-y := atomicio.o
64 BLK-OBJS-y := block-aio.o
65 BLK-OBJS-y += block-ram.o
66 BLK-OBJS-y += block-cache.o
67 BLK-OBJS-y += block-vhd.o
68 BLK-OBJS-y += block-log.o
69 BLK-OBJS-y += block-qcow.o
70 BLK-OBJS-y += aes.o
72 all: $(IBIN) lock-util qcow-util
75 tapdisk2: $(TAP-OBJS-y) $(BLK-OBJS-y) $(MISC-OBJS-y) tapdisk2.c
76 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(AIOLIBS) $(LDFLAGS_img)
78 tapdisk-client: tapdisk-client.o
79 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(LDFLAGS_img)
81 tapdisk-stream tapdisk-diff: %: %.o $(TAP-OBJS-y) $(BLK-OBJS-y)
82 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(AIOLIBS) $(LDFLAGS_img)
84 td-util: td.o tapdisk-utils.o tapdisk-log.o
85 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(LDFLAGS_img)
87 lock-util: lock.c
88 $(CC) $(CFLAGS) -DUTIL -o lock-util lock.c $(LDFLAGS) $(LIBS)
90 .PHONY: qcow-util
91 qcow-util: img2qcow qcow2raw qcow-create
93 img2qcow qcow2raw qcow-create: %: %.o $(TAP-OBJS-y) $(BLK-OBJS-y)
94 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(AIOLIBS) $(LDFLAGS_img)
96 install: all
97 $(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
98 $(INSTALL_PROG) $(IBIN) $(LOCK_UTIL) $(QCOW_UTIL) $(DESTDIR)$(INST_DIR)
100 clean:
101 rm -rf *.o *~ xen TAGS $(IBIN) $(LIB) $(LOCK_UTIL) $(QCOW_UTIL)
103 .PHONY: clean install