ia64/xen-unstable

view tools/blktap2/drivers/Makefile @ 19647:1c627434605e

blktap2: a completely rewritten blktap implementation

Benefits to blktap2 over the old version of blktap:

* Isolation from xenstore - Blktap devices are now created directly on
the linux dom0 command line, rather than being spawned in response
to XenStore events. This is handy for debugging, makes blktap
generally easier to work with, and is a step toward a generic
user-level block device implementation that is not Xen-specific.

* Improved tapdisk infrastructure: simpler request forwarding, new
request scheduler, request merging, more efficient use of AIO.

* Improved tapdisk error handling and memory management. No
allocations on the block data path, IO retry logic to protect
guests
transient block device failures. This has been tested and is known
to work on weird environments such as NFS soft mounts.

* Pause and snapshot of live virtual disks (see xmsnap script).

* VHD support. The VHD code in this release has been rigorously
tested, and represents a very mature implementation of the VHD
image
format.

* No more duplication of mechanism with blkback. The blktap kernel
module has changed dramatically from the original blktap. Blkback
is now always used to talk to Xen guests, blktap just presents a
Linux gendisk that blkback can export. This is done while
preserving the zero-copy data path from domU to physical device.

These patches deprecate the old blktap code, which can hopefully be
removed from the tree completely at some point in the future.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Dutch Meyer <dmeyer@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 26 11:52:31 2009 +0100 (2009-05-26)
parents
children 241607f414c8
line source
1 XEN_ROOT=../../../
2 BLKTAP_ROOT= ..
3 include $(XEN_ROOT)/tools/Rules.mk
5 LIBVHDDIR = $(BLKTAP_ROOT)/vhd/lib
7 IBIN = tapdisk 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 tapdisk tapdisk2 td-util tapdisk-stream tapdisk-diff $(QCOW_UTIL): LIBS += -L$(LIBVHDDIR) -lvhd -luuid
39 LIBAIO_DIR = $(XEN_ROOT)/tools/libaio/src
40 tapdisk tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := $(LIBAIO_DIR)/libaio.a
41 tapdisk 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
74 tapdisk: $(TAP-OBJS-y) $(BLK-OBJS-y) $(MISC-OBJS-y) tapdisk.c
75 $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(AIOLIBS) $(LDFLAGS_img)
77 tapdisk2: $(TAP-OBJS-y) $(BLK-OBJS-y) $(MISC-OBJS-y) tapdisk2.c
78 $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(AIOLIBS) $(LDFLAGS_img)
80 tapdisk-client: tapdisk-client.o
81 $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS_img)
83 tapdisk-stream tapdisk-diff: %: %.o $(TAP-OBJS-y) $(BLK-OBJS-y)
84 $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(AIOLIBS) $(LDFLAGS_img)
86 td-util: td.o tapdisk-utils.o tapdisk-log.o
87 $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS_img)
89 lock-util: lock.c
90 $(CC) $(CFLAGS) -DUTIL -o lock-util lock.c $(LIBS)
92 .PHONY: qcow-util
93 qcow-util: img2qcow qcow2raw qcow-create
95 img2qcow qcow2raw qcow-create: %: %.o $(TAP-OBJS-y) $(BLK-OBJS-y)
96 $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(AIOLIBS) $(LDFLAGS_img)
98 install: all
99 $(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
100 $(INSTALL_PROG) $(IBIN) $(LOCK_UTIL) $(QCOW_UTIL) $(DESTDIR)$(INST_DIR)
102 clean:
103 rm -rf *.o *~ xen TAGS $(IBIN) $(LIB) $(LOCK_UTIL) $(QCOW_UTIL)
105 .PHONY: clean install