8 Commits

Author SHA1 Message Date
James Carter
b4cb2d9240 Merge branch 'fix-wrong-handle-type' into 'master'
Fix up "wrong" handle type from char* to uint64_t

Following from the NBD handle comparison simplifications.

See merge request !25
2016-10-07 10:20:35 +01:00
James Carter
1efb7bada6 Merge branch 'fix-unsigned-longs-in-bitset-test' into 'master'
fix check_bitset test on 32-bit platforms

The use of `unsigned long` and `UL` suffices caused this test to fail
on 32 bit platforms, where these are just 4, not 8 bits long.

```
tests/unit/check_bitset.c:73:F:bit:test_bit_ranges:0: longs[32] = 0 SHOULD BE ffffffff
```

See merge request !24
2016-10-07 10:20:08 +01:00
James Carter
6bc2a4c0b9 Merge branch 'fix-cast-from-pointer-to-wrong-size-integer-in-serve' into 'master'
This fixes the compiler warning pointer-to-int-cast in serve.c

```
In file included from src/server/bitset.h:4:0,
                 from src/server/mirror.h:8,
                 from src/server/flexnbd.h:5,
                 from src/server/serve.h:8,
                 from src/server/serve.c:1:
src/server/serve.c: In function 'tryjoin_client_thread':
src/server/serve.c:258:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      (uint64_t)status);
      ^
```

See merge request !23
2016-10-07 09:59:24 +01:00
James Carter
59de76c50c Merge branch 'skip-large-file-test-on-i386' into 'master'
Skip large file test on 32-bit platforms

This test cannot run on 32-bit machines as they cannot access files
large than 2G.  Makes flexnbd on 32-bit a bit useless really..

See merge request !22
2016-10-07 09:57:09 +01:00
Patrick J Cherry
209da655b3 Skip large file test on 32-bit platforms
This test cannot run on 32-bit machines as they cannot access files
large than 2G.  Makes flexnbd on 32-bit a bit useless really..
2016-10-06 21:42:52 +01:00
Patrick J Cherry
52b45e6b40 fix check_bitset test on 32-bit platforms
The use of `unsigned long` and `UL` suffices caused this test to fail
on 32 bit platforms, where these are just 4, not 8 bits long.

```
tests/unit/check_bitset.c:73:F:bit:test_bit_ranges:0: longs[32] = 0 SHOULD BE ffffffff
```
2016-10-06 21:22:53 +01:00
Patrick J Cherry
d279eb7570 Fix up "wrong" handle type from char* to uint64_t
Following from the NBD handle comparison simplifications.
2016-10-06 21:19:15 +01:00
Patrick J Cherry
c07df76ede This fixes the compiler warning pointer-to-int-cast in serve.c
```
In file included from src/server/bitset.h:4:0,
                 from src/server/mirror.h:8,
                 from src/server/flexnbd.h:5,
                 from src/server/serve.h:8,
                 from src/server/serve.c:1:
src/server/serve.c: In function 'tryjoin_client_thread':
src/server/serve.c:258:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      (uint64_t)status);
      ^
```
2016-10-06 21:16:07 +01:00
12 changed files with 10 additions and 2893 deletions

2783
debian/changelog vendored

File diff suppressed because it is too large Load Diff

1
debian/compat vendored
View File

@@ -1 +0,0 @@
7

25
debian/control vendored
View File

@@ -1,25 +0,0 @@
Source: flexnbd
Section: web
Priority: extra
Maintainer: Patrick J Cherry <patrick@bytemark.co.uk>
Build-Depends: debhelper (>= 7.0.50), ruby, gcc, libev-dev, txt2man, check, net-tools
Standards-Version: 3.8.1
Homepage: https://github.com/BytemarkHosting/flexnbd-c
Package: flexnbd
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libev4 | libev3
Description: FlexNBD server
An NBD server offering push-mirroring and intelligent sparse file handling
Package: flexnbd-dbg
Architecture: any
Section: debug
Priority: extra
Depends:
flexnbd (= ${binary:Version}),
${misc:Depends}
Description: debugging symbols for flexnbd
An NBD server offering push-mirroring and intelligent sparse file handling
.
This package contains the debugging symbols for flexnbd.

53
debian/copyright vendored
View File

@@ -1,53 +0,0 @@
This work was packaged for Debian by:
Alex Young <alex@bytemark.co.uk> on Wed, 30 May 2012 16:46:58 +0100
It was downloaded from:
<url://example.com>
Upstream Author(s):
<put author's name and email here>
<likewise for another author>
Copyright:
<Copyright (C) YYYY Firstname Lastname>
<likewise for another author>
License:
### SELECT: ###
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
### OR ###
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
##########
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
The Debian packaging is:
Copyright (C) 2012 Alex Young <alex@bytemark.co.uk>
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.

View File

@@ -1,3 +0,0 @@
build/flexnbd usr/bin
build/flexnbd-proxy usr/bin

View File

@@ -1,2 +0,0 @@
build/flexnbd.1.gz
build/flexnbd-proxy.1.gz

19
debian/rules vendored
View File

@@ -1,19 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@
override_dh_strip:
dh_strip --dbg-package=flexnbd-dbg
#
# TODO: The ruby test suites don't work during buiding in a chroot, so leave
# them out for now.
#
#override_dh_auto_test:
# rake test:run

View File

@@ -1 +0,0 @@
3.0 (quilt)

View File

@@ -255,7 +255,7 @@ int tryjoin_client_thread( struct client_tbl_entry *entry, int (*joinfunc)(pthre
debug("nbd thread %016x exited (%s) with status %ld", debug("nbd thread %016x exited (%s) with status %ld",
entry->thread, entry->thread,
s_client_address, s_client_address,
(uint64_t)status); (uintptr_t)status);
client_destroy( entry->client ); client_destroy( entry->client );
entry->client = NULL; entry->client = NULL;
entry->thread = 0; entry->thread = 0;

View File

@@ -115,6 +115,11 @@ class TestHappyPath < Test::Unit::TestCase
def test_write_to_high_block def test_write_to_high_block
#
# This test does not work on 32 bit platforms.
#
skip("Not relevant on 32-bit platforms") if ( ["a"].pack("p").size < 8 )
# Create a large file, then try to write to somewhere after the 2G boundary # Create a large file, then try to write to somewhere after the 2G boundary
@env.truncate1 "4G" @env.truncate1 "4G"
@env.serve1 @env.serve1

View File

@@ -59,7 +59,7 @@ END_TEST
START_TEST(test_bit_ranges) START_TEST(test_bit_ranges)
{ {
bitfield_word_t buffer[BIT_WORDS_FOR_SIZE(4160)]; bitfield_word_t buffer[BIT_WORDS_FOR_SIZE(4160)];
uint64_t *longs = (unsigned long*) buffer; uint64_t *longs = (uint64_t *) buffer;
uint64_t i; uint64_t i;
memset(buffer, 0, 4160); memset(buffer, 0, 4160);
@@ -67,9 +67,9 @@ START_TEST(test_bit_ranges)
for (i=0; i<64; i++) { for (i=0; i<64; i++) {
bit_set_range(buffer, i*64, i); bit_set_range(buffer, i*64, i);
fail_unless( fail_unless(
longs[i] == (1UL<<i)-1, longs[i] == (1ULL<<i)-1,
"longs[%ld] = %lx SHOULD BE %lx", "longs[%ld] = %lx SHOULD BE %lx",
i, longs[i], (1L<<i)-1 i, longs[i], (1ULL<<i)-1
); );
fail_unless(longs[i+1] == 0, "bit_set_range overshot at i=%d", i); fail_unless(longs[i+1] == 0, "bit_set_range overshot at i=%d", i);

View File

@@ -46,8 +46,7 @@ void * responder( void *respond_uncast )
struct respond * resp = (struct respond *) respond_uncast; struct respond * resp = (struct respond *) respond_uncast;
int sock_fd = resp->sock_fds[1]; int sock_fd = resp->sock_fds[1];
struct nbd_request_raw request_raw; struct nbd_request_raw request_raw;
char wrong_handle[] = "WHOOPSIE"; uint64_t wrong_handle = 0x80;
if( fd_read_request( sock_fd, &request_raw ) == -1){ if( fd_read_request( sock_fd, &request_raw ) == -1){
fprintf(stderr, "Problem with fd_read_request\n"); fprintf(stderr, "Problem with fd_read_request\n");