Commit Graph
57 Commits
Author SHA1 Message Date
Olaf Hering a543fcb376 blktap: fix rpmlint warning spurious-executable-perm
[ 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>
2012-10-18 09:35:04 +01:00
Ian Campbell debddaa56c nstore: rename public xenstore headers
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
2012-05-14 17:15:36 +01:00
Ian Campbell 61d0fe74c6 tools: Remove $(CFLAGS) from links lines.
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>
2011-03-31 19:32:18 +01:00
Ian Campbell 5ba627e3ab tools: drop further uses of -Wp,-MD,.$(@F).d to generate dependencies.
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>
2011-03-23 15:56:46 +00:00
Keir Fraser 547cb1849c build: Make XEN_ROOT an absolute path.
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>
2011-03-17 10:36:25 +00:00
Michael Young d3e77ae6b6 tools/Makefiles: install libvhd and libblktap with INSTALL_PROG
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>
2011-02-01 19:19:58 +00:00
Stefano Stabellini ba26a1e197 split LDLIBS from LDFLAGS to fix link errors in recent toolchains
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>
2010-08-11 18:02:32 +01:00
Keir Fraser 14d41371e2 blktap: provide a variant of __RING_SIZE() that is an integer constant 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>
2010-03-06 13:31:03 +00:00
Keir Fraser 939629eb5b blktap: fix blktapctrl abort
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>
2010-01-22 11:00:45 +00:00
Keir Fraser 5dc1050805 blktap: Fix check_sharing() in blktapctrl
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>
2009-10-23 10:02:09 +01:00
Keir Fraser cde518aa71 blktap: Move error signaling to blktapctrl
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>
2009-03-12 18:48:09 +00:00
Keir Fraser 57871f919d blktap: Export disk type constants for ioemu
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>
2009-03-12 18:42:59 +00:00
Keir Fraser 4b52a38711 libblktap: Remove trailing null byte in xs_printf
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>
2008-10-02 12:56:55 +01:00
Keir Fraser d4a22e75c9 blktap: Clean *.opic on 'make clean'.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 11:19:13 +01:00
Keir Fraser 962649c369 blktap: cleanup
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>
2008-07-11 15:36:40 +01:00
Keir Fraser 5109f87cee Blktapctrl compatibility layer
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>
2008-07-09 10:41:49 +01:00
Keir Fraser 4fe815abd1 blktap: Extend userland busid to 32 bits
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-27 16:08:56 +01:00
Keir Fraser 45b676a245 Use ioemu block drivers through blktap.
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>
2008-03-18 10:58:47 +00:00
Keir Fraser 2dfb6b6e90 Clean up blktap Makefiles.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-03-17 10:57:59 +00:00
Keir Fraser 3faece79e4 Define CFLAGS and LDFLAGS for libxenstore.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-27 12:58:15 +00:00
Keir Fraser be5fbf9a7f Move generation of public header hierarchy into the tools.
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>
2008-01-26 10:38:44 +00:00
Keir Fraser bc4a5b7bf5 blktap: Clean up makefile and linked libs.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-26 10:17:33 +00:00
Keir Fraser 93e3de7b94 Add SBINDIR. Use it always.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-22 14:35:02 +00:00
Keir Fraser 2faf0fc95c Add INCLUDEDIR. Use it.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-22 14:30:21 +00:00
Keir Fraser c8107e1564 Apply PREFIX directly to LIBDIR.
Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-22 14:29:11 +00:00
Keir Fraser d2477385df tools: LDFLAGS in link lines
LDFLAGS is not honoured by a couple of link lines in tools/*, but
should be.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-01-17 15:17:22 +00:00
Keir Fraser af3ade42b9 Revert 16560:822d4ec5cfb1.
Preference seems to be to update library versions only when the ABI
changes. Only libxenctrl/libxenguest have their version number changed
to 3.2.0, as a reminder that they change on pretty much every major
release.

libfsimage/libxenstore/libblktap have not changed substantially
recently, hence the ABI has not changed, and version number stays the
same as in Xen 3.1 (and before).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-12-08 17:32:01 +00:00
Keir Fraser 7f9e1cf31e tools: Rationalise library soname versions.
* Arrange for the sonames of libxenstore, libxc, libfsimage and
   libblktap to be set from a single place in Config.mk.
 * Bumps the soname major version number to 3.2 in preparation for
   3.2 rc1 after which we do not expect to have ABI changes.

I have not done anything about libaio and libflask.  The former is
imported from elsewhere and if we're lucky will have sane versioning
upstream.

libflask has a very small interface and I'm hoping that the XSM
authors have been keeping some ABI discipline.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2007-12-07 14:44:13 +00:00
Keir Fraser 363a648846 blktap: cleanups for *BSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2007-12-05 09:59:23 +00:00
Keir Fraser 8ddc7e13ab blktap: remove unused headers.
Attached patch removes unused linux specific headers
and makes bswap.h ready for BSD support.

This is first step for BSD support in blktap. More to come.
No functional change.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2007-12-04 10:48:28 +00:00
kfraser@localhost.localdomain 613140dc23 blktap: Fix unaligned access to blktap/tapdisk message payloads.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-08-01 09:11:08 +01:00
Keir Fraser 43aa5ed8c0 Specify -fno-strict-aliasing in root build config file.
Fixes correctness issues with xenstored and gcc-4.2.

Original patch by Charles Coffing <ccoffing@novell.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
2007-07-07 10:31:15 +01:00
kfraser@localhost.localdomain ff2fc71eda tools: warn_unused_result build fixes.
Note that some of the existing error checking for asprintf was wrong
for Linux.  asprintf in glibc returns -1 on error, but leaves the
pointer uninitialized.  Only the BSDs zero out the pointer on error.

Also, while fixing these warnings I saw several error paths that were
incorrect.  This patch minimally fixes the warn_unused_result; more
complete error path cleanup will be a later patch.

Signed-off-by:  Charles Coffing <ccoffing@novell.com>
2007-06-12 11:38:31 +01:00
kfraser@localhost.localdomain c6e5b4c106 blktap: Do not install libs or headers with execute permissions.
rpmlint complains that various blktap files are installed with
unnecessary execute permissions:
E: xen-devel spurious-executable-perm (Badness: 100)
/usr/lib64/libblktap.a
E: xen-devel spurious-executable-perm (Badness: 100)
/usr/include/blktaplib.h

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2007-05-24 10:44:01 +01:00
Brendan Cully 5d93b6f183 Put blktap character device back into /dev/xen.
Changeset 14895:800aa9f5cec9 accidentally moved it into /var/run/tap
along with the control FIFOs.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2007-05-02 09:42:43 -07:00
Jake Wires 34cb794701 [TAPDISK] Move tapdisk control files from /dev/xen to /var/run/tap
Signed-off-by: Jake Wires <jwires@xensource.com>
2007-04-23 17:15:38 -07:00
kfraser@localhost.localdomain 9de4f0c67d tools: Clean up use of 'install' command.
- convert raw "install" command to use $(INSTALL)
- convert some $(INSTALL) to $(INSTALL_DATA) as appropriate
- modify the specific $(INSTALL) definitions to use -p.

Original patch by Ben Thomas <ben@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-07 10:49:20 +00:00
Jake Wires a3d17a18e5 [TAPDISK] honor read-only attributes when creating tap-based VBDs
Signed-off-by: Jake Wires <jwires@xensource.com>
2007-02-23 17:26:07 -08:00
Jake Wires b3fb1294fa [TAPDISK] add tapdisk support for image chaining
Enables tapdisk to chain an arbitrary number of VDIs, propagating reads of
holes in children to their parent images.  Introduces two new functions to the
tapdisk interface to facilitate this.  Modifies the QCoW plugin to take
advantage of these changes, thus providing support for arbitrarily long chains
of QCoW image types.
2007-02-16 20:31:27 -08:00
kfraser@localhost.localdomain bc79267989 [BLKTAP] Use lartge enough types to express parameters of large block devices.
While the kernel side of blktap drivers is using 64-bit sector numbers
correctly when reporting disk sizing, the userspace parts where this
dat is actually generated is truncating at 32-bit. There are 3 variables
related to disk sizing which are used in the kernel/userspace code
'size', 'sector size' & 'info'. In kernel space these are treated as being
unsigned long long, unsigned long, and unsigned int, respectively. In
the blktap userspace code this were all varyingly long, unsigned long.
This mismatch caused 32-bit wraparound on large disks. The attached
patch updates the blktap userspace to use the same data types as
kernel space for all these params, thus both fixing the 32-bit bug &
giving the code consistency.

This patch has been tested both by comparing /proc/partitions in the
guest, with the image size seen in the host, and by using Stephen
Tweedie's 'verify-data' tool on a variety of multi-TB sized disks.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2006-11-28 13:50:32 +00:00
kfraser@localhost.localdomain 9f941deb84 [TOOLS] Provide common LFS CFLAGS/LDFLAGS additions in Rules.mk.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-17 09:54:48 +00:00
kfraser@localhost.localdomain 720860012a [BLKTAP] Various cleanups necessary for ia64 support.
- remove magic number 8 and 64.
  page size / sector size is 8 on x86, however on ia64 page size is
  16kb.
  blkring size is 64 on x86. however it's 128 on ia64.
- replace 0xFFFF with INVALID_GRANT_HANDLE
- don't map io ring into user space with uncachable.
  kernel access the page with cacable and tapdisk uses memory barrier
  so that it isn't necessary.
- remove printk warning and inserted new line.
- remove unused variable, page.
- add one BUG()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-11-07 11:01:35 +00:00
kfraser@localhost.localdomain d61113c5c7 [SOLARIS] On Solaris, GCC is configured to use Sun's LD. Fix the build to use
the correct flags, and link against libsocket where necessary.

Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 17:17:57 +01:00
kfraser@localhost.localdomain 6311dc03da Clean up duplication of 'install' macros in the Makefiles.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 15:57:05 +01:00
kfraser@localhost.localdomain 44740083e9 [BLKTAP] Fix trivial indentation snafu in previous changeset.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-06 16:51:10 +01:00
kfraser@localhost.localdomain 382c54558d [BLKTAP] Fix crash at start-of-day in blktapctrld
if /local/domain does not exist.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-06 15:05:30 +01:00
kfraser@localhost.localdomain dc2917720c [BLKTAP] Formatting and style cleanups to blktapctrl.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-06 15:04:42 +01:00
jchesterfield@dhcp92.uk.xensource.com 9bc9168a08 [BLKTAP] Blktapctrl: Add asynchronous watch on dom0 name entry for blktapctrl on startup. This patch cleans up the synchronisation issues between blktapctrl and xend at initialisation if the Dom0 entries have not yet been populated.
Signed-off-by: Julian Chesterfield <julian@xensource.com>
2006-10-05 10:55:13 +01:00
Andrew Warfield 9dd368070b [BLKTAP] have blktap use a dynamic major
blktap currently uses a hardcoded major of 254 for the device.  This is
not robust in anyway and needs to be dynamic.

Note: it is better not to have the daemon create the node, and have udev
create it instead. But since the daemon currently creates the node
anyway, it is still the way this is done.  That change needs to be made
at another time.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-09-28 12:47:45 -07:00
Andrew Warfield b54a368212 Fix typo.
Signed-off-by: <andy@xensource.com>
2006-08-29 16:31:57 -07:00