652 Commits

Author SHA1 Message Date
James Carter
b18c46606f Merge branch 'release-to-master' into 'develop'
Updated changelog for release 0.3.0

See merge request open-source/flexnbd-c!52
2018-04-24 12:12:06 +01:00
Patrick J Cherry
b3cea813e4 Updated changelog for release 2018-04-24 12:06:06 +01:00
James Carter
3e0d30f6b9 Merge branch 'reinstate-sync-after-every-write' into 'develop'
Reinstate sync after every write

See merge request open-source/flexnbd-c!51
2018-04-24 12:02:53 +01:00
Patrick J Cherry
3b1a150315 Updated changelgo 2018-04-24 10:27:46 +01:00
Patrick J Cherry
ead6328d80 Force sync after every write 2018-04-24 10:27:02 +01:00
James Carter
20b4f069c8 Merge branch 'release-to-master' into 'develop'
Merge back to develop

See merge request open-source/flexnbd-c!49
2018-02-20 11:52:37 +00:00
Patrick J Cherry
331ca4be14 Updated changelog for release 2018-02-20 11:45:42 +00:00
James Carter
fb5714765c Merge branch 'fix-formatting' into 'develop'
Formatted all code using `indent`

See merge request open-source/flexnbd-c!47
2018-02-20 11:42:25 +00:00
Patrick J Cherry
af3bb16ff7 Merge branch 'develop' into fix-formatting 2018-02-20 11:06:58 +00:00
Patrick J Cherry
9cbcc7c95a Added note about the test file formatting 2018-02-20 11:05:36 +00:00
Patrick J Cherry
8893cd06c4 Re-formatted tests with a bit of tinkering by hand 2018-02-20 11:02:33 +00:00
James Carter
166db9b1f7 Merge branch 'enable-flags-test' into 'develop'
Enable request flags test

See merge request open-source/flexnbd-c!48
2018-02-20 10:23:42 +00:00
Patrick J Cherry
103bd7ad5b Undo formatting on test suite -- it wasn't right 2018-02-20 10:13:42 +00:00
Patrick J Cherry
7bee1aadfe Enable request flags test
Missed this out when I wrote the test!
2018-02-20 10:11:38 +00:00
Patrick J Cherry
f47f56d4c4 Formatted all code using indent 2018-02-20 10:05:35 +00:00
James Carter
19a1127bde Merge branch 'fix-correct-num-clients-status' into 'develop'
Call the thread cleanup code when requesting `status`

See merge request open-source/flexnbd-c!46
2018-02-20 09:51:37 +00:00
James Carter
073a4ac0fa Merge branch '35-incorrect-struct-type-used-in-readwrite-c' into 'develop'
Resolve "Incorrect struct type used in readwrite.c"

Closes #35

See merge request open-source/flexnbd-c!41
2018-02-20 09:50:25 +00:00
Patrick J Cherry
623007bfff Remove last reference to removed test_gets_num_clients 2018-02-19 10:22:01 +00:00
Patrick J Cherry
27a94a807e Remove the test_gets_num_clients test from the C unit tests
This test was causing problems by using dummy pointers to simulate
connections.  When calling the cleanup code, these pointers were
thought to be real, and the code attemtped to clean up threads
referenced by those pointers, causing a segfault.

I've reimplemented the test in the ruby acceptance suite.
2018-02-16 13:46:31 +00:00
Patrick J Cherry
1407407ff4 Updated changelog 2018-02-16 13:00:31 +00:00
Patrick J Cherry
d0439dab88 Call the thread cleanup code when requesting status
This ensures the correct number of connected clients is returned when
the status command is issued.

Previously the thread pool would only be cleaned up on a new connection.
2018-02-16 12:58:03 +00:00
James F. Carter
9f56f38f42 Merge branch 'rationalise-ld-preload-tests' into develop 2018-02-14 16:48:57 +00:00
Chris Elsworth
370d04d971 Merge branch 'take-request-response-size-into-malloc' into 'develop'
Update proxy malloc to add the struct size onto the request/response buffer

See merge request open-source/flexnbd-c!45
2018-02-14 05:28:24 +00:00
Patrick J Cherry
099e29de91 Merge branch 'develop' into 'take-request-response-size-into-malloc'
# Conflicts:
#   debian/changelog
2018-02-13 17:06:41 +00:00
Patrick J Cherry
2e17e8955f Added tests for NBD_MAX_SIZE
This constant is only used in the proxy, so the tests only cover proxy
mode.
2018-02-13 17:04:51 +00:00
Patrick J Cherry
bb1f6ecdf5 Updated changelog 2018-02-13 15:51:09 +00:00
Patrick J Cherry
158379ba7a Use correct constant name. 2018-02-12 19:11:24 +00:00
Patrick J Cherry
1c66b56af1 Update proxy malloc to add the struct size onto the request/response buffer
This alters the meaning of NBD_MAX_SIZE to be the actual max request size
we'll accept over nbd.  Previously it was *nearly* the max size we'd
accept depending on the size of the struct.
2018-02-12 19:04:29 +00:00
Ian Chilton
03d9eb01b5 Merge branch 'increase-log-level-for-readloop-failures' into 'develop'
Increase log level for readloop failures, which might help with diagnosis

See merge request open-source/flexnbd-c!44
2018-02-09 15:38:48 +00:00
Patrick J Cherry
cdcd527544 Refactored read_reply to compare the network-byte-ordered handle 2018-02-09 12:18:34 +00:00
Patrick J Cherry
169d40f575 Increase log level for readloop failures, which might help with diagnosis 2018-02-09 11:57:07 +00:00
Patrick J Cherry
21f384e343 Updated changelog 2018-02-09 11:44:28 +00:00
Patrick J Cherry
9817fd7b0a Final tidies, comments etc. 2018-02-09 11:42:25 +00:00
Patrick J Cherry
195de41d86 Remove extra line 2018-02-09 11:32:26 +00:00
Patrick J Cherry
5b350e10e5 Merge branch 'develop' into '35-incorrect-struct-type-used-in-readwrite-c'
# Conflicts:
#   debian/changelog
2018-02-09 11:29:48 +00:00
Patrick J Cherry
b75a6529d0 Move LdPreload include to correct place 2018-02-09 10:41:24 +00:00
Patrick J Cherry
8e67180999 Check that TCP_NODELAY is set on upstream sockets on reconnection
Also rationalize the test to see if a function has been called.  Still
not great, but getting there :)
2018-02-09 10:26:08 +00:00
Patrick J Cherry
c053a54faa Added test to cover setsockopt for tcpkeepalive 2018-02-08 23:07:17 +00:00
Patrick J Cherry
ebacf738bc Tidy up ld preload hacks 2018-02-08 22:28:34 +00:00
James Carter
c4bab3f81f Merge branch 'truncate-odd-sized-discs' into 'develop'
Discs must be sized in multiples of 512 bytes or odd things happen

See merge request open-source/flexnbd-c!42
2018-02-08 16:49:36 +00:00
Patrick J Cherry
a19267b377 Adjust block-rounding line to match in serve.c 2018-02-08 16:37:36 +00:00
Patrick J Cherry
23d9ff587e Updated changelog 2018-02-08 16:36:20 +00:00
Patrick J Cherry
347b7978e4 Discs must be sized in multiples of 512 bytes or odd things happen
In #36 some of the odd errors were due to seeks beyond the end of the
disc.  This was because the disc was "specially crafted" to be 25GB + 1
byte, which doesn't fit into the normal 512 byte sectors expected of a
disc.  This lead to reads going beyond the end of the disc etc.

If a similarly evil disc is used with `losetup`, it just ignores the
last bytes of the disc that don't fit into 512 chunks.  This is what
that patch does, logging an error at the same time.
2018-02-08 16:31:28 +00:00
Patrick J Cherry
f8fec5f57e Alter struct types to reflect reality, avoiding mixing "host" and "raw" structs 2018-02-08 15:46:34 +00:00
James Carter
1672b4b88b Merge branch '36-breaks-when-trying-to-install-debian-from-cd' into 'develop'
Resolve "breaks when trying to install debian from CD"

Closes #36

See merge request open-source/flexnbd-c!40
2018-02-08 13:59:12 +00:00
Patrick J Cherry
5e9dbbd626 Updated changelgo 2018-02-08 13:32:10 +00:00
Patrick J Cherry
8beb3f0af6 Allow proxy to pass NBD protocol errors downstream; server returns EINVAL/ENOSPC appropriately
Previously the proxy would just disconnect when it saw an NBD protocol
error, and retry the operation it was in the middle of.

Additionally, the server needs to return the correct error types when
this happens.
2018-02-08 13:19:51 +00:00
James Carter
806de13024 Merge branch 'try-flags' into 'develop'
Set flags to show we can accept FUA and FLUSH commands

See merge request open-source/flexnbd-c!38
2018-02-08 11:18:31 +00:00
Patrick J Cherry
f71b872622 Only set up LD_PRELOAD for tests that actually need it. 2018-02-07 22:05:07 +00:00
Patrick J Cherry
79181b3153 Added LD_PRELOAD library to monitor msync calls in testing 2018-02-07 21:45:20 +00:00