]> xenbits.xensource.com Git - people/dstodden/blktap.git/log
people/dstodden/blktap.git
14 years agoMake disk names const where needed.
Daniel Stodden [Tue, 15 Feb 2011 09:37:44 +0000 (01:37 -0800)]
Make disk names const where needed.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoAdd a containerof().
Daniel Stodden [Tue, 15 Feb 2011 09:37:44 +0000 (01:37 -0800)]
Add a containerof().

Cowardly sneaked into list.h.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoAdd some useful gccisms.
Daniel Stodden [Tue, 15 Feb 2011 09:37:44 +0000 (01:37 -0800)]
Add some useful gccisms.

This are all named after the linux/compiler.h ones, not to get
uneccessarily creative.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-46079: Remove the image reopen hack (2)
Daniel Stodden [Tue, 15 Feb 2011 09:37:44 +0000 (01:37 -0800)]
CA-46079: Remove the image reopen hack (2)

Stray code.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-29373: Don't retry when there's no point, batched.
Jake Wires [Tue, 15 Feb 2011 09:37:44 +0000 (01:37 -0800)]
CA-29373: Don't retry when there's no point, batched.

Date: Thu, 1 Jul 2010 11:33:47 -0700
[PATCH 68/79] don't retry when there's no point
[PATCH 69/79] fix handling early failures

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Acked-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-51534: fix vhd-util "destroy data" for preallocated-BAT VHDs
Andrei Lifchits [Sat, 12 Feb 2011 16:22:04 +0000 (16:22 +0000)]
CA-51534: fix vhd-util "destroy data" for preallocated-BAT VHDs

14 years agoEA-1001: Rework such that rpmbuild of the source rpm works without defining 'kernel_v...
Jonathan Ludlam [Tue, 8 Feb 2011 16:00:54 +0000 (16:00 +0000)]
EA-1001: Rework such that rpmbuild of the source rpm works without defining 'kernel_version'. This can still be overridden if required.

14 years agoCA-10471: Fix macro typos.
Daniel Stodden [Fri, 28 Jan 2011 00:33:15 +0000 (16:33 -0800)]
CA-10471: Fix macro typos.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-10471: Forward R/O flags to blktap.
Daniel Stodden [Thu, 27 Jan 2011 21:36:54 +0000 (13:36 -0800)]
CA-10471: Forward R/O flags to blktap.

Switch to newer blktap_device_info params:

 * Call a new ioctl command.

 * On legacy kernels, fall back to the old entry

 * Set flags for disk R/O-mode.

 * Set physical_sector_size (512, still).

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-10471: add option to mount tapdisks read-only
Jake Wires [Wed, 26 Jan 2011 22:28:43 +0000 (14:28 -0800)]
CA-10471: add option to mount tapdisks read-only

From 6ee06eff2f182097579a486f74899dc77a1955a9 Mon Sep 17 00:00:00 2001
Date: Wed, 1 Sep 2010 14:08:33 -0700

Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoEA-1001: Install tap-ctl.h in blktap include directory
Gianni Tedesco [Mon, 24 Jan 2011 15:58:24 +0000 (15:58 +0000)]
EA-1001: Install tap-ctl.h in blktap include directory

14 years agoEA-1001: Remove system libaio special build case.
Daniel Stodden [Tue, 18 Jan 2011 19:53:23 +0000 (11:53 -0800)]
EA-1001: Remove system libaio special build case.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoEA-1001: Use tapif_user ring header space with newer kernels.
Daniel Stodden [Tue, 18 Jan 2011 19:53:23 +0000 (11:53 -0800)]
EA-1001: Use tapif_user ring header space with newer kernels.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoEA-1001: Build VBD ring macros from kernel, not xen headers.
Daniel Stodden [Tue, 18 Jan 2011 19:53:23 +0000 (11:53 -0800)]
EA-1001: Build VBD ring macros from kernel, not xen headers.

Includes linux/blktap.h, not xen/io/blkif.h. Make therefore wants a
KBUILD argument to find the kernel headers.

Fallout:

 * Presently comes with loads of ugly blkif_t/ypedefs and defines to
   reduce noise under drivers/. Will go away with later VBD patches.

 * BLKTAP_RING_SIZE isn't constant anymore (due to _SC_PAGE_SIZE).
   Substituted with a MAX_REQUESTS defined to a fixed 32U. More
   flexible queue size dimensions are clearly a field for future work.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoEA-1001: Disable block-log.
Daniel Stodden [Tue, 18 Jan 2011 19:53:23 +0000 (11:53 -0800)]
EA-1001: Disable block-log.

Based on guest blkif ring definitions. Won't build before we can link
against xen-tools again.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoEA-1001: Nuke tapdisk1.
Daniel Stodden [Tue, 18 Jan 2011 19:53:23 +0000 (11:53 -0800)]
EA-1001: Nuke tapdisk1.

Including tapdisk-ipc.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-41427: Don't log errors to logfiles.
Daniel Stodden [Thu, 4 Nov 2010 23:34:36 +0000 (16:34 -0700)]
CA-41427: Don't log errors to logfiles.

Prevents flooding /var/log under non-transient error conditions.

Signed-off-by: Daneil Stodden <daniel.stodden@citrix.com>
14 years agoCA-44322: Remove AIO threading code.
Daniel Stodden [Thu, 14 Oct 2010 10:23:23 +0000 (03:23 -0700)]
CA-44322: Remove AIO threading code.

Reverts 557:68e1b3249623 and later. Kernel side improved since
linux-2.6.32.pq.hg 269:6ddf9e468ff8.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.comm>
14 years agoUpdate the RPM spec file buildrequires line
Jonathan Ludlam [Mon, 18 Oct 2010 14:06:05 +0000 (15:06 +0100)]
Update the RPM spec file buildrequires line

14 years agoCA-45498: Update RPM license header.
Daniel Stodden [Fri, 15 Oct 2010 20:45:08 +0000 (13:45 -0700)]
CA-45498: Update RPM license header.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-45498: Remove proprietary objects patch altogether.
Daniel Stodden [Fri, 15 Oct 2010 08:26:45 +0000 (01:26 -0700)]
CA-45498: Remove proprietary objects patch altogether.

Mainly to remove a warning regarding the empty diff during SRPM build.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCP-1840: Count ENOSPC redirects.
Daniel Stodden [Fri, 15 Oct 2010 01:17:31 +0000 (18:17 -0700)]
CP-1840: Count ENOSPC redirects.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-46696; CA-44322: Save 7968k per tapdisk.
Daniel Stodden [Thu, 14 Oct 2010 10:23:23 +0000 (03:23 -0700)]
CA-46696; CA-44322: Save 7968k per tapdisk.

Linux/x86 default thread stack size is 8M. That's more than needed.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-44425: add the "kill data" option to vhd-util-modify (required for reset-on-boot)
Andrei Lifchits [Mon, 4 Oct 2010 13:52:45 +0000 (14:52 +0100)]
CA-44425: add the "kill data" option to vhd-util-modify (required for reset-on-boot)

14 years agoCA-44322: Restrict I/O request merging on filesystems.
Daniel Stodden [Thu, 30 Sep 2010 21:01:47 +0000 (14:01 -0700)]
CA-44322: Restrict I/O request merging on filesystems.

Ensure that every single iocb can be issued with only the memory
reserves held in kernel space. Main resource prone to congestion are
bio structs.

For I/O continguous in physical storage, such as bare LUN mappings, a
single bio will hold up to 256 pages. To accomodate block mappings on
file systems, we reserve a more than 1 bio, but cannot submit iocbs of
arbitrary length without risking to stall once the reserve is
exhausted.

Limits the iocb size on ext. Assumes 4k blocks for now.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-44322: Add an I/O-submit thread.
Daniel Stodden [Thu, 30 Sep 2010 21:01:45 +0000 (14:01 -0700)]
CA-44322: Add an I/O-submit thread.

Slightly annoying to add threads to core blktap code, but necessary to
avoid potential starvation when dom0 gets under memory
pressure. Blktap can guarantee io_submit makes progress by keeping
memory reserves, but not enough to guarantee that it's
non-blocking. To refill the reserves, we want completion of in-flight
I/O the main even loop.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.comm>
14 years agoCA-46079: Recover the image storage type.
Daniel Stodden [Thu, 30 Sep 2010 21:01:40 +0000 (14:01 -0700)]
CA-46079: Recover the image storage type.

Used to be a message parameter passed in at open time, then down
through the VBD and images up to the driver. Replaced by stat() and
statfs().

The vbd->storage isn't really applicable with cross-SR VHD chains
became more popular, so removed. We keep the driver->storage, but only
for verbosity. Drivers with type-dependent code call
tapdisk_storage_type() during td_open() are encouraged to store the
result here.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-46079: Remove the VHDoLVM snapshot rename/reactivation support hacks.
Daniel Stodden [Thu, 30 Sep 2010 21:01:38 +0000 (14:01 -0700)]
CA-46079: Remove the VHDoLVM snapshot rename/reactivation support hacks.

Removed:
 - Switch from raw LV-* to sparse VHD-* leaves, dealing with renames.
 - The lvchange call to move the DM node to the new metadata.

Both rather handled by SM.

Signed-off-by: Daniel Stoddden <daniel.stodden@citrix.com>
14 years agoCA-46079: Remove the image reopen hack.
Daniel Stodden [Thu, 30 Sep 2010 21:01:35 +0000 (14:01 -0700)]
CA-46079: Remove the image reopen hack.

Used to reopen the image chain on the first request, thereby detecting
guest activation after migration. Obsolete since tapdisk is
spawned/resumed after VM stop/copy now.

Signed-off-by: Daniel Stoddden <daniel.stodden@citrix.com>
14 years agoCA-46079: Remove the blktap-1 control daemon.
Daniel Stodden [Thu, 30 Sep 2010 21:01:33 +0000 (14:01 -0700)]
CA-46079: Remove the blktap-1 control daemon.

Got in the way of shifting some definitions around.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-45316: Fix misleading VHD preallocation error.
Daniel Stodden [Wed, 29 Sep 2010 09:59:20 +0000 (02:59 -0700)]
CA-45316: Fix misleading VHD preallocation error.

Short writes are normally due to ENOSPC or EOD, so don't EIO. Then
save offset/count and report the actual errno for future generations.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-44974: Preserve the active connection list when freeing.
Daniel Stodden [Wed, 15 Sep 2010 00:32:35 +0000 (17:32 -0700)]
CA-44974: Preserve the active connection list when freeing.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoPR-1053: Fix bounce buffer allocation size.
Daniel Stodden [Thu, 9 Sep 2010 09:05:37 +0000 (02:05 -0700)]
PR-1053: Fix bounce buffer allocation size.

Anticipate significantly less than 2816 requests in flight.

Times 11 * 4k buffer space, this was worth 121MB memory, mlocked.

Since segment treqs are merged, use ring size with some extra headroom
for splits.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCP-1840: Avoid potential response msg loss.
Daniel Stodden [Thu, 9 Sep 2010 09:05:17 +0000 (02:05 -0700)]
CP-1840: Avoid potential response msg loss.

The write-message/close-connection path wouldn't even try a response
message xmit since. Note this case matters when IPC broke, normal I/O
will drain.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-44974: Make tap_ctl_close idempotent.
Daniel Stodden [Thu, 9 Sep 2010 09:05:17 +0000 (02:05 -0700)]
CA-44974: Make tap_ctl_close idempotent.

Avoid potential freelist/conn vector corruption due to
double-frees. Upgrade the WARN_ON() to a panic(), the present drain
loop doesn't want to be asked after disconnect.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCP-1840: Fix buffer xmit error return path in blktap-control.
Daniel Stodden [Thu, 9 Sep 2010 09:05:16 +0000 (02:05 -0700)]
CP-1840: Fix buffer xmit error return path in blktap-control.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoPR-1053: Simplify bounce buffer memcpy.
Daniel Stodden [Tue, 7 Sep 2010 11:47:23 +0000 (04:47 -0700)]
PR-1053: Simplify bounce buffer memcpy.

14 years agoPR-1053: Demalloc the data path.
Daniel Stodden [Tue, 7 Sep 2010 11:47:23 +0000 (04:47 -0700)]
PR-1053: Demalloc the data path.

14 years agoCA-44958: Sync lreq release with outstanding I/O.
Daniel Stodden [Tue, 7 Sep 2010 11:47:22 +0000 (04:47 -0700)]
CA-44958: Sync lreq release with outstanding I/O.

The writeback code doesn't check for partial I/O completion. Fixed
with a common treq.cb and a variable lreq->phase to read/write state.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCA-44675: Fix parent cache corruption due to I/O crosstalk.
Daniel Stodden [Tue, 7 Sep 2010 02:42:26 +0000 (19:42 -0700)]
CA-44675: Fix parent cache corruption due to I/O crosstalk.

Previous patch requeued completing ring I/O buffers.

An interesting question is why this succeeds without a proper tapdisk
crash. The only sane explanation I can come up with is that the common
path manages to queue AIOs before our response hits the kernel so
unmap goes after GUP page translation. Which sounds not too
improbable, the target leaf vhd bitmap was likely still hot at this
point.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCP-1760: Fix potential infinite loop condition in tap-ctl.
Daniel Stodden [Fri, 3 Sep 2010 19:38:50 +0000 (12:38 -0700)]
CP-1760: Fix potential infinite loop condition in tap-ctl.

Yet another sign check error.

14 years agoCP-1705: bug fix for local read caching
Andrei Lifchits [Wed, 1 Sep 2010 14:26:44 +0000 (15:26 +0100)]
CP-1705: bug fix for local read caching

14 years agoCP-1840: Hush tap-ctl stats calls.
Daniel Stodden [Wed, 1 Sep 2010 00:27:34 +0000 (17:27 -0700)]
CP-1840: Hush tap-ctl stats calls.

Also, not allowing client reentries is fatally wrong.

14 years agoCP-1840: More status info.
Daniel Stodden [Tue, 31 Aug 2010 21:28:11 +0000 (14:28 -0700)]
CP-1840: More status info.

output:

 * vbd.secs: counts sectors served.
 * image.hits/fail: counts sectors completed/failed (not forwarded).
 * image.driver.name: shows driver names, not only numbers.

tapdisk-stats:

 * Move nesting depth tracking to __stats_push/__stats_pop.
 * Adds tapdisk_stats_val(...)/tapdisk_stats_vval(va), for arrays.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCP-1732, CP-1733, CP-1734: Fix disk_types descriptors.
Daniel Stodden [Tue, 31 Aug 2010 19:36:43 +0000 (12:36 -0700)]
CP-1732, CP-1733, CP-1734: Fix disk_types descriptors.

14 years agoCP-1760: Unbreak tapdisk-control.
Daniel Stodden [Thu, 19 Aug 2010 01:47:25 +0000 (18:47 -0700)]
CP-1760: Unbreak tapdisk-control.

 - Connection free list didn't init correctly.
 - Socket errors rather want a sign on the size_t.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCP-1734: bug fixes (for failover from mirror mode on ENOSPC)
Andrei Lifchits [Tue, 17 Aug 2010 11:38:32 +0000 (12:38 +0100)]
CP-1734: bug fixes (for failover from mirror mode on ENOSPC)

14 years agoCP-1760: tap-ctl stats -- sample tapdisk object state.
Daniel Stodden [Tue, 17 Aug 2010 08:56:29 +0000 (01:56 -0700)]
CP-1760: tap-ctl stats -- sample tapdisk object state.

Marshals vbd/image/driver state into JSON object trees.

14 years agoCA-43116: Make list reponses non-verbose in syslog, too.
Daniel Stodden [Tue, 17 Aug 2010 08:56:28 +0000 (01:56 -0700)]
CA-43116: Make list reponses non-verbose in syslog, too.

14 years agoblktap: Write tapdisk-control response data asynchronous and fully buffered.
Daniel Stodden [Tue, 17 Aug 2010 08:56:28 +0000 (01:56 -0700)]
blktap: Write tapdisk-control response data asynchronous and fully buffered.

Tapdisk should never block on control connections. We preallocate
connection state for a number of clients, including buffer space for
the response (presently 4k/conn). Then stream back response data
asynchronously, driven by the event loop.

14 years agoblktap: Avoid a potential crasher in tapdisk-control.
Daniel Stodden [Tue, 17 Aug 2010 08:56:27 +0000 (01:56 -0700)]
blktap: Avoid a potential crasher in tapdisk-control.

Only affects a failure path quite unlikely to be taken.

14 years agoCP-1733: it's a good idea to zero a variable after testing it, not before
Andrei Lifchits [Sun, 15 Aug 2010 11:05:20 +0000 (12:05 +0100)]
CP-1733: it's a good idea to zero a variable after testing it, not before

14 years agoblktap: Catch SIGPIPE in tap-ctl.
Daniel Stodden [Fri, 6 Aug 2010 10:53:34 +0000 (03:53 -0700)]
blktap: Catch SIGPIPE in tap-ctl.

14 years agoCA-43084: Remove blocking opportunities from tapdisk-control.
Daniel Stodden [Fri, 6 Aug 2010 10:53:33 +0000 (03:53 -0700)]
CA-43084: Remove blocking opportunities from tapdisk-control.

Certainly should not syslog(), but use tlog instead. While we are at
it, preallocate the connection structs, too. Fixing a memleak by
509:abadd2f7ca77 (control op cancellation). Now uses tlog_syslog. The
noise "received"/"sending" noise should be avoided, but the logging
aids debugging in the meantime.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoCP-1732, CP-1733, CP-1734: add local caching support (alpha quality). This includes:
Andrei Lifchits [Tue, 20 Jul 2010 16:20:24 +0000 (17:20 +0100)]
CP-1732, CP-1733, CP-1734: add local caching support (alpha quality). This includes:
- read caching into the leaf
- mirror write mode
- failover to the secondary image on ENOSPC
- possibility of snapshotting of empty images (for cache setup)

14 years agoCA-42495: Add /etc/udev/rules.d/blktap.rules
Daniel Stodden [Fri, 16 Jul 2010 22:42:48 +0000 (15:42 -0700)]
CA-42495: Add /etc/udev/rules.d/blktap.rules

 * Creates /dev/blktap/{control|blktap%d}, i.e. not /dev/xen/blktap-2.
   Would take a ytbw tapctl patch.

 * Patched by the SRPM to ignore tapdevs.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoUpdate hgignore.
Daniel Stodden [Fri, 16 Jul 2010 22:42:40 +0000 (15:42 -0700)]
Update hgignore.

14 years agoblktap2: Confine list to a single pid, if given.
Daniel Stodden [Wed, 14 Jul 2010 00:47:39 +0000 (17:47 -0700)]
blktap2: Confine list to a single pid, if given.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Redo tap-ctl-list.
Daniel Stodden [Wed, 14 Jul 2010 00:47:39 +0000 (17:47 -0700)]
blktap2: Redo tap-ctl-list.

Consolidate all outputs to tap_list_t on list_heads, removing the
overcomplicated vectors. Includes a change to the tap_ctl_list
signature, accordingly. Simplifies the old join3 code, now
inlined. Remove the obsolete tap_list id. Introduces list_move and
list_splice_tail macros to list.h.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Minor cleanups.
Daniel Stodden [Wed, 14 Jul 2010 00:43:41 +0000 (17:43 -0700)]
blktap2: Minor cleanups.

 * Align format widths.
 * Delete extinguished get_driver_id symbol.
 * s/ctl/cli/.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoRevert cset 520:3e093e233406 (don't retry when there's no point).
Daniel Stodden [Sat, 3 Jul 2010 11:33:01 +0000 (04:33 -0700)]
Revert cset 520:3e093e233406 (don't retry when there's no point).

Needs more work. Generates ENOSYS responses on XS 5.6.900.

14 years agoblktap2: Fix tapdisk2 init.
Daniel Stodden [Sat, 3 Jul 2010 11:33:00 +0000 (04:33 -0700)]
blktap2: Fix tapdisk2 init.

Make the syslog/tlog engine log again.

 * Put start_logging after daemon().

 * Add an fdup helper to dup(stdin).
   Helps using deamon() without dropping stdout.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agodon't retry when there's no point
Jake Wires [Thu, 1 Jul 2010 19:29:06 +0000 (12:29 -0700)]
don't retry when there's no point

Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoensure progress when retries are needed
Jake Wires [Thu, 1 Jul 2010 19:25:44 +0000 (12:25 -0700)]
ensure progress when retries are needed

Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agodon't wedge if reopening vdi fails.
Jake Wires [Thu, 1 Jul 2010 19:24:01 +0000 (12:24 -0700)]
don't wedge if reopening vdi fails.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agomove debug message to make logs more intelligible
Jake Wires [Thu, 1 Jul 2010 19:22:44 +0000 (12:22 -0700)]
move debug message to make logs more intelligible

Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoxc git repo merger.
Daniel Stodden [Fri, 2 Jul 2010 01:55:20 +0000 (18:55 -0700)]
xc git repo merger.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoAll: Fix RPM install path definitions.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
All: Fix RPM install path definitions.

Help make libraries install to the correct location without Makefile
divergence from OSS org. Removes private defintions of LIBDIR from the
Makefiles. LIBDIR is globally defined by the toplevel make at xen.org,
and now by the RPM build accordingly.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Add libblktapctl.a/so to the RPM build.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Add libblktapctl.a/so to the RPM build.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Update tap-ctl timeouts and blocking behavior.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Update tap-ctl timeouts and blocking behavior.

Adds a -t <timeout> switch to the destroy, pause and close operations,
which are known to block. Changes the library call interfaces to use
timeval structs, not <int> secs, which are then passed around
internally. On Linux, the effect should be that we track the total
timeout across calls, not a maximum for individual operations.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Synchronize device removal when removing the vbd.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Synchronize device removal when removing the vbd.

Employ a new ring ioctl, BLKTAP2_IOCTL_REMOVE_DEVICE, which succeeds
only once the bdev is closed. Iterating events then safely drains the
queue. If not implemented, fall back to the previous behavior, which
may fail requests.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Fix event loop recursions in the I/O muxer.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Fix event loop recursions in the I/O muxer.

Suffered from a one deadlock occasions and a potential crasher, due to
gc'ing event structs before unwinding.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Fix tap-ctl-free return val.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Fix tap-ctl-free return val.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Support for control op cancellation.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Support for control op cancellation.

Make client disconnect cancel blocking operations.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Secure control event loop recursions.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Secure control event loop recursions.

Mask connection from the loop fdset while processing pending
requests.

Annotate message types, separating reentrant from non-rentrant control
operations. Non-reentrant operations fail with EBUSY. There is no
usecase for deferrals, arbitration is up to to upper levels in the
control stack.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Fix accept failure path in tapdisk-control.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Fix accept failure path in tapdisk-control.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Make tap-ctl spawn ouput the bare pid through pipes.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Make tap-ctl spawn ouput the bare pid through pipes.

14 years agoblktap2: Output tapdisk state in hex, consistently.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Output tapdisk state in hex, consistently.

14 years agoblktap2: Anticipate NULL log facility names.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Anticipate NULL log facility names.

14 years agoblktap2: Build libblktapctl.so
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Build libblktapctl.so

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Add tap_ctl_find_minor
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Add tap_ctl_find_minor

Slack 'tap-ctl find -t <type> -f <path>'.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: <sys/time.h> is needed for 'struct timeval'
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: <sys/time.h> is needed for 'struct timeval'

Also clean up a Makefile to use $(SBINDIR).

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoblktap2: Sync with latest OSS.
Daniel Stodden [Tue, 29 Jun 2010 20:03:09 +0000 (13:03 -0700)]
blktap2: Sync with latest OSS.

14 years agoUpdate blktap-devel.rpm.
Daniel Stodden [Fri, 11 Jun 2010 23:59:17 +0000 (16:59 -0700)]
Update blktap-devel.rpm.

To include all relevant headers and archives.

14 years agoblktap: Fix tapdisk disktype issues.
Daniel Stodden [Sat, 5 Jun 2010 02:05:01 +0000 (19:05 -0700)]
blktap: Fix tapdisk disktype issues.

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.

14 years agoblktap2: The tap-ctl control utility and library.
Daniel Stodden [Sun, 30 May 2010 01:34:14 +0000 (18:34 -0700)]
blktap2: The tap-ctl control utility and library.

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>
14 years agoCA-40842: fix CLI param handling error
Andrei Lifchits [Mon, 17 May 2010 17:47:16 +0000 (18:47 +0100)]
CA-40842: fix CLI param handling error

15 years agoCA-40171; Retry the chain reactivation if it fails because of UUID mismatch
Julian Chesterfield [Wed, 5 May 2010 15:36:09 +0000 (16:36 +0100)]
CA-40171; Retry the chain reactivation if it fails because of UUID mismatch
between footer and backup footer. Applying patch from Daniel.

15 years agoCA-40171: Fix vhd context leak in LV reactivation loop.
Daniel Stodden [Wed, 5 May 2010 00:33:52 +0000 (17:33 -0700)]
CA-40171: Fix vhd context leak in LV reactivation loop.

15 years agoCA-40696: Use system macros for fd set sizes.
Daniel Stodden [Fri, 23 Apr 2010 21:59:24 +0000 (14:59 -0700)]
CA-40696: Use system macros for fd set sizes.

15 years agoCA-40696: Bump up max number of tapdisks.
Daniel Stodden [Fri, 23 Apr 2010 02:38:12 +0000 (19:38 -0700)]
CA-40696: Bump up max number of tapdisks.

 * Kernel space blktap is good for 1024 disks.
 * Blktapctrl only for 504, due to fd_set size.

15 years agoCA-40171: Validate vhd parent chain during LV reactivation.
Daniel Stodden [Fri, 16 Apr 2010 02:06:04 +0000 (19:06 -0700)]
CA-40171: Validate vhd parent chain during LV reactivation.

Implementation of tapdisk_vbd_reactivate_volumes follows the vhd
parent chain, but therein lacks a critical check matching child and
parent uuids.

This creates a race window wherein reactivation hits an lv resize on
the master. The new last sector, while unrewritten, may carry garbage
footers. Results may vary, from plain reactivation failures to chain
traversal running off into the weeds.

Fixed with a proper uuid check. Adds some eprintfs to aid debugging
the corner cases.

15 years agoCA-39974: Revert -r486:94bcdedc9a6d
Daniel Stodden [Thu, 8 Apr 2010 06:43:45 +0000 (23:43 -0700)]
CA-39974: Revert -r486:94bcdedc9a6d

Known to risk queue deadlocks without 487:94a6007d887b.

15 years agoCA-39974; Unbreak tapdisk behaviour on trunk.
Julian Chesterfield [Wed, 7 Apr 2010 11:05:37 +0000 (11:05 +0000)]
CA-39974; Unbreak tapdisk behaviour on trunk.

15 years agoCA-35276: Deproprietarize all blktap sources.
Daniel Stodden [Tue, 6 Apr 2010 01:24:27 +0000 (18:24 -0700)]
CA-35276: Deproprietarize all blktap sources.

Remove the 'XenSource proprietary' stamp from all source headers,
adding a neat BSD-style disclaimer instead.

Won't bother removing build system support code.
Just set relevant source file lists to null.

15 years agoCA-29373: Unwedge queue after new request failure.
Daniel Stodden [Mon, 5 Apr 2010 19:35:18 +0000 (12:35 -0700)]
CA-29373: Unwedge queue after new request failure.

A tapdisk_vbd_issue_request failure is indication to back of from
further queue processing. The call however will also return error
status of a synchronous request failure.

When failing a new request immediately, we stop making progress. We
break out of the loop, subsequent incoming requests stay on the
new_requests lists, failed_requests is empty, so we block
indefinitely.

Patch decouples queue status from request status, we only back off if
the queue test fails, not the request. Otoh, this means we won't back
off after the first EBUSY encountered. One may argue the decision
about what's busy and not is better made by the driver, not the VBD.

15 years agoCA-29373: Stop retrying the pathetic case.
Daniel Stodden [Mon, 5 Apr 2010 19:35:16 +0000 (12:35 -0700)]
CA-29373: Stop retrying the pathetic case.

Separating the retryable from the recoverable errors should make the
control path more responsive to broken SRs or images. Fail vreqs with
irrecoverable errors immediately. Presently known ones comprise ESTALE
and ENOSPC. Both don't have a great prospect to improve within the
next two minutes.

Note that this somewhat obsoletes ENOSPC, as our original reason for
adding a tapdisk-level forced-shutdown. However, there may still be
reasons to discard retryable requests.

15 years agoCP-1613: Fix compiler warnings
Daniel Stodden [Mon, 5 Apr 2010 19:35:16 +0000 (12:35 -0700)]
CP-1613: Fix compiler warnings

The vhd_cache_init/enabled calls were redeclared inline after their
original declaration, yielding an ugly warning. These are module
members, not header macros. Safe to leave the inlining to the
compiler.

15 years agoCA-39535: Break call chain recursion during force-shutdown.
Daniel Stodden [Mon, 5 Apr 2010 19:35:15 +0000 (12:35 -0700)]
CA-39535: Break call chain recursion during force-shutdown.

Pending requests during shutdown flag TD_VBD_SHUTDOWN_REQUESTED,
resulting in an endless vbd_close -> vbd_kick -> vbd_check_state ->
vbd_close loop.

The vbd_check_state call was added to unblock canonical (synchronous)
I/O mode in cset 45c15fdaed55 (Separate tapdisk raw I/O into different
backends).

We only need the queue dispatch during vbd_kick. Fixed by breaking a
vbd_check_queue_state out of vbd_check_state.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
15 years agoImport libvhdio from the XenClient fork of blktap (required for transfervm VHD tests)
Andrei Lifchits [Thu, 1 Apr 2010 02:23:32 +0000 (19:23 -0700)]
Import libvhdio from the XenClient fork of blktap (required for transfervm VHD tests)