Commits
logical-partit…
Name already in use
Commits on Jan 22, 2019
-
tests: Duplicate test-partitioning4.sh for MBR.
Since both the partitioning plugin and partition filter now support MBR logical partitions, the original test for GPT (test-partitioning4.sh) can be duplicated and modified to test MBR.
-
tests: Implement a better nbdkit-partition-filter test.
Test the partition filter against real life partition tables created by sfdisk.
-
-
-
partition: Break long line of code.
Simple whitespace-only change, updating commit 188b159.
Commits on Jan 21, 2019
-
partition: Use SECTOR_SIZE instead of hard-coding 512 everywhere.
This probably doesn't make the sector size adjustable, but at least documents where we make this assumption.
-
partition: Move MBR and GPT parsing code to separate files.
Simply code motion, there should be no change to the functionality.
-
partitioning: Use bool in appropriate places.
Trivial code refactoring with no functional change.
Commits on Jan 20, 2019
-
server: Return bool from is_config_key.
This function does not return any error, so it can use bool.
Commits on Jan 18, 2019
-
-
docs: Miscellaneous revisions to nbdkit-loop(1) man page.
All suggested by Eric Blake: - Users may need to ‘modprobe nbd’ to load the kernel module. - Warn about loop mounting untrusted filesystems and suggest libguestfs for this instead.
-
openbsd: Disable ANSI C test on OpenBSD.
The ancient GCC on OpenBSD does not support the -std=c90 option. Change ./configure so it can detect this and disable the test where not available.
-
-
tests: Test that public headers are ANSI (ISO C90) compatible.
In commit 3775916 (and before that in discussions with Eric) we decided that we should try to allow plugins to be compiled with C compilers other than GCC or Clang (or with very old / peculiar / incompatible versions of those compilers). However until we test this we cannot guarantee that changes to the code will not break this in future, hence this test. Note that GCC or Clang is still required to compile nbdkit itself.
-
include: Fix NBDKIT_HANDLE_NOT_NEEDED for C90 compilers.
When an ANSI/C90 plugin compiled with ‘-pedantic’ uses NBDKIT_HANDLE_NOT_NEEDED it gets the error: ISO C forbids conversion of function pointer to object pointer type This is because the existing macro worked by returning a function pointer but in C90 function pointers cannot be cast to data pointers since on some ancient architectures code and data pointers were incompatible. We only need a convenient global data pointer here, and the address of ‘errno’ should be fine.
Commits on Jan 16, 2019
-
build: Don't link everything, only the server, with libselinux.
The server can link to libselinux to support SELinux socket labelling. However because we added the library to $LIBS it got linked into everything, eg: $ eu-readelf -d /usr/lib64/nbdkit/plugins/nbdkit-memory-plugin.so | grep NEEDED NEEDED Shared library: [libselinux.so.1] NEEDED Shared library: [libc.so.6] Libselinux has a pkg-config file so we can use that to detect the library and adjust server/Makefile.am so it is only linked into the server. This dependency is still optional.
Commits on Jan 15, 2019
-
-
server: Include <errno.h> in some files.
Fixes FreeBSD and OpenBSD compilation which was broken by the code refactoring in commit 6193863.
-
server: connections: Use send(2) and recv(2) instead of write and read.
Winsock only lets you use send/recv, and it shouldn't make any difference on Linux either.
-
server: sockets: Refactor accept_incoming_connections.
This is a simple refactoring of the function, allowing us to reimplement the inner loop for Windows in a future commit. Note that I made explicit that fds[nr_socks] is used for the quit_fd entry, previously this was implicit which was somewhat confusing.
-
server: Refactor more parts of main.c into separate files.
This split is simple code motion. However it does allow two things: we can document more clearly the interfaces between the main code and these functions, and it makes it a bit easier to provide alternative implementations for Windows.
Commits on Jan 13, 2019
-
server: Move quit pipe code to a separate file.
No functional change, simply refactoring.
-
-
data: Print correct final size.
This fixes a debugging message which showed the incorrect size variable.
-
server: Use special attribute((format)) for varargs print functions.
Also tidy up an existing declaration so it matches similar decls elsewhere in the header file.
Commits on Jan 12, 2019
-
tests: cxx: Return NBDKIT_HANDLE_NOT_NEEDED from open callback.
In commit 6c4092a we introduced the concept of the open callback returning NBDKIT_HANDLE_NOT_NEEDED for plugins which do not need a handle. The C++ test uses this archetype too, but in a slightly different form so that commit did not modify this test plugin before.
-
sh: Document can_multi_conn callback in the manual.
Fixes commit 627727e which omitted to updated the manual.
Commits on Jan 11, 2019
Commits on Jan 9, 2019
Commits on Jan 7, 2019
Commits on Jan 5, 2019
-
data, memory: Use fine-grained locking and change thread model to par…
…allel. Instead of implicitly locking around every request, use an explicit and (slightly) more fine-grained lock, and change the thread model to parallel. The same change is made to the memory plugin and the data plugin. This improves performance slightly. Using fio with 8 threads and multi-conn enabled with -C 8: Before: read: IOPS=103k, BW=401MiB/s (420MB/s)(46.0GiB/120002msec) write: IOPS=103k, BW=401MiB/s (420MB/s)(46.0GiB/120002msec) After: read: IOPS=112k, BW=437MiB/s (458MB/s)(51.2GiB/120001msec) write: IOPS=112k, BW=437MiB/s (458MB/s)(51.2GiB/120001msec) For comparison: The memory plugin implemented using a simple malloc instead of a sparse array: read: IOPS=133k, BW=518MiB/s (544MB/s)(60.7GiB/120002msec) write: IOPS=133k, BW=518MiB/s (543MB/s)(60.7GiB/120002msec) Directly running fio against /dev/shm: read: IOPS=1018k, BW=3978MiB/s (4171MB/s)(466GiB/120001msec) write: IOPS=1018k, BW=3979MiB/s (4172MB/s)(466GiB/120001msec)
-
data, memory: Return NBD_FLAG_CAN_MULTI_CONN.
These plugins use NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS because of their use of the global sparse array. However since they are both RAM disks, and thus (a) flush is a no-op, and (b) the locked part of each request is short, it is both safe and there is some performance benefit to using NBD_FLAG_CAN_MULTI_CONN. Without multi-conn: read: IOPS=52.8k, BW=206MiB/s (216MB/s)(24.2GiB/120002msec) write: IOPS=52.8k, BW=206MiB/s (216MB/s)(24.2GiB/120002msec) With multi-conn (-C 8): read: IOPS=103k, BW=401MiB/s (420MB/s)(46.0GiB/120002msec) write: IOPS=103k, BW=401MiB/s (420MB/s)(46.0GiB/120002msec)
-
partitioning: Return NBD_FLAG_CAN_MULTI_CONN.
This plugin has a parallel thread model and handles flush correctly across connections, so return NBD_FLAG_CAN_MULTI_CONN.