]> xenbits.xensource.com Git - people/dstodden/blktap.git/log
people/dstodden/blktap.git
13 years agocrypto: Move to from drivers/crypto/ to crypto/. xcp/volatile/crypto
Daniel Stodden [Tue, 30 Aug 2011 13:49:44 +0000 (14:49 +0100)]
crypto: Move to from drivers/crypto/ to crypto/.

Three cheers for a shallower source tree.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agocrypto: Build with automake.
Daniel Stodden [Tue, 30 Aug 2011 13:45:49 +0000 (14:45 +0100)]
crypto: Build with automake.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agocrypto: Fix strict aliasing breakage in b128ops.h
Daniel Stodden [Tue, 30 Aug 2011 13:44:05 +0000 (14:44 +0100)]
crypto: Fix strict aliasing breakage in b128ops.h

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agocrypto: Make cpuid() compile with -fPIC.
Daniel Stodden [Tue, 30 Aug 2011 13:31:27 +0000 (14:31 +0100)]
crypto: Make cpuid() compile with -fPIC.

Thanks to Sam Hocevar
http://sam.zoy.org/blog/
2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
for this one.

Doesn't generate very sensible assembly any more, but works.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoblock-crypto: cleanup
Daniel Stodden [Sun, 24 Jul 2011 08:49:10 +0000 (01:49 -0700)]
block-crypto: cleanup

- Don't exit(1). Just td_panic() instead.
- Include header declarations.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: Fix 64-bit build after xcp/crypto.
Daniel Stodden [Sun, 24 Jul 2011 01:00:10 +0000 (18:00 -0700)]
vhd: Fix 64-bit build after xcp/crypto.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoadd keyhash field to batmap header
Jake Wires [Wed, 1 Sep 2010 21:22:12 +0000 (14:22 -0700)]
add keyhash field to batmap header

Port from xs/master 9072bfc23ce8776f0953c3fa7e92917c0ae4e789
 - fix data types
   since 33bd1c6 (vhd: move from linux asm/types.h to inttypes.h)

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: Be more careful preserving errno.
Daniel Stodden [Mon, 9 May 2011 22:34:39 +0000 (15:34 -0700)]
vhd: Be more careful preserving errno.

13 years agovhd: Fix uninitialized return value in vhd-util-dm-encrypt.
Daniel Stodden [Mon, 9 May 2011 22:34:19 +0000 (15:34 -0700)]
vhd: Fix uninitialized return value in vhd-util-dm-encrypt.

gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
vhd-util-dm-decrypt.c: In function ‘vhd_util_dm_decrypt’:
vhd-util-dm-decrypt.c:307: warning: ‘err’ may be used uninitialized in this function
make[2]: *** [vhd-util-dm-decrypt.o] Error 1

Using errno, like vhd_stream_load does.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd-stream: open as binary
Jake Wires [Wed, 1 Sep 2010 21:13:01 +0000 (14:13 -0700)]
vhd-stream: open as binary

13 years agovhd-stream: flush after write
Jake Wires [Wed, 1 Sep 2010 21:12:45 +0000 (14:12 -0700)]
vhd-stream: flush after write

13 years agovhd-stream: use vhd_bytes_padded convenience api
Jake Wires [Wed, 1 Sep 2010 21:11:35 +0000 (14:11 -0700)]
vhd-stream: use vhd_bytes_padded convenience api

13 years agovhd-stream: always try standard seek before emulated seek
Jake Wires [Wed, 1 Sep 2010 21:12:30 +0000 (14:12 -0700)]
vhd-stream: always try standard seek before emulated seek

13 years agovhd: Fix unitialized vars.
Daniel Stodden [Mon, 9 May 2011 21:50:47 +0000 (14:50 -0700)]
vhd: Fix unitialized vars.

gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
cc1: warnings being treated as errors
vhd-util-dm-encrypt.c: In function ‘vhd_util_dm_encrypt’:
vhd-util-dm-encrypt.c:197: warning: ‘err’ may be used uninitialized..
vhd-util-dm-encrypt.c:199: warning: ‘p2v’ may be used uninitialized..
make[2]: *** [vhd-util-dm-encrypt.o] Error 1

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoadd libvhd-stream
Jake Wires [Thu, 1 Jul 2010 18:08:01 +0000 (11:08 -0700)]
add libvhd-stream

13 years agomove prototypes to header file
Jake Wires [Mon, 2 May 2011 23:54:46 +0000 (16:54 -0700)]
move prototypes to header file

13 years agoXC-5102: add option to set vhd keyhash directly
Jake Wires [Thu, 21 Apr 2011 01:53:20 +0000 (18:53 -0700)]
XC-5102: add option to set vhd keyhash directly

13 years agoadd utility for setting, checking, and displaying keyhashes
Jake Wires [Wed, 1 Sep 2010 21:24:31 +0000 (14:24 -0700)]
add utility for setting, checking, and displaying keyhashes

13 years agoXC-4120: force allocation of empty blocks to ensure sizes match
Jake Wires [Sat, 25 Sep 2010 03:08:13 +0000 (20:08 -0700)]
XC-4120: force allocation of empty blocks to ensure sizes match

13 years agodm-decrypt: always write allocated blocks, even if they're empty
Jake Wires [Wed, 1 Sep 2010 21:10:08 +0000 (14:10 -0700)]
dm-decrypt: always write allocated blocks, even if they're empty

otherwise the bat will be inconsistent

13 years agovhd-util dm-decrypt
Jake Wires [Thu, 1 Jul 2010 18:25:26 +0000 (11:25 -0700)]
vhd-util dm-decrypt

takes a vhd and a raw image as input, writes a new vhd to stdout containing
the metadata from the original vhd and the data from the raw image

13 years agovhd-dm-encrypt
Jake Wires [Thu, 1 Jul 2010 18:23:47 +0000 (11:23 -0700)]
vhd-dm-encrypt

accepts a vhd stream as input; writes the present bits of the vhd to a raw
image.

13 years agovhd-util clone-metadata
Jake Wires [Thu, 1 Jul 2010 18:21:20 +0000 (11:21 -0700)]
vhd-util clone-metadata

creates an empty vhd with identical footer/header/parent locators as input
vhd.

13 years agoadd vhd-util stream-coalesce
Jake Wires [Thu, 1 Jul 2010 18:19:55 +0000 (11:19 -0700)]
add vhd-util stream-coalesce

accepts vhd streams as input and produces a single coalesced vhd as output

13 years agouse aforementioned helper functions
Jake Wires [Thu, 1 Jul 2010 18:18:11 +0000 (11:18 -0700)]
use aforementioned helper functions

13 years agohelper functions for determining vhd current and maximum capacity
Jake Wires [Thu, 1 Jul 2010 18:17:47 +0000 (11:17 -0700)]
helper functions for determining vhd current and maximum capacity

13 years agopreserve resize padding during vhd export
Jake Wires [Fri, 11 Jun 2010 20:35:56 +0000 (13:35 -0700)]
preserve resize padding during vhd export

13 years agoXC-5214: ignore keys when keyhash is not set
Jake Wires [Tue, 29 Mar 2011 18:47:01 +0000 (11:47 -0700)]
XC-5214: ignore keys when keyhash is not set

13 years agoXC-5214 - fix keyhash check
Jake Wires [Tue, 22 Mar 2011 01:54:35 +0000 (18:54 -0700)]
XC-5214 - fix keyhash check

13 years agocheck for errors when initializing crypto
Jake Wires [Wed, 1 Sep 2010 21:25:26 +0000 (14:25 -0700)]
check for errors when initializing crypto

13 years agotypo
Jake Wires [Tue, 15 Mar 2011 18:06:59 +0000 (11:06 -0700)]
typo

13 years agoXC-4399 change TAPDISK2_CRYPTO_KEYDIR to be interpreted as comma separated list of...
Tomasz Wroblewski [Wed, 3 Nov 2010 13:42:35 +0000 (13:42 +0000)]
XC-4399 change TAPDISK2_CRYPTO_KEYDIR to be interpreted as comma separated list of key directories

before only single directory was supported

13 years agorefuse to open vhds for IO if keyhashes don't look right
Jake Wires [Wed, 1 Sep 2010 21:25:12 +0000 (14:25 -0700)]
refuse to open vhds for IO if keyhashes don't look right

13 years agoUse loop unrolled optimized aesni-ecb to get better performance through
Christian Limpach [Fri, 30 Jul 2010 23:05:39 +0000 (23:05 +0000)]
Use loop unrolled optimized aesni-ecb to get better performance through
improved scheduling/pipelining of the aesni instructions.

Also add simple throughput measurement mode to test_decrypt.

13 years agocrypto: Reduce GPR footprint in cpuid.
Daniel Stodden [Mon, 9 May 2011 23:43:52 +0000 (16:43 -0700)]
crypto: Reduce GPR footprint in cpuid.

gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
xts_aes.c: In function ‘cpuid’:
xts_aes.c:49: error: can't find a register in class ‘GENERAL_REGS’
              while reloading ‘asm’

It apparently helps just avoid the clobber section.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoAdd aesni support using the 32-bit openssl aesni code.
Christian Limpach [Tue, 27 Jul 2010 20:10:37 +0000 (20:10 +0000)]
Add aesni support using the 32-bit openssl aesni code.

13 years agoSync aes code with version from linux 2.6.32.
Christian Limpach [Mon, 26 Jul 2010 18:52:11 +0000 (18:52 +0000)]
Sync aes code with version from linux 2.6.32.

13 years agoCheck for ENOENT instead of EACCESS, when keyfile is not present.
Christian Limpach [Mon, 26 Jul 2010 17:49:20 +0000 (17:49 +0000)]
Check for ENOENT instead of EACCESS, when keyfile is not present.

13 years agoAdd per-vhd encryption.
Christian Limpach [Mon, 19 Jul 2010 20:12:21 +0000 (20:12 +0000)]
Add per-vhd encryption.

Add the Linux kernel's aes and aes-xts crypto code to tapdisk and
allow using a different key for each vhd in a vhd chain.

The key directory is specified by setting the TAPDISK2_CRYPTO_KEYDIR
environment variable.

Port from xc/master 7a8f7d5ddf2c70bf5c552a1bc8f0070256015b59
 - Reenable u32/u64 typedefs in compat-crypto.h
   (gone in vhd since bdf29eb (Fix 64-bit build.))
 - Disable duplicate likely/unlikely typedefs in compat-crypto.h
   (in compiler.h since 9ce3833d (Add some useful gccisms.)
 - Vastly reduce drivers/Makefile delta

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoexport vhd_print_headers
Jake Wires [Fri, 11 Jun 2010 20:35:03 +0000 (13:35 -0700)]
export vhd_print_headers

13 years agoadd optional devops vector to libvhd
Jake Wires [Fri, 11 Jun 2010 20:37:07 +0000 (13:37 -0700)]
add optional devops vector to libvhd

13 years agovhd: Link to libiconv, where needed/wanted. xcp/next
Daniel Stodden [Tue, 30 Aug 2011 04:28:55 +0000 (05:28 +0100)]
vhd: Link to libiconv, where needed/wanted.

Adds --with-libiconv. Helps with a proper uclibc build.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoac/vhd: Make libvhdio conditionally only.
Daniel Stodden [Mon, 29 Aug 2011 03:02:59 +0000 (04:02 +0100)]
ac/vhd: Make libvhdio conditionally only.

Current part/ is not well portable because of the the
Linux header dependencies. But it's optional anyway.
New ENABLE_VHDIO also replaces ENABLE_SHARED, used for
vhdio only.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoac/vhd: Make vhd/lib/tests conditionally only.
Daniel Stodden [Mon, 29 Aug 2011 02:54:59 +0000 (03:54 +0100)]
ac/vhd: Make vhd/lib/tests conditionally only.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoLink vhd-index against libuuid, explicitly.
Daniel Stodden [Thu, 25 Aug 2011 07:58:20 +0000 (08:58 +0100)]
Link vhd-index against libuuid, explicitly.

The implicit dependency through libvhd.la
won't work on Debian sid/gcc-4.6.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agolibvhdio: Build only a shared library.
Daniel Stodden [Mon, 15 Aug 2011 07:40:57 +0000 (00:40 -0700)]
libvhdio: Build only a shared library.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agotap-ctl-spawn: Fall back to tapdisk in $(builddir).
Daniel Stodden [Sun, 31 Jul 2011 23:17:11 +0000 (16:17 -0700)]
tap-ctl-spawn: Fall back to tapdisk in $(builddir).

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agotap-ctl-spawn: Move sbin/tapdisk2 to libexec/tapdisk.
Daniel Stodden [Sun, 31 Jul 2011 22:16:05 +0000 (15:16 -0700)]
tap-ctl-spawn: Move sbin/tapdisk2 to libexec/tapdisk.

With some cleanup:

 - Allow overrides with TAPDISK, or TAPDISK2.
 - If TAPDISK/TAPDISK2 is set, require that to succeed.
 - Return errno on failure.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoac: Add autogen.sh, version 20090301
Daniel Stodden [Wed, 27 Jul 2011 23:39:44 +0000 (23:39 +0000)]
ac: Add autogen.sh, version 20090301

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoautotools: Build blktap with automake/autoconf.
Daniel Stodden [Sun, 31 Jul 2011 02:20:06 +0000 (19:20 -0700)]
autotools: Build blktap with automake/autoconf.

 - XCP source: Remove mk/ subtree.
 - Use autoconf/automake.
 - Use libtool, solving our library build troubles.
 - Need a version. Make that blktap-2.0.90 for now.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoAdd missing headers
Daniel Stodden [Sun, 28 Aug 2011 05:35:19 +0000 (05:35 +0000)]
Add missing headers

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: Don't rely on resolved_path = NULL feature in realpath().
Daniel Stodden [Mon, 29 Aug 2011 01:21:24 +0000 (02:21 +0100)]
vhd: Don't rely on resolved_path = NULL feature in realpath().

A resolved_path arg of NULL implies a malloc of just enough space,
standardized since POSIX.1-2008. Not portable to uClibc, failing by a
__nonnull(2) attribute.

Fix with PATH_MAX sized stack buffers, and strdup()s where needed.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoFix strict aliasing / pointer casts for rhel/gcc-4.1.2.
Daniel Stodden [Thu, 4 Aug 2011 01:33:28 +0000 (18:33 -0700)]
Fix strict aliasing / pointer casts for rhel/gcc-4.1.2.

 - Mostly posix_memalign. Gcc won't appreciate char buffer out vars
   recasted to void.

 - Mostly fixed with void pointers. That's fine, because most of our
   memalign usage are sector-aligned opaque buffers anyway.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: More gcc fortification complaints.
Daniel Stodden [Thu, 25 Aug 2011 07:36:41 +0000 (08:36 +0100)]
vhd: More gcc fortification complaints.

This time adding a couple hypothetical error conditions.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoRework gcc fortification catches, failing -Wunused.
Daniel Stodden [Fri, 29 Jul 2011 23:10:09 +0000 (16:10 -0700)]
Rework gcc fortification catches, failing -Wunused.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: Remove unused vhd_block_vector_read_allocated.
Daniel Stodden [Fri, 29 Jul 2011 23:09:19 +0000 (16:09 -0700)]
vhd: Remove unused vhd_block_vector_read_allocated.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: remove HD_TYPE_STR definition from vhd.h
Daniel Stodden [Fri, 29 Jul 2011 23:08:40 +0000 (16:08 -0700)]
vhd: remove HD_TYPE_STR definition from vhd.h

Only used in vhd-util-read, so inlined there for now.
Might go extern again if that's ever a problem.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoio-optimize: Inline type var in __print_iocb.
Daniel Stodden [Thu, 25 Aug 2011 08:01:00 +0000 (09:01 +0100)]
io-optimize: Inline type var in __print_iocb.

Unused if DBG() is void producing, a warning under gcc-4.6.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoio-optimize: #undef unused code if !DEBUG/TEST
Daniel Stodden [Fri, 29 Jul 2011 23:53:31 +0000 (16:53 -0700)]
io-optimize: #undef unused code if !DEBUG/TEST

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoqueue: Restore orphaned setup/destroy callbacks in td_tio_rwio.
Daniel Stodden [Sat, 30 Jul 2011 00:02:16 +0000 (17:02 -0700)]
queue: Restore orphaned setup/destroy callbacks in td_tio_rwio.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoRemove unused variables/labels.
Daniel Stodden [Fri, 29 Jul 2011 23:06:32 +0000 (16:06 -0700)]
Remove unused variables/labels.

Up to a clean build with -O2 -Wall -Werror.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoMove relative-path out of include/
Daniel Stodden [Sun, 31 Jul 2011 01:44:54 +0000 (18:44 -0700)]
Move relative-path out of include/

Only used in libvhd.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoMove partition.h out of include/
Daniel Stodden [Sun, 31 Jul 2011 01:51:22 +0000 (18:51 -0700)]
Move partition.h out of include/

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoMove lvm-util.h to lvm/
Daniel Stodden [Sun, 31 Jul 2011 01:51:05 +0000 (18:51 -0700)]
Move lvm-util.h to lvm/

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agopart: Mark vhdpartx executable
Daniel Stodden [Thu, 28 Jul 2011 01:15:09 +0000 (18:15 -0700)]
part: Mark vhdpartx executable

13 years agovhd: Move atomicio.h out of include/
Daniel Stodden [Thu, 28 Jul 2011 10:33:13 +0000 (03:33 -0700)]
vhd: Move atomicio.h out of include/

Note that vhd-update doesn't need atomicio.h.
And vhd/lib Source is cloned, so should be headers.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: Fix broken error rollback in vhd_index_update_bat.
Daniel Stodden [Thu, 28 Jul 2011 02:08:29 +0000 (19:08 -0700)]
vhd: Fix broken error rollback in vhd_index_update_bat.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: Fix err return in vhd_journal_write_entry
Daniel Stodden [Thu, 28 Jul 2011 00:29:12 +0000 (17:29 -0700)]
vhd: Fix err return in vhd_journal_write_entry

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agotest-snapshot: Fix void return value.
Daniel Stodden [Sat, 30 Jul 2011 00:44:41 +0000 (17:44 -0700)]
test-snapshot: Fix void return value.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agolvm/vhd: 64-bit build fixes.
Daniel Stodden [Thu, 28 Jul 2011 02:07:25 +0000 (19:07 -0700)]
lvm/vhd: 64-bit build fixes.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agopart: Build with -fPIC
Daniel Stodden [Sat, 23 Jul 2011 20:16:37 +0000 (13:16 -0700)]
part: Build with -fPIC

libvhd.o wants to link partition.o

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoAdd .gitignore.
Daniel Stodden [Tue, 19 Jul 2011 22:13:15 +0000 (15:13 -0700)]
Add .gitignore.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovhd: move from linux asm/types.h to inttypes.h
Daniel Stodden [Tue, 19 Jul 2011 07:33:04 +0000 (00:33 -0700)]
vhd: move from linux asm/types.h to inttypes.h

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoFix 64-bit build.
Daniel Stodden [Tue, 19 Jul 2011 07:12:15 +0000 (00:12 -0700)]
Fix 64-bit build.

Mainly a matter of
 - Fixing printf formats.
 - Strip duplicate case statements in vhdio (foo vs foo64).
 - Some downcasts for integers turned long now.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoEA-1001: Break remaining XCP kernel build dependency. master
Daniel Stodden [Wed, 13 Jul 2011 21:17:45 +0000 (14:17 -0700)]
EA-1001: Break remaining XCP kernel build dependency.

Partial revert of 569:9f795e737459 (EA-1001: Build VBD ring macros
from kernel, not xen headers). Dropping KBUILD dependencies after
resorting to a private copy of the linux headers.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoEA-1001: Use a standalone copy of linux/blktap.h
Daniel Stodden [Wed, 13 Jul 2011 21:17:00 +0000 (14:17 -0700)]
EA-1001: Use a standalone copy of linux/blktap.h

Done with most of the BLKIF ring macros.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agocontrol: Fix devname use after free.
Daniel Stodden [Wed, 13 Jul 2011 21:03:47 +0000 (14:03 -0700)]
control: Fix devname use after free.

Rare error path only.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agocontrol: Fix tap_cli_stats_usage.
Daniel Stodden [Wed, 13 Jul 2011 21:03:19 +0000 (14:03 -0700)]
control: Fix tap_cli_stats_usage.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agovbd: Fixed broken rollback after open_vdi failure.
Daniel Stodden [Wed, 13 Jul 2011 20:56:37 +0000 (13:56 -0700)]
vbd: Fixed broken rollback after open_vdi failure.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agocontrol: Fix borked td create shutdown path.
Daniel Stodden [Wed, 13 Jul 2011 20:53:51 +0000 (13:53 -0700)]
control: Fix borked td create shutdown path.

Aiee, don't free the VBD when failing VDI open.

But free the name (we require it to be NULL on entry), so
tap-ctl-create can cleanly detach on rollback path.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoPR-1053: Fix a potential crasher in tapdisk_image_open_parent.
Daniel Stodden [Wed, 13 Jul 2011 20:53:28 +0000 (13:53 -0700)]
PR-1053: Fix a potential crasher in tapdisk_image_open_parent.

Bail out on cases not TD_NO_PARENT, such as -ENOENT.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoVHD: Improve misleading result code from failing vhd_parent_locator_get.
Daniel Stodden [Wed, 13 Jul 2011 20:51:37 +0000 (13:51 -0700)]
VHD: Improve misleading result code from failing vhd_parent_locator_get.

Presently always comes back with -EINVAL, due to a final
vhd_parent_locator_read failing. Fix returns -EINVAL when without
candidates altogether, and the last vhd_find_parent results
otherwise. Such as -ENOENT.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agopart: Fix CFLAGS.
Daniel Stodden [Tue, 28 Jun 2011 01:09:26 +0000 (18:09 -0700)]
part: Fix CFLAGS.

Don't override Rules.mk's CFLAGS (+, not =). Also, -O0 is for
single-stepping. If there's a problem, let's figure it out.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agomake: Remove tapdisk-disktype.o dupe from TAP-OBJS.
Daniel Stodden [Tue, 28 Jun 2011 01:08:58 +0000 (18:08 -0700)]
make: Remove tapdisk-disktype.o dupe from TAP-OBJS.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agocontrol: Fix tap_ctl_create rv after failing tap_ctl_spawn.
Daniel Stodden [Tue, 28 Jun 2011 01:08:57 +0000 (18:08 -0700)]
control: Fix tap_ctl_create rv after failing tap_ctl_spawn.

This typically applies on broken installations. Borked dev builds,
systems missing a feature or library, or missing a tapdisk2 binary
altogether.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoCA-61156: control: Anticipate tap-ctl-spawn racing a bugtool killall -USR1.
Daniel Stodden [Tue, 28 Jun 2011 01:08:57 +0000 (18:08 -0700)]
CA-61156: control: Anticipate tap-ctl-spawn racing a bugtool killall -USR1.

There's a race between tapdisk's sigaction init and xen-bugtool
shooting debug signals under RT stress. If killed by something as
innocuous as USR1, then just retry the fork().

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoMake blktap portable to Ubuntu
Mike McClurg [Tue, 7 Jun 2011 18:35:30 +0000 (19:35 +0100)]
Make blktap portable to Ubuntu

These are changes mostly required by gcc 4.5, with the exception of the change
to Config.mk, which inserts some make variables that we expect to be inserted
by the spec file. The rest of the changes are including missing headers,
initialising a variable and providing a mode when opening a file.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
13 years agoPR-1129: Add a manpage draft.
Daniel Stodden [Fri, 3 Jun 2011 08:20:11 +0000 (01:20 -0700)]
PR-1129: Add a manpage draft.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoPR-1129: minor rate limiter updates.
Daniel Stodden [Fri, 3 Jun 2011 08:20:11 +0000 (01:20 -0700)]
PR-1129: minor rate limiter updates.

 - Debug code + more error verbosity.
 - Support full paths for socket naming.
 - Correct inverted decimal/binary suffixes (ouch!).

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoMAR-125: Rate-limit VHD driver errors.
Daniel Stodden [Mon, 23 May 2011 02:23:47 +0000 (19:23 -0700)]
MAR-125: Rate-limit VHD driver errors.

Hooking into driver->ratelimit, sharing log rates with the VBD level
failures.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoMAR-125: Drop common VBD error message dups + use rate limits.
Daniel Stodden [Mon, 23 May 2011 02:23:46 +0000 (19:23 -0700)]
MAR-125: Drop common VBD error message dups + use rate limits.

 - Log only the first treq failure, driving vreq->error. Later treqs
   don't contribute to vreq status, so need not be logged either.

 - Ratelimit vreq failures (tlog_drv_error)

 - Store previous errors in vreq->prev_error upon retry. If the
   condition doesn't change during retry, drop the message.

 - Final timeout should be ERR, not LOG_INFO message.

Aims to significantly reduce retry log spam on borked SRs, hopefully
without losing critical information.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoMAR-125: Add driver log rate limits.
Daniel Stodden [Mon, 23 May 2011 02:23:46 +0000 (19:23 -0700)]
MAR-125: Add driver log rate limits.

Allocates one td-loglimit instance per driver instance. Present burst
size is 16 messages, over an interval of 90 seconds. To be shared by
both driver code and the VBD.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
13 years agoMAR-125: Support log rate limiting.
Daniel Stodden [Mon, 23 May 2011 02:23:45 +0000 (19:23 -0700)]
MAR-125: Support log rate limiting.

Much like Linux's ratelimit. Allow for message bursts of some size,
count messages as they pass. Drop messages once the burst size was
exceeded within a given interval. Next interval resets the count.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-57842: Fix deMorgan-esque glitch in the retry logic.
Daniel Stodden [Wed, 4 May 2011 21:25:06 +0000 (14:25 -0700)]
CA-57842: Fix deMorgan-esque glitch in the retry logic.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoXOP-38: (lcache) Detect out-of-space conditions before write() does.
Daniel Stodden [Sat, 16 Apr 2011 00:56:11 +0000 (17:56 -0700)]
XOP-38: (lcache) Detect out-of-space conditions before write() does.

Test free space in the caching SR before attempting to store our
reads. VHD block allocation writes on Ext3 have the nasty property of
blocking excessively after running out of space. We therefore
enable/disable ourselves at a 1/s granularity, querying free space
through statfs beforehand.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-51905: Preserve vbd->flags.
Daniel Stodden [Sat, 16 Apr 2011 00:31:02 +0000 (17:31 -0700)]
CA-51905: Preserve vbd->flags.

Ugh, more fallout after 608:1feb6ca365ef.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agox-chain: zero regex pointers to avoid regfree()'ing garbage
Andrei Lifchits [Thu, 31 Mar 2011 18:29:02 +0000 (19:29 +0100)]
x-chain: zero regex pointers to avoid regfree()'ing garbage

14 years agoCA-53968: Fix build.
Daniel Stodden [Mon, 14 Mar 2011 22:41:30 +0000 (15:41 -0700)]
CA-53968: Fix build.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-53968: Fix crasher after 592:a4ef44e898ac (Move blktap ring ...).
Daniel Stodden [Mon, 14 Mar 2011 21:44:57 +0000 (14:44 -0700)]
CA-53968: Fix crasher after 592:a4ef44e898ac (Move blktap ring ...).

VHD debug code, dumping unallocated requests, observing a null vreq.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-51905: Partially revert 590:df25c3e1f79f (Shorten tapdisk_vbd_open_vdi ...)
Daniel Stodden [Tue, 8 Mar 2011 08:52:02 +0000 (00:52 -0800)]
CA-51905: Partially revert 590:df25c3e1f79f (Shorten tapdisk_vbd_open_vdi ...)

Breaking resume on 'secondary' nodes. Won't get rid of that before SM
moves to chain declarations.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>