Commit Graph

42 Commits

Author SHA1 Message Date
Alex Young
e21beb1866 Add the REQUEST_ENTRUST nbd request type 2012-06-21 17:12:06 +01:00
Alex Young
a3dc670939 Squash valgrind errors by making sure client threads get joined on termination 2012-06-21 17:11:12 +01:00
Alex Young
43e95dc4db Make sure all the lines we read get freed (including the trailing blank) 2012-06-21 15:31:28 +01:00
Alex Young
4e8a9670e5 Merge 2012-06-21 11:37:18 +01:00
Alex Young
e3c04ade29 Added early-exit on any valgrind error 2012-06-21 11:37:00 +01:00
Alex Young
7d1c15b07a Fix two bugs in mirroring.
First, Leaving off the source address caused a segfault in the
command-sending process because there was no NULL check on the ARGV
entry.

Second, while the migration thread sent a signal to the server to close
on successful completion, it didn't wait until the close actually
happened before releasing the IO lock.  This meant that any client
thread waiting on that IO lock could have a read or a write queued up
which could succeed despite the server shutdown.  This would have meant
dataloss as the guest would see a successful write to the wrong instance
of the file.  This patch adds a noddy serve_wait_for_close() function
which the mirror_runner calls to ensure that any clients will reject
operations they're waiting to complete.

This patch also adds a simple scenario test for migration, and fixes
TempFileWriter#read_original.
2012-06-13 13:44:21 +01:00
Alex Young
c7525f87dc Removed proxying completely and fixed the pthread_join bug revealed in the process 2012-06-12 15:08:07 +01:00
Alex Young
c6182b9edf Merge 2012-06-11 14:59:52 +01:00
Alex Young
e2d3161a4a Set default log level to warn to shut the tests up 2012-06-11 14:59:26 +01:00
nick
5ab9e10019 test: make check_serve bind() its outgoing socket to a known IP for these tests 2012-06-11 14:40:41 +01:00
Alex Young
25fc0969cf Make the compiler stricter and tidy up code to make the subsequent errors and warnings go away 2012-06-11 13:57:03 +01:00
nick
893db71d7c Whitespace 2012-06-11 13:05:22 +01:00
nick
224bdcbf87 Fix handling ACLs where > 1 entry exists 2012-06-11 12:56:45 +01:00
nick
0b90517035 tests: Get rid of a warning 2012-06-11 10:08:24 +01:00
nick
0441ef9d74 tests: Get check_serve working after the merge of doom 2012-06-11 10:04:31 +01:00
Matthew Bloch
e8b5fae7ab Merge, just renaming old error macros. 2012-06-09 02:37:23 +01:00
Matthew Bloch
b546539ab8 Rewrote error & log functions to be more general, use longjmp to get out of
trouble and into predictable cleanup functions (one for each of serve,
client & control contexts).  We use 'fatal' to mean 'kill the thread' and
'error' to mean 'don't kill the thread', assuming some recovery action,
except I don't use error anywhere yet.
2012-06-09 02:25:12 +01:00
Alex Young
b7096ef908 Audit client connections on acl update 2012-06-08 18:03:41 +01:00
Alex Young
35ca93b42c Lock around acl updates 2012-06-08 11:02:40 +01:00
Alex Young
f7e1a098b1 Move updating the acl object into serve.c
* * *
Replacing the server acl sends an acl_updated signal
2012-06-08 10:32:33 +01:00
Alex Young
5fb0cd4cca Fix O_NONBLOCK setting on self_pipes 2012-06-08 10:11:06 +01:00
Alex Young
2d9d00b636 Pull ACLs into their own struct 2012-06-07 17:47:43 +01:00
Alex Young
1cd8f4660f Merge of doom 2012-06-07 14:40:55 +01:00
Alex Young
5930f25034 Use client stop signals for thread stopping 2012-06-07 14:25:30 +01:00
Matthew Bloch
3810a8210f Added some record-keeping / printing to fuzzer to assist with backtracking. 2012-06-07 12:25:56 +01:00
Alex Young
a90f84972b Add stop signals to client threads 2012-06-07 11:44:19 +01:00
Matthew Bloch
08f3d42b34 Improved fuzz test to find an actual code bug (previous bug was in the test
<g>).
2012-06-07 02:06:08 +01:00
nick
648f768ff6 tests: fix the Ruby flexnbd wrapper for mirror 2012-06-06 13:33:24 +01:00
Matthew Bloch
60cb089e45 Added fuzzer which currently exposes ugly bug with unaligned writes. 2012-06-06 01:28:54 +01:00
Matthew Bloch
d981dde8d1 Fixed FlexNBD#serve parameters, added detection of non-starting server. 2012-06-06 01:28:30 +01:00
Alex Young
1ddb3bb609 Add a self_pipe set of convenience functions 2012-06-01 16:25:27 +01:00
Alex Young
185a840e03 Factor out the bulk of client_serve_request, and add convenience converters in src/nbdtypes.c 2012-05-31 17:44:11 +01:00
Alex Young
074efd9fa4 Add a no-op debug() define for non-debug builds and make valgrind optional in nbd_scenarios 2012-05-31 13:53:04 +01:00
Alex Young
268bebd408 Run the nbd_scenario tests under valgrind 2012-05-31 13:23:12 +01:00
Alex Young
0102217019 Merge 2012-05-30 15:39:55 +01:00
Alex Young
0c62e66a70 Added getopt_long command-line handling.
All parameters now have switches.  The one gotcha is the parameter which
was overloaded - s_length_or_filename to params_readwrite - is only
pretending to be a length at the moment. If you pass a filename it'll
still work, but the help messages don't mention that.  I'll split the
parameter into two in a later commit.
2012-05-30 15:19:40 +01:00
Alex Young
7832958522 Rearranged the project to have src/ and build/ directories
This simplifies keeping everything clean.
2012-05-30 09:51:20 +01:00
mbloch
cf2400fedd Fixed race in tests. 2012-05-29 17:01:54 +01:00
Matthew Bloch
c54d4a68ba Added another write/read test, fixed bugs in splice() usage and IPv6
socket handling.
2012-05-27 14:40:16 +01:00
Matthew Bloch
5a5041a751 First few external tests with test/unit, some minor tidying of internal data
structures.
2012-05-24 01:39:35 +01:00
Matthew Bloch
f7ce2c0ea5 Mostly finished bitset tests, fixed test build to include utilities, remove
efence as valgrind far preferable.
2012-05-21 03:17:32 +01:00
Matthew Bloch
c94b6f365c Tweaks to bitset.h, established a C test framework. 2012-05-20 14:38:46 +01:00