aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap
Commit message (Collapse)AuthorAgeFilesLines
* blktap: Fix old QCow tapdisk image handlingKeir Fraser2010-05-041-10/+9
| | | | | | | | | | When I tried to use QCow image, I found that only each second boot is successful. As I discovered, this is caused by wrong handling old qcow tapdisk images. Extended header flag is not stored correctly so the blktap tries to change endian fo L1 table on each startup. From: Miroslav Rezanina <mrezanin@redhat.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap/fs-back: Build fixes for Fedora 13Keir Fraser2010-03-153-1/+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>
* blktap: fix blktapctrl abortKeir Fraser2010-01-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | On rebooting a hvm, the blktapctrl daemon has died. gdb shows the following call trace: (gdb) where #0 0x00000039d1830155 in raise () from /lib64/libc.so.6 #1 0x00000039d1831bf0 in abort () from /lib64/libc.so.6 #2 0x00000039d186a38b in __libc_message () from /lib64/libc.so.6 #3 0x00000039d1871634 in _int_free () from /lib64/libc.so.6 #4 0x00000039d1874c5c in free () from /lib64/libc.so.6 #5 0x0000003320a01bdd in ueblktap_probe (h=3D0x6073b0,=20 w=<value optimized out>, bepath_im=<value optimized out>) at xenbus.c:270 #6 0x0000003320a020e0 in xs_fire_next_watch (h=3D0x6073b0) at xs_api.c:355 #7 0x0000000000401785 in main (argc=3D<value optimized out>, argv=<value optimized out>) at blktapctrl.c:907 There is a case that "/local/domain/0/backend/tap/<dom_id>" exists but "/local/domain/<dom_id>/vm" is not in the xenstore. Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
* blktap: make memshr optionalKeir Fraser2010-01-122-2/+10
| | | | | | | | 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>
* Generic bi-directional map, and related initialisation functions. At the momentKeir Fraser2009-12-172-1/+6
| | | | | | | | | | | | | 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>
* blktap: Fix check_sharing() in blktapctrlKeir Fraser2009-10-231-19/+50
| | | | | | | | | | | check_sharing() in blktapctrl does not work. - It accesses to xenstore by using wrong paths. - It compares image paths including image types. - It misjudges a return value of strcmp(). This patch fixes those mistakes. Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
* blktap: fix empty QCOW images (bug 1430 part 2)Keir Fraser2009-06-031-2/+3
| | | | | | | | | | | | Empty QCOW images consist of only the L1 table, this results in a file size which is not sector-aligned. Since blktap uses O_DIRECT, the block aligned read of the L1 table will go beyond the end of file and thus returns the actual file size and not the expected length. This patch checks whether at least the L1 table has been read. This should fix bug 1430. Signed-off-by: Andre Przywara <andre.przywara@amd.com>
* blktap: fix and use ROUNDUP macro (bug 1430 part 1)Keir Fraser2009-06-031-6/+6
| | | | | | | | | As pointed out in Xen Bugzilla 1430 in the blktap QCOW driver the rounding function is wrong in line 824 of block-qcow.c. This patch replaces this (and other roundings) with the already existing ROUNDUP macro (and fixes the usual macro pitfall). Signed-off-by: Andre Przywara <andre.przywara@amd.com>
* blktap: Revert parts of c/s 19349.Keir Fraser2009-06-011-8/+8
| | | | | | Caused blktapctrl pipes to be created with uninitialised variable in name. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap: Move error signaling to blktapctrlKeir Fraser2009-03-122-10/+156
| | | | | | | | | | | | Until now the udev script for blktap devices needs to decide if to signal success or failure to xend. As this script runs completely independent of blktapctrl and tapdisk/ioemu which do the real work, the udev script can't even theoretically know if tapdisk is happy. This patch removes the udev script and replaces its checks by new ones in libblktap. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* blktapctrl: Fix too early close of pipesKeir Fraser2009-03-121-0/+27
| | | | | | | | | | | | Connections to ioemu have single_handler set, so they are closed as soon as all images of a certain type are closed. This is wrong with ioemu: All images that belong to the same domain are handled by the same backend process (usually qemu-dm, but also tapdisk-ioemu for domains without device model), regardless of the image type. This patch checks for the same-domain condition for ioemu connections. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* blktap: Export disk type constants for ioemuKeir Fraser2009-03-122-9/+10
| | | | | | | | | Currently all disk types that are supported are defined in a header file private to blktapctrl and tapdisk. When restoring ioemu as a backend for blktap these constants are needed by ioemu, so move them to a more public header file. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* blktapctrl: Select backend by prefixKeir Fraser2009-03-122-17/+38
| | | | | | | | | | | This patch adds support for specifying the backend (tapdisk or ioemu) to blktapctrl. Images can be specified e.g. as tap:tapdisk:aio, tap:ioemu:qcow2 or tap:vmdk. When omitting the backend, a default is chosen based on the image type (currently always tapdisk because ioemu as a backend is broken until a follow-up patch series against qemu-xen is applied) Signed-off-by: Kevin Wolf <kwolf@suse.de>
* blktap: Fix compile warnings in block-qcow2.cKeir Fraser2009-03-091-6/+19
| | | | Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
* blktap: Allow creation of qcow2 files.Keir Fraser2009-03-033-7/+105
| | | | Signed-off-by: Yang Zhang <yang.zhang@intel.com>
* blktap: Fix check_gcryptKeir Fraser2009-02-111-1/+1
| | | | Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
* Do not print `***' when compiling unless we fall overKeir Fraser2009-01-121-1/+1
| | | | | | | | | | | | | | | This has finally bugged me enough to do something about it: make prints `***' when it stops due to an error. With make -j, and/or with automated build systems, this error marker can be in the middle of a large logfile. It is useful to be able to search for it. Therefore change occurrences of `*' to `=' for information and warning messages. `***' is reserved for cases where the build stops. A corresponding change is being applied to qemu-xen-unstable. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Use -MMD -MF in tools/* rather than -Wp,-M...Keir Fraser2009-01-121-4/+0
| | | | | | | | | | | | | | | | | | | | | | If you use -MMD -MF then the correct .o filename is written to the .*.d file as the compiler driver arranges everything. This was done in 19010:275abe1c5d24 for the hypervisor. In this patch we do the same elsewhere in the xen-unstable tree, particularly tools/. Specifically: * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS. * Remove -Wp,-MD... from every other Makefile * Remove setting of DEPS from every other Makefile * Ensure that every Makefile says -include $(DEPS) * Ensure that every Makefile's clean target removes $(DEPS) Some Makefiles were already halfway there, but often for a different variable name eg PROG_DEP. The variable name is now standardised in Rules.mk as DEPS. I have done a test build with this change, on Debian etch. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* blktap: re-enable O_DIRECT in block_qcow.cKeir Fraser2008-10-221-9/+15
| | | | | | | Turns out that only two reads and writes in block-qcow.c need to be fixed to work correctly with O_DIRECT. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* blktap: Handle qcow backing files correctly.Keir Fraser2008-10-202-17/+59
| | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libblktap: Remove trailing null byte in xs_printfKeir Fraser2008-10-021-1/+1
| | | | | | | | | | | | xs_printf writes the terminating null byte of the passed string to Xenstore. When reading, the null byte is returned in the following form which confuses tools: sector-size = "512\000" This patch removes the null byte from the data to write. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* install more documentation to /usr/share/doc/xen and /etc/xenKeir Fraser2008-08-061-0/+3
| | | | | | Also resync xmexample3 with xmexample1 and 2. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* blktap: Clean *.opic on 'make clean'.Keir Fraser2008-07-241-1/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap: portability cleanupKeir Fraser2008-07-144-106/+146
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* blktap: cleanupKeir Fraser2008-07-1111-54/+55
| | | | | | | Make functions w/o a prototype static and remove redundant declaration of xs_fire_next_watch(). Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* tapdisk: in case O_DIRECT fails, retry again with o_flags butKeir Fraser2008-07-111-1/+1
| | | | | | O_DIRECT, instead of fixed value O_RD_WR | O_LARGEFILE Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Blktapctrl compatibility layerKeir Fraser2008-07-092-7/+25
| | | | | | | | | | | I originally had just changed the NEWINTF ioctl to send over 48-bits of information, which works on 64-bit but not on 32-bit (since the arg is an unsigned long). Additionally, the previous changes would break an older userland against a new kernel. For that reason, introduce a new ioctl (NEWINTF_EXT) that fixes both of these problems. This is the dom0 userland side. Signed-off-by: Chris Lalancette <clalance@redhat.com>
* blktap: Fall back to libcrypto if libgcrypt is not installed.Keir Fraser2008-06-303-2/+62
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap: link against libgcrypt rather than libcryptoKeir Fraser2008-06-302-14/+5
| | | | | | | | | | tapdisk, part of blktap, links against libcrypto. tapdisk includes GPLv2 (tapaio.c) and other licensed code (block-qcow.c). The license of OpenSSL is considered incompatible with the GPL by many people. This patch changes them to link against libgcrypt, which is LGPL. Signed-off-by: Bastian Blank <waldi@debian.org>
* blktap: Extend userland busid to 32 bitsKeir Fraser2008-06-272-2/+2
| | | | Signed-off-by: Chris Lalancette <clalance@redhat.com>
* tapdisk: Fix qcow2 for images > 2 GBKeir Fraser2008-06-271-4/+1
| | | | Signed-off-by: Kevin Wolf <kwolf@suse.de>
* blktap: Automatically start tapdisk-ioemu on demandKeir Fraser2008-04-232-13/+64
| | | | | | | | | When a domain wants to use a tap:ioemu disk but has no device model, start a tapdisk-ioemu instance as provider. Also, move the creation and removal of communication pipes to xend so that qemu-dm doesn't need the unwanted SIGHUP handler anymore. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* Revert 17499:451ae3b8e5c8Keir Fraser2008-04-232-64/+13
| | | | | | Breaks HVM guest creation (bugzilla #1221). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap: Automatically start tapdisk-ioemu on demandKeir Fraser2008-04-222-13/+64
| | | | | | | | | When a domain wants to use a tap:ioemu disk but has no device model, start a tapdisk-ioemu instance as provider. Also, move the creation and removal of communication pipes to xend so that qemu-dm doesn't need the unwanted SIGHUP handler anymore. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* tools: Use PATH_MAX for pathname char arrays.Keir Fraser2008-04-041-1/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* tapdisk: Fix L1 table endianess of qcow imagesKeir Fraser2008-03-271-6/+56
| | | | | | | | Fix tapdisk to use big endian L1 tables as used by qemu/ioemu. Old tapdisk images with native endianess are automagically converted to big endian when the image file is opened for the first time. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* tools/blktap: Use generic subdirs rules.Keir Fraser2008-03-251-20/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* blktap: Fix BSD build failure.Keir Fraser2008-03-191-0/+5
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* tapaio build fixKeir Fraser2008-03-191-0/+1
| | | | | | | | | With some combinations of compiler flags (no optimization, -Werror), the compiler may complain that the function doesn't have a return statement (even if the function actually just never returns), reported as bug 1128. This adds a dummy return statement. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Use ioemu block drivers through blktap.Keir Fraser2008-03-183-32/+92
| | | | | | | | | | Add support for a tap:ioemu pseudo driver. Devices using this driver won't use tapdisk (containing the code duplication) any more, but will connect to the qemu-dm of the domain. In this way no working configuration should be broken right now as you can still choose to use the tapdisk drivers. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* Clean up blktap Makefiles.Keir Fraser2008-03-172-30/+25
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* blktapctrl: Fix a potential device minor number leak.Keir Fraser2008-03-031-4/+4
| | | | Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
* blktap: Fix unused warnings in block-qcow2.c with -D_FORTIFY_SOURCE=2.Keir Fraser2008-02-281-161/+0
| | | | Signed-off-by: Kevin Wolf <kwolf@suse.de>
* blktap: Remove some code duplicationKeir Fraser2008-02-255-568/+324
| | | | | | | | With my qcow2 patch to blktap I contributed a bit to the mess, so here an attempt to clean up and remove at least some of the code duplication in the functions dealing with aio operations. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* blktap: qcow2 image format supportKeir Fraser2008-02-216-10/+2369
| | | | | | | | | | | | This patch adds support for the qcow2 image format to blktap. It consists mostly of qemu code, adapted to the blktap interfaces. Snapshots and compressed images are supported. The qcow2 driver may be used by either specifying tap:qcow2 or by using tap:qcow which will detect that you have a version 2 image and will call the qcow2 driver. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* libxenctrl headers should not pollute macro namespace withKeir Fraser2008-02-121-1/+1
| | | | | | | mb/rmb/wmb. Instead add a xen_ prefix. Modify Xen's public headers to expect the prefixed names instead of bare mb/rmb/wmb, but gate this expectation on a bump of __XEN_INTERFACE_VERSION__. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Define CFLAGS and LDFLAGS for libxenstore.Keir Fraser2008-01-271-2/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Define CFLAGS and LDFLAGS for libxenctrl.Keir Fraser2008-01-271-3/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Move generation of public header hierarchy into the tools.Keir Fraser2008-01-262-2/+2
| | | | | | | This patch merges the two versions of public header generation currently used in the build into one. Signed-off-by: Bastian Blank <waldi@debian.org>