aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap2/control
Commit message (Collapse)AuthorAgeFilesLines
* tools/blktap2: Handle read/write interrupts in blktap2 control plane.Dr. Greg Wettstein2013-03-281-2/+8
| | | | | | | | | | | | | | | | | | | | | | The following patch: tools: Retry blktap2 tapdisk message on interrupt. Addressed a long standing regression with the blktap2 control plane. An interruption of the select system call would prematurely terminate the message sequence needed to properly shutdown a blktap2 tapdisk instance. Ian Jackson correctly noted that the read and write systems calls responsible for receiving and sending the control messages could also return EINTR resulting in similar effects. While this regression was not noted in field testing this patch adds support to re-start the calls to provide a technically complete implementation of control plane management in the presence of signals. Signed-off-by: Dr. Greg Wettstein <xen@wind.enjellic.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: Retry blktap2 tapdisk message on interrupt.Dr. Greg Wettstein2013-03-251-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-start blktap2 IPC select call on interrupt. We hunted this miserable bug for a long time. The teardown of a blktap2 tapdisk instance is being carried out inconsistently up to and including the 4.2.1 release. The problem appears to be a classic 'Heisenbug' which disappears if a single function call is added to the tapdisk shutdown path. It is likely this bug has been in existence for the life of the blktap2 code. Control messages to manipulate a tapdisk instance are sent over a UNIX domain socket. A select call is used on both the read and write paths to wait on I/O and to set a timeout for the transmission and reception of the control plane messages. The existing code fails receipt or transmission of the control message on any type of error return from the select call. The xl control process receives an interrupt while waiting in the select call which in turn causes an error return with SIGINT as the return code. This prematurely terminates the teardown of the tapdisk instance leaving it in various states of shutdown. Since multiple messages are needed to implement a full teardown the tapdisk instance can be left in various states ranging from fully connected to only the minor being left allocated. The fix is straight forward. Check the return code from the select call and re-try read or write of the control message if errno is sent to EINTR. The problem manifests itself in the read path but there appears to be little reason to not add the fix to the write path as well. Both paths appear to be cut-and-paste copies of each other. Signed-off-by: Dr. Greg Wettstein <greg@enjellic.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: propagate error from tap_ctl_spawn.Ian Campbell2011-11-281-1/+3
| | | | | | | | | Failure here means that a disk will not be correctly setup. I briefly scanned tools/blktap2/control.c for other goto constructs which did not set their err variable but didn't see any others. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: attempt to cleanup tapdisk processes on disk backend destroy.Ian Campbell2011-09-282-7/+7
| | | | | 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-311-2/+2
| | | | | | | | 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>
* tools: consistently use $({CFLAGS,LDLIBS}_libxenctrl) instead of open coding.Ian Campbell2011-03-211-1/+1
| | | | | | 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: consistently use $(CFLAGS_xeninclude) instead of open coding.Ian Campbell2011-03-211-1/+2
| | | | | | | | Renamed from the slightly ambiguous CFLAGS_include. 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-171-1/+1
| | | | | | | | 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>
* blktap2: Makefiles: delete symlinks and deps during make cleanGianni Tedesco2010-10-281-0/+1
| | | | | Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* add SONAME to libblktapctl.soOlaf Hering2010-08-121-10/+25
| | | | | | | | | | | | Add an SONAME to libblktapctl.so. Install static library as data to avoid executable permissions in the .a file. Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- tools/blktap2/control/Makefile | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-)
* libblktapctl: fix use-after-free bugGianni Tedesco2010-08-031-2/+2
| | | | | | | | | | This has not caused crashes because generally use after free is OK provided nothing else is going on. However the patch makes things correct. It also allows us to use heap poisoning feature of valgrind on tools linking to libblktapctl. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* blktap2: Build libblktapctl.soKeir Fraser2010-06-102-9/+17
| | | | Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Add tap_ctl_find_minorKeir Fraser2010-06-102-0/+31
| | | | | | Slack 'tap-ctl find -t <type> -f <path>'. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: Fix broken tap-ctl-list type/path filter logicKeir Fraser2010-06-101-2/+2
| | | | Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
* blktap2: <sys/time.h> is needed for 'struct timeval'Keir Fraser2010-06-091-3/+2
| | | | | | Also clean up a Makefile to use $(SBINDIR). Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* blktap2: The tap-ctl userspace control utility and library.Keir Fraser2010-06-0818-0/+2862
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>