aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap
Commit message (Collapse)AuthorAgeFilesLines
* tools: remove in tree libaioIan Campbell2013-08-201-6/+0
| | | | | | | | | | | | | | | We have defaulted to using the system libaio for a while now and I din't think there are any relevant distros which don't have it that running Xen 4.4 would be reasonable on. Also it has caused confusion because it is not ever wanted on ARM, but the build system doesn't express that (could be fixed, but deleting is the right thing to do anyway). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* blktap: fix rpmlint warning spurious-executable-permOlaf Hering2012-10-181-4/+6
| | | | | | | | | | | | [ 1758s] xen-devel.x86_64: E: spurious-executable-perm (Badness: 50) /usr/lib64/libblktap.a [ 1758s] The file is installed with executable permissions, but was identified as one [ 1758s] that probably should not be executable. Verify if the executable bits are [ 1758s] desired, and remove if not. NOTE: example scripts should be packaged under [ 1758s] %docdir/examples, which will avoid this warning. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* nstore: rename public xenstore headersIan Campbell2012-05-144-4/+4
| | | | | | | | | | | | | | | | | | | | | | The xenstore header xs.h is producing conflicts with other software[1]. xs is a too short identifier and does not matche the library. Renaming the headers to xenstore.h and xenstore_lib.h is the easiest way to make them easy recognizable and prevent furthe problems. [1]: http://bugs.debian.org/668550 [ Also update QEMU_TAG, to bring in corresponding change to qemu-xen-traditional. -iwj ] Signed-off-by: Bastian Blank <waldi@debian.org> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> --HG-- rename : tools/xenstore/xs.h => tools/xenstore/xenstore.h rename : tools/xenstore/xs_lib.h => tools/xenstore/xenstore_lib.h
* tools/blktap: fix build error w/o MEMSHRChristoph Egger2012-04-241-0/+2
| | | | | | | | | Do not include memshr.h when MEMSHR is not defined. Fixes build error when MEMSHR is disabled. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: Use PTHREAD_CFLAGS, _LDFLAGS, _LIBSIan Jackson2012-04-111-2/+5
| | | | | | | | | | | Replace all literal occurrences of -lpthread and -pthread in Makefiles by references to PTHREAD_CFLAGS, PTHREAD_LDFLAGS and PTHREAD_LIBS. These are the new variables set by configure, and currently expand to -pthread on the compilation and link lines as is required. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* tools/blktap: reorder MEMSHR_DIR to fix CFLAGSOlaf Hering2012-03-141-2/+2
| | | | | | | | | | | In blktap2 MEMSHR_DIR is used before it is set. This removes the required -D_GNU_SOURCE from CFLAGS, its used as option for -I Fix this by moving memshr related flags to the place where its actually used. The failure is a missing O_DIRECT define. Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* build: add autoconf to replace custom checks in tools/checkIan Jackson2012-02-222-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Tools.mk and config.h. conf/Tools.mk is included by tools/Rules.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script. config.h is only used by libxl/xl to detect yajl_version.h. [ tools/config.sub and config.guess copied from autotools-dev 20100122.1 from Debian squeeze i386, which is GPLv2. tools/configure generated using the included ./autogen.sh which ran autoconf 2.67-2 from Debian squeeze i386. autoconf is GPLv3+ but has a special exception for the autoconf output; this exception applies to us and exempts us from complying with GPLv3+ for configure, which is good as Xen is GPL2 only. - Ian Jackson ] Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Tested-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* blktap: remove local definitions and include byteswap.hRoger Pau Monne2011-12-201-37/+1
| | | | | | | | | | | Use the same approach as tools/blktap2/include/libvhd.h, remove local definitions of bswap* and include byteswap.h. Also remove the HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's defined by QEMU). Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: use system libaio for blktap1 as well.Ian Campbell2011-11-231-3/+9
| | | | | | | | | 24184:4ecd3615e726 missed this because I was accidentally testing with a .config containing CONFIG_SYSTEM_LIBAIO=n. Tools tree now fully rebuilt without this. There were no other issues. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: Remove $(CFLAGS) from links lines.Ian Campbell2011-03-312-4/+4
| | | | | | | | The relevant variable in these circumstances is called $(LDFLAGS). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: drop further uses of -Wp,-MD,.$(@F).d to generate dependencies.Ian Campbell2011-03-231-4/+0
| | | | | | | | | | 19025:bd78714b8594 switched to "-MMD -MF" in preference, adding the correct runes to tools/Rules.mk but appears to have missed some other uses of -Wp,... Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* build: Make XEN_ROOT an absolute path.Keir Fraser2011-03-173-3/+3
| | | | | | | | Otherwise make can search the path relative to certain standard paths such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in Config.mk suffers from this). Signed-off-by: Keir Fraser <keir@xen.org>
* tools/Makefiles: install libvhd and libblktap with INSTALL_PROGMichael Young2011-02-011-1/+1
| | | | | | | | | | | Shared libraries should be executable. (rpm (4.9.0) doesn't automatically supply a "provides" entry for a library unless it is executable. Non-executable libraries can cause other trouble too.) Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/blktap, blktap2: include <sys/mount.h> instead of <linux/fs.h>Ian Campbell2011-01-171-1/+1
| | | | | | | | | | | | 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@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* split LDLIBS from LDFLAGS to fix link errors in recent toolchainsStefano Stabellini2010-08-112-8/+8
| | | | | | | | | | | | | | | | Linker command lines are order-sensitive. Move linker options -Lfoo -lfoo from LDFLAGS to LDLIBS and place this new variable after the objects to link. This resolves build errors in xenpagin and blktap with recent toolchains. rename SHLIB_CFLAGS to SHLIB_LDFLAGS rename LDFLAGS_* to LDLIBS_* move LDFLAGS usage after CFLAGS in CC calls remove stale comments in xenpaging Makefile Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: assume that special Xen devices have been created by the platformKeir Fraser2010-06-021-22/+2
| | | | | | | | | | | | | | | Remove all the magic surrounding the special Xen devices in Linux specific code whereby we attempt to figure out what the correct major:minor number is and check the the existing device has these numbers etc. In 2010 we really should be able to trust that the platform has created the devices correctly or provide correct configuration settings such that they are without resorting to tearing down the platform configured state and rebuilding it. tools/hotplug/Linux/xen-backend.rules already contains the necessary udev rules to create /dev/xen/evtchn and friends in the correct place. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* 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>