Wouter Verhelst [Mon, 26 Jul 2010 23:44:17 +0000 (19:44 -0400)]
Initial implementation of named exports
Wouter Verhelst [Mon, 26 Jul 2010 20:37:29 +0000 (16:37 -0400)]
Fix segfault
Wouter Verhelst [Sun, 25 Jul 2010 13:19:20 +0000 (15:19 +0200)]
Documentation update
Wouter Verhelst [Sun, 25 Jul 2010 00:04:09 +0000 (02:04 +0200)]
Prepare for 2.9.16
Wouter Verhelst [Sun, 25 Jul 2010 00:00:23 +0000 (02:00 +0200)]
Make -Wall clean
Wouter Verhelst [Sat, 24 Jul 2010 19:48:24 +0000 (21:48 +0200)]
Add nbd.h to source
Previously, we would depend on an out-of-tree nbd.h. This is error-prone
on Linux (if the kernel nbd.h changes incompatibly, the userspace tools
won't compile anymore) and problematic on non-Linux (where you'd have to
manage somehow to fetch a working nbd.h)
So, stop being silly.
Wouter Verhelst [Sat, 24 Jul 2010 19:47:50 +0000 (21:47 +0200)]
Generate nbd-client.8.in, too
Wouter Verhelst [Sat, 24 Jul 2010 19:47:33 +0000 (21:47 +0200)]
Whitespace fixes
Wouter Verhelst [Sat, 24 Jul 2010 19:18:34 +0000 (21:18 +0200)]
Remove cruft
This was useful when we tried making github our official distribution
point; but we're not doing that anymore, so drop it.
Wouter Verhelst [Sat, 24 Jul 2010 19:07:00 +0000 (21:07 +0200)]
Improve structure
- Use getopt_long_only() to implement option parsing. This probably
makes use of small C libraries harder, but that wasn't very much
possible to begin with, anyway.
- Deprecate bs= and timeout= options in favour of new --block-size and
--timeout options.
- Compartmentalize a bit more. Yes, the compiler will optimize that away
in some cases, but what do I care, I don't need to write assembler
code.
Documentation update to follow.
Wouter Verhelst [Thu, 22 Jul 2010 13:22:47 +0000 (15:22 +0200)]
Fix compile with -DNOFORK
Wouter Verhelst [Wed, 21 Jul 2010 21:18:34 +0000 (23:18 +0200)]
Fix logic reversal in authorization file
Wouter Verhelst [Fri, 18 Jun 2010 06:35:36 +0000 (08:35 +0200)]
Deprecate command line export options.
Wouter Verhelst [Fri, 18 Jun 2010 06:32:33 +0000 (08:32 +0200)]
Whitespace fix
Wouter Verhelst [Mon, 14 Jun 2010 20:48:13 +0000 (22:48 +0200)]
Use correct names
The kernel uses /dev/nbdX rather than /dev/nbX. MAKEDEV used to be
different at some point, but no more.
Wouter Verhelst [Thu, 20 May 2010 13:35:57 +0000 (15:35 +0200)]
Fix bugs in command-line argument handling
We produced an error message when all four flags were used; and we would
only catch such flags if they were produced in the right order (which
was different from the order in the manpage).
Thanks to Fan Zhang for catching these.
Wouter Verhelst [Mon, 3 May 2010 13:57:28 +0000 (15:57 +0200)]
Fix leaks
There were a few strings that weren't being removed. This is
cleanup-code that's not called all that often, but We Shouldn't
Leak(TM).
Wouter Verhelst [Wed, 14 Apr 2010 15:30:52 +0000 (17:30 +0200)]
Improve output
- When using a float to store a result, make sure we don't do integer
calculation.
- Add our PID to the output, so that we can understand which line of
output is part of which nbd-tester-client run.
Wouter Verhelst [Thu, 1 Apr 2010 11:23:30 +0000 (13:23 +0200)]
Missed a bit
Wouter Verhelst [Thu, 1 Apr 2010 11:07:26 +0000 (13:07 +0200)]
Documentation update
Since we now support IPv6, upodate those bits of the documentation that
assume v4 only.
Wouter Verhelst [Wed, 24 Mar 2010 21:01:36 +0000 (22:01 +0100)]
Release 2.9.15
Neutron Soutmun [Wed, 24 Mar 2010 05:25:59 +0000 (12:25 +0700)]
Bug#382189: IPv6 support
Package: nbd
Version: 2.9.14-3
Severity: normal
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The latest patch to master branch of git repository is attached.
Please review the patch again.
It's also solved the #557810.
Add append_serve() more over the last patch to verify the parsing
listening address which now the parsing listening address could
be IPv4/IPv6 and also hostname. The service will resolve the hostname
and try to listening on all of them.
If the hostname/address could not solve, must show the error
getaddrinfo failed on listen host/address: testing (Name or service not known)
If parsing hostname,
It will listen on 127.0.0.1:12345
It will listen on ::1@12345
Regards,
Neutron Soutmun
- -- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=th_TH.UTF-8, LC_CTYPE=th_TH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAkupomIACgkQ1k7Ar9TO/TdLngCgvGp2oGKR0PLGmMFVTUkxh9yO
NrQAnR4FqtwoEuo/aZoEFhdhFI3mOVbU
=1UBe
-----END PGP SIGNATURE-----
Wouter Verhelst [Sat, 27 Feb 2010 21:39:35 +0000 (22:39 +0100)]
Be explicit when we exit
Currently, when a fatal error occurs, nbd-server logs that error, but
then silently exits -- i.e., it is left to the user to guess that it has
exited. We should be more explicit about that fact.
Wouter Verhelst [Sat, 27 Feb 2010 21:29:50 +0000 (22:29 +0100)]
Parse listenaddr for hostnames
Previously, a listen address had to be specified by IP address;
hostnames where not supported. This patch should fix that. It is useful
for those who wish to use something like 'listenaddr = localhost',
though using the IP address is really recommended for most other
situations.
Wouter Verhelst [Tue, 15 Dec 2009 09:37:57 +0000 (10:37 +0100)]
Fix 'make -j check'
Port numbers were the same across all three tests, so that made the
check fail if they were ran at the same time...
Peter Korsgaard [Sun, 22 Nov 2009 22:11:42 +0000 (23:11 +0100)]
lfs.h: fix build with --disable-lfs
Running ./configure with --disable-lfs #define's NBD_LFS to 0 and
doesn't #undef it, so the LFS check should use #if rather than #ifdef
similar to how it is done in cliserv.h
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Wouter Verhelst [Sat, 17 Oct 2009 18:16:13 +0000 (20:16 +0200)]
Prepare for 2.9.14
Wouter Verhelst [Sat, 17 Oct 2009 18:15:40 +0000 (20:15 +0200)]
Make -Wall -Werror compile again
Wouter Verhelst [Fri, 16 Oct 2009 08:52:18 +0000 (10:52 +0200)]
Document why this is necessary.
Wouter Verhelst [Thu, 15 Oct 2009 17:22:19 +0000 (19:22 +0200)]
Put the -nofork check on the right spot
nbd-client will fork in two occasions: once when going daemon, once when
forking itself off to be able to open the device so we can trigger the
kernel to reread its partition table (if any), which in turn will cause
udev to DTRT.
The NOFORK macros were written in to make debugging simpeler, and
predate the daemon() thing. I think. Anyhow, what's useful for code
debugging is not necessarily useful for runtime debugging; so this moves
the daemon() call inside the macros, makes it not be called if -nofork
has been specified, and changes the code so that the partition table
reread is still triggered even if -nofork has been specified.
Wouter Verhelst [Sun, 27 Sep 2009 11:31:02 +0000 (13:31 +0200)]
Missed one
This one, too, needed to be thrown out. Oops.
Wouter Verhelst [Sat, 26 Sep 2009 17:11:07 +0000 (19:11 +0200)]
Remove unsupported options
The no longer supported -a option was still part of the 'getopt' call,
and was still shown in the error output. This patch removes that code.
Wouter Verhelst [Mon, 24 Aug 2009 19:12:21 +0000 (21:12 +0200)]
Make autogen.sh work
Makefile.am expects $(srcdir) to be set -- so set it in the environment
Wouter Verhelst [Wed, 19 Aug 2009 14:09:47 +0000 (16:09 +0200)]
Remove dead code
If someone needs it, they can always pull it from git.
Also, make the mlockall() call conditional on if(swap) again.
Wouter Verhelst [Tue, 18 Aug 2009 16:34:55 +0000 (18:34 +0200)]
Documentation update
Sometimes users get confused over the fact that block devices are files,
too, for the most part. Make it a bit more explicit that exporting block
devices is supported in the documentation.
Wouter Verhelst [Fri, 14 Aug 2009 09:16:33 +0000 (11:16 +0200)]
Fix error output
dousers() previously tried to call g_message directly. Since we're
running as daemon already at this point, g_message won't produce output.
Fix by using err() instead.
Wouter Verhelst [Fri, 14 Aug 2009 08:45:44 +0000 (10:45 +0200)]
Fix message string
Adding the filename as an argument is nice, but the message string needs
it too
Wouter Verhelst [Mon, 10 Aug 2009 08:09:21 +0000 (10:09 +0200)]
Patches from Debian
Wouter Verhelst [Tue, 4 Aug 2009 07:07:49 +0000 (09:07 +0200)]
Rerun autofoo
Wouter Verhelst [Tue, 4 Aug 2009 07:01:21 +0000 (09:01 +0200)]
Make incorrect use of timeout fail.
When nbd-client is compiled on a system that does not support the timeout
ioctl(), we now fail with an error message. Previously, the option would be
silently ignored, which might not be optimal.
Wouter Verhelst [Sat, 18 Jul 2009 13:15:13 +0000 (15:15 +0200)]
Unconfuse
Wouter Verhelst [Fri, 17 Jul 2009 08:58:03 +0000 (10:58 +0200)]
Implement sync option
This allows a user to enable fsync() calls after a write to a backend
file.
Wouter Verhelst [Thu, 9 Jul 2009 08:56:25 +0000 (10:56 +0200)]
Prepare for 2.9.13
Wouter Verhelst [Thu, 9 Jul 2009 08:51:09 +0000 (10:51 +0200)]
Documentation update
People are sometimes confused about the warnings that nbd-server
produces when an invalid or incomplete warning is encountered.
Note in the manpage that these warnings are harmless if a command-line
configuration was specified and no configuration file is desired.
Wouter Verhelst [Mon, 8 Jun 2009 21:15:46 +0000 (23:15 +0200)]
Don't try working on partitions
When a partition is given to the -d or -c command line options, reduce
it to the master device instead.
This assumes udev-style naming of device entries, though.
Wouter Verhelst [Mon, 8 Jun 2009 21:02:29 +0000 (23:02 +0200)]
Fix autodetection
Everything else in nbd-server was already 64bit-clean, but this part,
where the size of a block device is autodected, wasn't.
Replace the ioctl() to BLKGETSIZE with its 64bit version, so that trying
to detect the size of a multi-terabyte block device does not fail.
Wouter Verhelst [Fri, 5 Jun 2009 19:43:54 +0000 (21:43 +0200)]
Avoid unaligned access
nbd-tester-client tried to write to a char array in a packed struct by
casting it to an u64 pointer and dereferencing it. That causes unaligned
access and, hence, a SIGBUS on SPARC.
Fix by using memcpy instead.
Wouter Verhelst [Tue, 26 May 2009 15:45:19 +0000 (17:45 +0200)]
Actually go daemon
just doing chdir("/") leave file descriptors open, which is not ideal.
Doing it this way closes everything, including any system-specific
things we're not aware of.
Wouter Verhelst [Tue, 26 May 2009 15:45:02 +0000 (17:45 +0200)]
Apparently forgot this file -- update that one, too.
Wouter Verhelst [Sun, 24 May 2009 07:22:40 +0000 (09:22 +0200)]
Merge branch 'import'
Wouter Verhelst [Sun, 24 May 2009 07:14:50 +0000 (09:14 +0200)]
Update documentation to reflect new behaviour of -swap option
Wouter Verhelst [Sun, 24 May 2009 07:13:34 +0000 (09:13 +0200)]
Document -noswap option
ciprian [Sun, 10 May 2009 15:43:23 +0000 (23:43 +0800)]
Hacked nbd-client.c to include a flag -nofork, that allows the nbd-client process to not fork and daemonize itself.
Signed-off-by: Wouter Verhelst <w@uter.be>
Tom Cocagne [Sat, 23 May 2009 10:30:36 +0000 (12:30 +0200)]
Fix for nbd-server uner xinetd
nbd-server currently fails under inetd due to GLib error messages being
reported over the data channel. The attached patch moves the configuration
file parsing warning to occur after the inetd special-case check and
redirects all GLib messages to the syslog (if --enable-syslog is used).
Wouter Verhelst [Sat, 23 May 2009 07:45:51 +0000 (09:45 +0200)]
Remove support for timeout option
The timeout option has been broken for a very long time. Additionally,
something like this is better done by making use of TCP keepalive
probes, which nbd-server has implemented since 2003 (unless you're using
it in inetd mode, in which case you should add the keepalive option to
the inetd configuration for the nbd-server).
Milos Jakubicek [Wed, 13 May 2009 22:55:41 +0000 (00:55 +0200)]
more user-friendly error message
Hi folks,
we recently had a bug filed against the nbd Fedora package claiming
about the clarity of the error message which is printed when the nbd
module is not loaded:
https://bugzilla.redhat.com/show_bug.cgi?id=496751
What about merging a tiny patch I attached?
Regards,
Milos
Wouter Verhelst [Thu, 30 Apr 2009 13:06:33 +0000 (15:06 +0200)]
autoconf after version...
Wouter Verhelst [Thu, 30 Apr 2009 13:04:56 +0000 (15:04 +0200)]
version number
Wouter Verhelst [Thu, 30 Apr 2009 12:38:20 +0000 (14:38 +0200)]
rerun autotools
Wouter Verhelst [Thu, 30 Apr 2009 12:37:51 +0000 (14:37 +0200)]
More build fixes
these let 'make distcheck' work again.
Wouter Verhelst [Thu, 30 Apr 2009 12:18:15 +0000 (14:18 +0200)]
Fix build system
* Add lfs.h to the proper _SOURCES entry
* remove winnbd from SUBDIRS, since we don't have that anymore.
Wouter Verhelst [Sat, 31 Jan 2009 02:00:55 +0000 (03:00 +0100)]
use atoll instead of atol
... so that multi-terabyte exports work, too.
Wouter Verhelst [Wed, 7 Jan 2009 12:10:11 +0000 (13:10 +0100)]
Minor fixes
- Gracefully handle when a config file contains a valid [generic] section, but
no export sections
- Free our key file stuff on successful parsing of the config file, too.
Wouter Verhelst [Sat, 3 Jan 2009 05:24:04 +0000 (06:24 +0100)]
Avoid i18n when we don't need it
Manpages aren't translated, so translated dates there are sucky.
Wouter Verhelst [Sat, 3 Jan 2009 05:08:52 +0000 (06:08 +0100)]
Change meaning of -swap option
Change meaning of -swap option: rather than trying to use a kernel patch
which has been effectively dead since sometime around 2.1.something, do
an mlockall() so that the kernel won't throw us out.
The MCL_CURRENT | MCL_FUTURE bit might prove to be problematic, but if
so, we'll deal with it when we get there.
Wouter Verhelst [Thu, 1 Jan 2009 12:44:46 +0000 (13:44 +0100)]
Build system fixes and documentation
Should make compiling on non-Linux operating systems not quite as painful
Wouter Verhelst [Thu, 1 Jan 2009 12:15:55 +0000 (13:15 +0100)]
Prepare for github.com releases
They have this nice feature that allows me to tag a file if I want to
release it. That's all nice and dandy, but it does require that the
version control system contains _everything_ -- including autogenerated
files.
Not entirely happy about that, but well.
Wouter Verhelst [Sat, 27 Dec 2008 00:09:04 +0000 (01:09 +0100)]
Don't track .o files
Don't track .o files
Wouter Verhelst [Wed, 24 Dec 2008 15:04:59 +0000 (16:04 +0100)]
Improve error handling
If a config file does not even contain a single session,
g_key_file_get_start_group() will return NULL, resulting in a segfault
if we feed that to strcmp. Check for that possibility.
This closes Fedora bug #454099, BTW. Merry christmas ;-)
yoe [Fri, 5 Dec 2008 22:43:38 +0000 (22:43 +0000)]
r344: Fixes suggested by Pavel Macheck
yoe [Mon, 13 Oct 2008 16:58:08 +0000 (16:58 +0000)]
r343: Remove this (outdated) code:
- Nobody has looked after it since before I started maintaining nbd
- The zipfile is corrupt
- The 'plain' nbd-server will work under cygwin, and has more features
- If someone wants to fix it, they can still get it from a revision
before this one.
yoe [Mon, 25 Aug 2008 11:58:01 +0000 (11:58 +0000)]
r342: Use right printf() format string
yoe [Tue, 12 Aug 2008 20:22:01 +0000 (20:22 +0000)]
r340: Fix printing of 64bit integers; patch by Brad Allen
yoe [Thu, 24 Jul 2008 11:24:40 +0000 (11:24 +0000)]
r339: Explicitly set the client socket to nonblocking, since some systems
apparently inherit socket flags through accept().
yoe [Wed, 18 Jun 2008 10:46:40 +0000 (10:46 +0000)]
r338: Oops, this is work-in-progress, remove
yoe [Wed, 18 Jun 2008 10:38:22 +0000 (10:38 +0000)]
r337: Check multi-file export in 'make check', too; and tell automake that we have multiple checks rather than having it think there's only one
yoe [Thu, 15 May 2008 19:27:34 +0000 (19:27 +0000)]
r336: Cut out klcc usage. It's broken, silly to even try.
yoe [Sun, 4 May 2008 15:02:18 +0000 (15:02 +0000)]
r335: Allow disabling of klcc
yoe [Thu, 1 May 2008 19:05:35 +0000 (19:05 +0000)]
r334: Re-sync table indexes
yoe [Wed, 2 Apr 2008 13:15:57 +0000 (13:15 +0000)]
r332: open() the device upon connecting after a fork(), so that the partition table will be read
yoe [Mon, 31 Mar 2008 08:18:51 +0000 (08:18 +0000)]
r331: Add code to detect whether a device is connected
yoe [Mon, 17 Mar 2008 10:31:01 +0000 (10:31 +0000)]
r329: Wasn't supposed to be part of this commit
yoe [Mon, 17 Mar 2008 10:28:39 +0000 (10:28 +0000)]
r328: Oops, don't forget to change this number
yoe [Mon, 17 Mar 2008 10:25:43 +0000 (10:25 +0000)]
r327: Remove autoreadonly option. It was an error to make it a config file
option in the first place; the "autoreadonly" flag is set when the
server decides that it cannot write to anything and thus automatically
switches readonly on; setting it from config therefore is silly. Also
remove the documentation of this option.
yoe [Mon, 17 Mar 2008 10:20:01 +0000 (10:20 +0000)]
r326: Don't require read-write access to base file when doing copy on write
yoe [Mon, 17 Mar 2008 09:44:36 +0000 (09:44 +0000)]
r325: Avoid unnecessary wakeups
yoe [Sun, 16 Mar 2008 11:02:26 +0000 (11:02 +0000)]
r324: Fix sdp section
yoe [Fri, 14 Mar 2008 12:43:11 +0000 (12:43 +0000)]
r321: And uClibc, too
yoe [Fri, 14 Mar 2008 12:39:28 +0000 (12:39 +0000)]
r320: Fedora contains nbd, see https://admin.fedoraproject.org/pkgdb/packages/name/nbd
yoe [Fri, 14 Mar 2008 12:30:24 +0000 (12:30 +0000)]
r319: Merge from trunk
yoe [Fri, 14 Mar 2008 12:22:05 +0000 (12:22 +0000)]
r317: Update status of deadlock issue
yoe [Sun, 18 Nov 2007 09:41:48 +0000 (09:41 +0000)]
r311: Document undocumented options
yoe [Wed, 14 Nov 2007 20:57:27 +0000 (20:57 +0000)]
r310: Fix a few typos in the docs
yoe [Wed, 14 Nov 2007 19:19:24 +0000 (19:19 +0000)]
r308: Fix segfault when exporting more than one device.
yoe [Wed, 7 Nov 2007 18:39:50 +0000 (18:39 +0000)]
r307: Sanify name, getting it in sync with documentation, too.
Thanks, Tilman Koschnick
yoe [Sun, 4 Nov 2007 09:01:59 +0000 (09:01 +0000)]
r306: Make sure this compiles on other systems than just Linux
yoe [Tue, 30 Oct 2007 15:14:31 +0000 (15:14 +0000)]
r305: Use constants rather than their value
yoe [Tue, 30 Oct 2007 10:35:12 +0000 (10:35 +0000)]
r304: Documentation fixes: add -C to synopsis (Corey Minyard); update stuff
about multiple-file option to reflect current reality.
yoe [Fri, 26 Oct 2007 20:32:01 +0000 (20:32 +0000)]
r301: Make this compile warning-free, too
yoe [Fri, 26 Oct 2007 20:25:45 +0000 (20:25 +0000)]
r300: Remove all GCC warnings