aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap2
Commit message (Collapse)AuthorAgeFilesLines
...
* blktap2: Add tap_ctl_find_minorKeir Fraser2010-06-102-0/+31
| | | | | | Slack 'tap-ctl find -t <type> -f <path>'. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Fix broken tap-ctl-list type/path filter logicKeir Fraser2010-06-101-2/+2
| | | | Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Fix toolstack build on NetBSDKeir Fraser2010-06-091-2/+2
| | | | Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: <sys/time.h> is needed for 'struct timeval'Keir Fraser2010-06-092-3/+3
| | | | | | Also clean up a Makefile to use $(SBINDIR). Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* blktap2: The tap-ctl userspace control utility and library.Keir Fraser2010-06-0829-438/+4001
| | | | | | | | | | | | | | | | | | Tapdisk control in userspace, a replacement for the original blktap2 control stack, which had to pass a kernel space interface based on sysfs nodes. All tapdisk processes listen for commands on a unix stream socket. The control library supports scanning the socket namespace for running tapdisks, VBD minors allocated, associated images and state inquiry. Control operations include allocating/releasing devices, spawning tapdisks, opening/closing images, attaching disk images to devices. disk pause/resume operations and runtime switching of disk images. Signed-off-by: Jake Wires <jake.wires@citrix.com> Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Cleanup vdi stacking code.Keir Fraser2010-06-085-107/+126
| | | | | | | Removes some rough edges, memory leakage (?), fixes __list_splice, ... Signed-off-by: Jake Wires <jake.wires@citrix.com> Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Fix E/DPRINTF defs all around the driver/ subdir.Keir Fraser2010-06-085-13/+4
| | | | | | | This is just to avoid macro madness among subdirs sharing blktaplib.h. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com> Signed-off-by: Jake Wires <jake.wires@citrix.com>
* blktap2: Fix tapdisk disktype issues.Keir Fraser2010-06-0823-284/+312
| | | | | | | | | Stop coercing drivers/disktype code into the tool stack. Make both blktapctrl and tap-ctl transfer type/path pairs as "<type>:<path>" strings. Remove the message.disktype integer altogether. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com> Signed-off-by: Jake Wires <jake.wires@citrix.com>
* blktap2: Remove LVM hacks.Keir Fraser2010-06-081-288/+0
| | | | | | | These only mattered for XCP's LVHD with blktap1. Signed-off-by: Jake Wires <jake.wires@citrix.com> Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Remove tapdisk-ipc module.Keir Fraser2010-06-0812-463/+17
| | | | | | | Obsoleted with blktapctrl. Signed-off-by: Jake Wires <jake.wires@citrix.com> Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* bltap2: implement md5 directly, to remove ssl dependencyKeir Fraser2010-06-075-45/+296
| | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* blktap/fs-back: Build fixes for Fedora 13Keir Fraser2010-03-153-0/+3
| | | | | | | | | | | | | 1. Some files use stat, mkfifo, mkdir etc. without including sys/stat.h 2. Some programs link against libpthread without a -lpthread compile option. The compile used to work if this library happened to be used by one of the other libraries that was being linked against, but Fedora 13 has stopped allowing this. From: M A Young <m.a.young@durham.ac.uk> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap: provide a variant of __RING_SIZE() that is an integer constant ↵Keir Fraser2010-03-061-1/+1
| | | | | | | | | expression Without this new variant, gcc 4.5 won't compile where this is being used to specify array sizes. See also c/s 20975. Signed-off-by: Charles Arnold <carnold@novell.com>
* Remus: increase failover timeout from 500ms to 1sKeir Fraser2010-02-121-5/+5
| | | | | | | | 500ms is aggressive enough to trigger split-brain under fairly ordinary workloads, particularly for HVM. The long-term fix is to integrate with a real HA monitor like linux HA. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* blktap2: disable presently broken memshr extensionKeir Fraser2010-02-111-1/+1
| | | | Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Fix non-Linux buildKeir Fraser2010-02-051-0/+4
| | | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* tools: Do not append trailing slash to XEN_ROOT in MakefilesKeir Fraser2010-02-045-9/+9
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: Prefer AIO eventfd support on kernels >= 2.6.22Keir Fraser2010-01-295-31/+273
| | | | | | | | | | | | Mainline kernel support for eventfd(2) in linux aio was added between 2.6.21 and 2.6.22. Libaio after 0.3.107 has the header file, but presently few systems support it. Neither do we rely on an up-to-date libc6. Instead, this patch adds a header which defines custom iocb_common struct, and works around a potentially missing sys/eventfd.h. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Separate tapdisk raw I/O into different backends.Keir Fraser2010-01-295-137/+306
| | | | | | | | | | | | | | | | | | Hide tapdisk support for different raw I/O interfaces behind a new struct tio. Libaio remains to dominate the interface, requiring everyone to dispatch iocb/ioevent structs. Backends: - lio: Kernel AIO via libaio. - rwio: Canonical read/write() mode. Misc: - Fixes a bug in tapdisk-vbd which locks up the sync io mode. - Wants a PERROR macro in blktaplib.h - Removes dead code in qcow2raw to make it link again. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com> Signed-off-by: Jake Wires <jake.wires@citrix.com>
* blktap2: Sort out tapdisk AIO init.Keir Fraser2010-01-296-63/+64
| | | | | | | Move event callbacks registration into tapdisk-queue. This should also obsoletes the dummy pollfd pipe in the synchronous I/O case. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Sort out tapdisk IPC init.Keir Fraser2010-01-294-58/+95
| | | | | | | Move I/O and event callbacks setup out of tapdisk-server, into tapdisk-ipc. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap: make memshr optionalKeir Fraser2010-01-125-43/+72
| | | | | | | | Attached patch makes memshr optional for blktap/blktap2. This fixes build for platforms where memshr isn't build on. While there, make indentation consistent. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* Reads from read only parent disk images are intercepted, and are used to detectKeir Fraser2009-12-173-3/+54
| | | | | | potentially sharable memory pages. Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Multiple tapdisk2 processes may use the same parent disk images (later used toKeir Fraser2009-12-172-4/+8
| | | | | | | | detect sharable memory pages). This patch establishes unique id for each disk image opened by tapdisk2, and stores it in shared memory region, thus making it available to the remaining tapdisk2s. Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Adds 'memory_sharing' option to domain config scripts. It passes domain id toKeir Fraser2009-12-171-1/+6
| | | | | | | the tapdisk2 process if sharing is enabled (tapdisk2 is not normally aware what domain it is working for). Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Generic bi-directional map, and related initialisation functions. At the momentKeir Fraser2009-12-172-4/+10
| | | | | | | | | | | | | a single map is used to store mappings between sharing handles and disk blocks. This is used to share pages which store data read of the same blocks on (virtual) disk. Note that the map is stored in a shared memory region, as it needs to be accessed by multiple tapdisk processes. This complicates memory allocation (malloc cannot be used), prevents poniters to be stored directly (as the shared memory region might and is mapped at different base address) and finally pthread locks need to be multi-process aware. Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Request re-coalescing for qcow disks. qcow driver had the habit of breaking eachKeir Fraser2009-12-171-0/+11
| | | | | | | (4K) block read into 8 (512 bytes) sector reads. This is inefficient, but also prevents sharing detector from working, as it is based on page-size reads. Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* blktap2: fix libgcrypt detectionKeir Fraser2009-11-231-2/+1
| | | | | | | | If we want to check the functionality of libgcrypt, we shouldn't test a function only exported by openssl, but instead the one actually used in the code. Signed-off-by: Andre Przywara <andre.przywara@amd.com>
* blktap2: Remove uninitialised variable rc from tdremus_close().Keir Fraser2009-11-171-2/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: Remove gnu89-inline option from CFLAGSKeir Fraser2009-11-113-23/+13
| | | | | | Not supported by older versions of gcc. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* tools: Make build again on netbsdKeir Fraser2009-11-101-3/+7
| | | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: add remus driverKeir Fraser2009-11-098-1/+2393
| | | | | | | | Blktap2 port of remus disk driver. Backwards compatable with blktap1 implementation. Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca> Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* blktap2: only open driver stack onceKeir Fraser2009-11-091-0/+2
| | | | | | | | | | Currently blktap2 opens a driver stack, closes it, and re-opens it. This causes problems with our remus driver: the primary may connect to the backup in between the first and second open. This is a temporary fix. Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
* blktap2: configurable driver chainsKeir Fraser2009-11-094-26/+217
| | | | | | | | | | | | | | | | Blktap2 allows block device drivers to be layered to create more advanced virtual block devices. However, composing a layered driver is not exposed to the user. This patch fixes this, and allows the user to explicitly specify a driver chain when starting a tapdisk process, using the pipe character ('|') to explicitly seperate layers in a blktap2 configuration string. for example, the command: ~$ tapdisk2 -n "log:|aio:/path/to/file.img" will create a blktap2 device where read and write requests are passed to the 'log' driver, then forwarded to the 'aio' driver. Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
* blktap2: Check gcrypt library has MD5() function.Keir Fraser2009-10-091-1/+6
| | | | | From: Dulloor <dulloor@gmail.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: Fix off-by-one error in driver lookupKeir Fraser2009-09-151-1/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: Fix compile warning with gcc4.Keir Fraser2009-07-081-0/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* tools: Always check for __linux__ not __Linux__Keir Fraser2009-07-023-8/+8
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: A final few NetBSD fixesKeir Fraser2009-06-243-7/+11
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* blktap2: Further netbsd build fixes.Keir Fraser2009-06-249-43/+117
| | | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: Fix a & vs && typoKeir Fraser2009-06-241-1/+1
| | | | Signed-off-by: Jun Koi <junkoi2004@gmail.com>
* blktap2: Fix some printf format specifiers (PRIu64).Keir Fraser2009-06-242-3/+4
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: portability fixes for NetBSDKeir Fraser2009-06-2334-239/+368
| | | | | | | | | | | | | - Use standard off_t and lseek() instead of non-portable off64_t and lseek64() - Use uuid API as documented in DCE 1.1 RPC specification - Add NetBSD implementation for blk_getimagesize() and blk_getsectorsize() - Use blk_getimagesize() and blk_getsectorsize() - Fix uuid header check Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap: re-enable blktap1 if blktap2 is disabledKeir Fraser2009-06-1811-2736/+4
| | | | | | | | | | | 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>
* blktap2/vhd, daemon: serialize subdirs-all and subdirs-installKeir Fraser2009-06-162-6/+6
| | | | | | | | make install in vhd and daemon, subdirs-all and subdirs-install are invoked parallel causing nasty error. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
* blktap2: README updatesKeir Fraser2009-06-051-47/+246
| | | | | | | | As promised, this brings the long out-of-sync documentation up to date, and adds some getting started information about tapdisk driver development - I get the occasional email on this latter subject. Signed-off-by: Dutch Meyer <dmeyer@cs.ubc.ca>
* blktap2: fix parallel Make.Keir Fraser2009-06-042-3/+9
| | | | | | | | | | | sub make in tools/blktap2/daemon/lib and tools/lvd/lib can be triggered many times at the same time which results in weired link error because one target is linking a library while another target is trying to recreate the library. This patch makes it invoke submake only once. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* blktap2: fix a compilation error (missing PATH_MAX)Keir Fraser2009-05-291-0/+1
| | | | Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
* blktap2: Fix build with gcc3. Cannot handle defining a function whichKeir Fraser2009-05-282-7/+7
| | | | | | | | | | is passed a struct-by-value which is not yet fully defined. Thus defining a request struct which contains a pointer to a function which is passed-by-value an instance of that request structure is impossible. We work around it by defining the function poiinter as void* and then casting in one place. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap2: fix tapdisk-channel.cKeir Fraser2009-05-281-1/+1
| | | | | | | | | | | | This patch fixes the following error. cc1: warnings being treated as errors In file included from usr/include/sys/resource.h:25, from tapdisk-daemon.c:559: usr/include/bits/resource.h: In function 'main': usr/include/bits/resource.h:33: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>