diff --git a/0001-Skip-vsock-related-checks-if-AF_VSOCK-is-not-support.patch b/0001-Skip-vsock-related-checks-if-AF_VSOCK-is-not-support.patch deleted file mode 100644 index 5a0419f..0000000 --- a/0001-Skip-vsock-related-checks-if-AF_VSOCK-is-not-support.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 5c4dcc9ade4b2d46d69478f711bd98b14b99c3d2 Mon Sep 17 00:00:00 2001 -From: Hilko Bengen -Date: Mon, 25 Oct 2021 23:34:20 +0200 -Subject: [PATCH] Skip vsock-related checks if AF_VSOCK is not supported. - -(cherry picked from commit 068cd85375e9bd309f65ba3971db643e817fe912) ---- - tests/functions.sh.in | 10 ++++++++++ - tests/test-ip-filter-anyvsock.sh | 1 + - tests/test-nbd-vsock.sh | 1 + - tests/test-vsock.sh | 1 + - 4 files changed, 13 insertions(+) - -diff --git a/tests/functions.sh.in b/tests/functions.sh.in -index 403fa56e..d6c4255c 100644 ---- a/tests/functions.sh.in -+++ b/tests/functions.sh.in -@@ -239,6 +239,16 @@ requires_non_root () - fi - } - -+# Tests that use the vsock interface will fail if vsock is not -+# supported. -+requires_vsock_support () -+{ -+ if ! grep -q ^AF_VSOCK /proc/net/protocols; then -+ echo "$0: test skipped because AF_VSOCK is not supported." -+ exit 77 -+ fi -+} -+ - # start_nbdkit -P pidfile args... - # - # Run nbdkit with args and wait for it to start up. If it fails to -diff --git a/tests/test-ip-filter-anyvsock.sh b/tests/test-ip-filter-anyvsock.sh -index 3160e982..016b1da9 100755 ---- a/tests/test-ip-filter-anyvsock.sh -+++ b/tests/test-ip-filter-anyvsock.sh -@@ -47,6 +47,7 @@ requires nbdsh --version - requires nbdsh -c 'print(h.connect_vsock)' - requires_nbdsh_uri - requires_linux_kernel_version 5.6 -+requires_vsock_support - - # Not supported on Windows. - if is_windows; then -diff --git a/tests/test-nbd-vsock.sh b/tests/test-nbd-vsock.sh -index e3736898..f1f839a0 100755 ---- a/tests/test-nbd-vsock.sh -+++ b/tests/test-nbd-vsock.sh -@@ -47,6 +47,7 @@ set -x - requires_nbdsh_uri - requires nbdsh -c 'print(h.connect_vsock)' - requires_linux_kernel_version 5.6 -+requires_vsock_support - - # Because vsock ports are 32 bits, we can basically pick one at random - # and be sure that it's not used. However we must pick one >= 1024 -diff --git a/tests/test-vsock.sh b/tests/test-vsock.sh -index fc39cb7b..0bcfc4ba 100755 ---- a/tests/test-vsock.sh -+++ b/tests/test-vsock.sh -@@ -47,6 +47,7 @@ requires nbdsh --version - requires nbdsh -c 'print(h.connect_vsock)' - requires_nbdsh_uri - requires_linux_kernel_version 5.6 -+requires_vsock_support - - # Because vsock ports are 32 bits, we can basically pick one at random - # and be sure that it's not used. However we must pick one >= 1024 --- -2.31.1 - diff --git a/0009-vddk-Refactor-how-D-vddk.stats-1-is-collected.patch b/0001-vddk-Refactor-how-D-vddk.stats-1-is-collected.patch similarity index 98% rename from 0009-vddk-Refactor-how-D-vddk.stats-1-is-collected.patch rename to 0001-vddk-Refactor-how-D-vddk.stats-1-is-collected.patch index abd8d7d..ba66d22 100644 --- a/0009-vddk-Refactor-how-D-vddk.stats-1-is-collected.patch +++ b/0001-vddk-Refactor-how-D-vddk.stats-1-is-collected.patch @@ -1,4 +1,4 @@ -From ec9c61a3f8950f0a196cd5904eea6f1a2a4c05dc Mon Sep 17 00:00:00 2001 +From 96ee8f6f2844bceb8e27ffb442359a2b7521c950 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 21 Oct 2021 14:49:52 +0100 Subject: [PATCH] vddk: Refactor how -D vddk.stats=1 is collected diff --git a/0010-vddk-Extend-D-vddk.stats-1-to-show-number-of-calls-a.patch b/0002-vddk-Extend-D-vddk.stats-1-to-show-number-of-calls-a.patch similarity index 98% rename from 0010-vddk-Extend-D-vddk.stats-1-to-show-number-of-calls-a.patch rename to 0002-vddk-Extend-D-vddk.stats-1-to-show-number-of-calls-a.patch index 9eb00f0..1823655 100644 --- a/0010-vddk-Extend-D-vddk.stats-1-to-show-number-of-calls-a.patch +++ b/0002-vddk-Extend-D-vddk.stats-1-to-show-number-of-calls-a.patch @@ -1,4 +1,4 @@ -From 4636e9b9c9590b520463b16d9f7dedd7355fa54d Mon Sep 17 00:00:00 2001 +From f388c9b6c983d395ced0d4f467980b182d0a1b84 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 21 Oct 2021 15:10:00 +0100 Subject: [PATCH] vddk: Extend -D vddk.stats=1 to show number of calls and diff --git a/0002-vddk-Update-comment-about-VixDiskLib_PrepareForAcces.patch b/0002-vddk-Update-comment-about-VixDiskLib_PrepareForAcces.patch deleted file mode 100644 index d2f91ee..0000000 --- a/0002-vddk-Update-comment-about-VixDiskLib_PrepareForAcces.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 98da45afe98a59a1dc783968bb3b08008a3d6a68 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 26 Oct 2021 12:55:14 +0100 -Subject: [PATCH] vddk: Update comment about VixDiskLib_PrepareForAccess - -(cherry picked from commit 5875b3d93c8c913aa96ac5d5a605d081d6a21393) ---- - plugins/vddk/vddk.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c -index c6e023eb..ee9853a7 100644 ---- a/plugins/vddk/vddk.c -+++ b/plugins/vddk/vddk.c -@@ -676,10 +676,9 @@ vddk_open (int readonly) - h->params->specType = VIXDISKLIB_SPEC_VMX; - } - -- /* XXX Some documentation suggests we should call -- * VixDiskLib_PrepareForAccess here. It may be required for -- * Advanced Transport modes, but I could not make it work with -- * either ESXi or vCenter servers. -+ /* XXX We should call VixDiskLib_PrepareForAccess here. It disables -+ * live storage migration (Storage VMotion) of the VM while we are -+ * accessing it, and may be required for "Advanced Transport modes". - */ - - VDDK_CALL_START (VixDiskLib_ConnectEx, --- -2.31.1 - diff --git a/0003-vddk-Document-what-I-found-about-VixDiskLib_Flush.patch b/0003-vddk-Document-what-I-found-about-VixDiskLib_Flush.patch deleted file mode 100644 index 2089853..0000000 --- a/0003-vddk-Document-what-I-found-about-VixDiskLib_Flush.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 7d72530453550a613ee311dd0f3bbbbc87165b1c Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 26 Oct 2021 14:30:43 +0100 -Subject: [PATCH] vddk: Document what I found about VixDiskLib_Flush - -(cherry picked from commit b79a59a81255bfd64ba403994bdf3ef4581e6535) ---- - plugins/vddk/vddk.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c -index ee9853a7..f5fa3dfc 100644 ---- a/plugins/vddk/vddk.c -+++ b/plugins/vddk/vddk.c -@@ -906,6 +906,14 @@ vddk_flush (void *handle, uint32_t flags) - struct vddk_handle *h = handle; - VixError err; - -+ /* The documentation for Flush is missing, but the comment in the -+ * header file seems to indicate that it waits for WriteAsync -+ * commands to finish. We don't use WriteAsync, and in any case -+ * there's a new function Wait to wait for those. However I -+ * verified using strace that in fact Flush does call fsync on the -+ * file so it appears to be the correct call to use here. -+ */ -+ - VDDK_CALL_START (VixDiskLib_Flush, "handle") { - err = VixDiskLib_Flush (h->handle); - } VDDK_CALL_END (VixDiskLib_Flush); --- -2.31.1 - diff --git a/0011-vddk-Simplify-and-consolidate-VDDK_CALL_START-END-ma.patch b/0003-vddk-Simplify-and-consolidate-VDDK_CALL_START-END-ma.patch similarity index 99% rename from 0011-vddk-Simplify-and-consolidate-VDDK_CALL_START-END-ma.patch rename to 0003-vddk-Simplify-and-consolidate-VDDK_CALL_START-END-ma.patch index d7f2346..1d51262 100644 --- a/0011-vddk-Simplify-and-consolidate-VDDK_CALL_START-END-ma.patch +++ b/0003-vddk-Simplify-and-consolidate-VDDK_CALL_START-END-ma.patch @@ -1,4 +1,4 @@ -From f746ca775d28ac59a56be705b03fe804766204fa Mon Sep 17 00:00:00 2001 +From cc1c3b4ab57a1662bf87766161167fac40a78c0e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 21 Oct 2021 22:55:17 +0100 Subject: [PATCH] vddk: Simplify and consolidate VDDK_CALL_START/END macros diff --git a/0012-vddk-Document-troubleshooting-performance-problems.patch b/0004-vddk-Document-troubleshooting-performance-problems.patch similarity index 97% rename from 0012-vddk-Document-troubleshooting-performance-problems.patch rename to 0004-vddk-Document-troubleshooting-performance-problems.patch index 639f467..48fe653 100644 --- a/0012-vddk-Document-troubleshooting-performance-problems.patch +++ b/0004-vddk-Document-troubleshooting-performance-problems.patch @@ -1,4 +1,4 @@ -From e5fc041defb7cb0e275ed5949bbf7406af70043c Mon Sep 17 00:00:00 2001 +From 4bd9926c0e506fdb04976d348b1c7614865c8b06 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 22 Oct 2021 18:00:27 +0100 Subject: [PATCH] vddk: Document troubleshooting performance problems diff --git a/0004-vddk-Note-that-we-have-tested-VDDK-7.0.3.patch b/0004-vddk-Note-that-we-have-tested-VDDK-7.0.3.patch deleted file mode 100644 index b3aa3c9..0000000 --- a/0004-vddk-Note-that-we-have-tested-VDDK-7.0.3.patch +++ /dev/null @@ -1,26 +0,0 @@ -From aa9fdf84c9d77f2334501777a3800ac64b494c54 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 26 Oct 2021 19:44:46 +0100 -Subject: [PATCH] vddk: Note that we have tested VDDK 7.0.3 - -(cherry picked from commit 189e9d52a4d6ea1bcb6a9368c954a1a80802262d) ---- - plugins/vddk/nbdkit-vddk-plugin.pod | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/vddk/nbdkit-vddk-plugin.pod b/plugins/vddk/nbdkit-vddk-plugin.pod -index 2363b8fa..078badcc 100644 ---- a/plugins/vddk/nbdkit-vddk-plugin.pod -+++ b/plugins/vddk/nbdkit-vddk-plugin.pod -@@ -480,7 +480,7 @@ For more information see L. - This plugin requires VDDK E 5.5.5, which in turn means that it - is only supported on x64-64 platforms. - --It has been tested with all versions up to 7.0.2 (but should work with -+It has been tested with all versions up to 7.0.3 (but should work with - future versions). - - VDDK E 6.0 should be used if possible. This is the first version --- -2.31.1 - diff --git a/0005-tests-vddk-Cannot-test-real-VDDK-under-valgrind.patch b/0005-tests-vddk-Cannot-test-real-VDDK-under-valgrind.patch deleted file mode 100644 index dcaa536..0000000 --- a/0005-tests-vddk-Cannot-test-real-VDDK-under-valgrind.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 31317e5d7c249ed318398451ab36d81b0eb5095f Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 27 Oct 2021 20:20:31 +0100 -Subject: [PATCH] tests: vddk: Cannot test real VDDK under valgrind - -The LD_LIBRARY_PATH munging done in nbdkit-vddk-plugin is incompatible -with valgrind, so skip it for both of the real VDDK tests. This is -already done in the dummy VDDK tests. - -(cherry picked from commit d501b5266c3239b974b79fd6a74ad046729cd046) ---- - tests/test-vddk-real-dump-plugin.sh | 7 +++++++ - tests/test-vddk-real.sh | 7 +++++++ - 2 files changed, 14 insertions(+) - -diff --git a/tests/test-vddk-real-dump-plugin.sh b/tests/test-vddk-real-dump-plugin.sh -index 1479e416..2cb7724e 100755 ---- a/tests/test-vddk-real-dump-plugin.sh -+++ b/tests/test-vddk-real-dump-plugin.sh -@@ -39,6 +39,13 @@ requires test -d "$vddkdir" - requires test -f "$vddkdir/lib64/libvixDiskLib.so" - requires cut --version - -+# Testing $LD_LIBRARY_PATH stuff breaks valgrind, so skip the rest of -+# this test if valgrinding. -+if [ "x$NBDKIT_VALGRIND" = "x1" ]; then -+ echo "$0: skipped LD_LIBRARY_PATH test when doing valgrind" -+ exit 77 -+fi -+ - # VDDK > 5.1.1 only supports x86_64. - if [ `uname -m` != "x86_64" ]; then - echo "$0: unsupported architecture" -diff --git a/tests/test-vddk-real.sh b/tests/test-vddk-real.sh -index 08f6f8d8..e7007bfa 100755 ---- a/tests/test-vddk-real.sh -+++ b/tests/test-vddk-real.sh -@@ -45,6 +45,13 @@ requires nbdcopy --version - requires nbdinfo --version - requires stat --version - -+# Testing $LD_LIBRARY_PATH stuff breaks valgrind, so skip the rest of -+# this test if valgrinding. -+if [ "x$NBDKIT_VALGRIND" = "x1" ]; then -+ echo "$0: skipped LD_LIBRARY_PATH test when doing valgrind" -+ exit 77 -+fi -+ - # VDDK > 5.1.1 only supports x86_64. - if [ `uname -m` != "x86_64" ]; then - echo "$0: unsupported architecture" --- -2.31.1 - diff --git a/0013-vddk-Include-VDDK-major-library-version-in-dump-plug.patch b/0005-vddk-Include-VDDK-major-library-version-in-dump-plug.patch similarity index 98% rename from 0013-vddk-Include-VDDK-major-library-version-in-dump-plug.patch rename to 0005-vddk-Include-VDDK-major-library-version-in-dump-plug.patch index 9c079cf..373a0a5 100644 --- a/0013-vddk-Include-VDDK-major-library-version-in-dump-plug.patch +++ b/0005-vddk-Include-VDDK-major-library-version-in-dump-plug.patch @@ -1,4 +1,4 @@ -From ab07f475e3bc3980322902aa112c726beada2955 Mon Sep 17 00:00:00 2001 +From eb6ccb03d0ca12ef19e5705cd96f81824910087b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 23 Oct 2021 16:16:39 +0100 Subject: [PATCH] vddk: Include VDDK major library version in --dump-plugin diff --git a/0006-tests-test-vddk-real.sh-Don-t-hide-log-messages-on-f.patch b/0006-tests-test-vddk-real.sh-Don-t-hide-log-messages-on-f.patch deleted file mode 100644 index 9f1e56b..0000000 --- a/0006-tests-test-vddk-real.sh-Don-t-hide-log-messages-on-f.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4b69e586155d10781390a607eb346421187bd72d Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 27 Oct 2021 20:21:24 +0100 -Subject: [PATCH] tests/test-vddk-real.sh: Don't hide log messages on failure - -Use tee here so we always get the log messages in the log file. -Previously if nbdkit returned an error then the log messages were not -printed (since "cat $log" line was not reached). - -(cherry picked from commit efa13d12cd5eb1e15d783a39da5a9e709d157843) ---- - tests/test-vddk-real.sh | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tests/test-vddk-real.sh b/tests/test-vddk-real.sh -index e7007bfa..a6aceac9 100755 ---- a/tests/test-vddk-real.sh -+++ b/tests/test-vddk-real.sh -@@ -80,11 +80,11 @@ qemu-img create -f vmdk $vmdk 10M - # Check first that the VDDK library can be fully loaded. We have to - # check the log file for missing modules since they may not show up as - # errors. --nbdkit -fv -U - vddk libdir="$vddkdir" $vmdk --run 'nbdinfo "$uri"' >$log 2>&1 -+nbdkit -fv -U - vddk libdir="$vddkdir" $vmdk --run 'nbdinfo "$uri"' 2>&1 | -+ tee $log - - # Check the log for missing modules --cat $log --if grep 'cannot open shared object file' test-vddk-real.log; then -+if grep 'cannot open shared object file' $log; then - exit 1 - fi - --- -2.31.1 - diff --git a/0014-vddk-Add-logical-and-physical-sector-size-to-D-vddk..patch b/0006-vddk-Add-logical-and-physical-sector-size-to-D-vddk..patch similarity index 96% rename from 0014-vddk-Add-logical-and-physical-sector-size-to-D-vddk..patch rename to 0006-vddk-Add-logical-and-physical-sector-size-to-D-vddk..patch index 88c77d7..0709f63 100644 --- a/0014-vddk-Add-logical-and-physical-sector-size-to-D-vddk..patch +++ b/0006-vddk-Add-logical-and-physical-sector-size-to-D-vddk..patch @@ -1,4 +1,4 @@ -From 3288201c18294bd526f646acded4b2b8333a0a82 Mon Sep 17 00:00:00 2001 +From 0139f1815e9259fa789d84d2f32d30ee59bd728c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 23 Oct 2021 16:24:27 +0100 Subject: [PATCH] vddk: Add logical and physical sector size to -D diff --git a/0015-vddk-Fix-typo-in-debug-message.patch b/0007-vddk-Fix-typo-in-debug-message.patch similarity index 93% rename from 0015-vddk-Fix-typo-in-debug-message.patch rename to 0007-vddk-Fix-typo-in-debug-message.patch index 942d9ef..734ba2e 100644 --- a/0015-vddk-Fix-typo-in-debug-message.patch +++ b/0007-vddk-Fix-typo-in-debug-message.patch @@ -1,4 +1,4 @@ -From 39a97a678ec1a900681c93743f37b930ea002cc9 Mon Sep 17 00:00:00 2001 +From a5f73cbcbb6891d2e3c2cb541d47b44a236785ce Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 23 Oct 2021 19:41:07 +0100 Subject: [PATCH] vddk: Fix typo in debug message diff --git a/0007-vddk-Small-copyedits-to-README.VDDK.patch b/0007-vddk-Small-copyedits-to-README.VDDK.patch deleted file mode 100644 index e13e128..0000000 --- a/0007-vddk-Small-copyedits-to-README.VDDK.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0923b0e70735139e1a548addecf6e20c567a96a0 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 30 Oct 2021 08:25:03 +0100 -Subject: [PATCH] vddk: Small copyedits to README.VDDK - -Clean up the sentence about LD_LIBRARY_PATH which could be -misconstrued to mean that we recommend setting this (we do not). - -Remove "bugs" section which was wrong. - -(cherry picked from commit 55c2a029692fc20bf4a7d4ae857e3609b45ec3dd) ---- - plugins/vddk/README.VDDK | 17 +++-------------- - 1 file changed, 3 insertions(+), 14 deletions(-) - -diff --git a/plugins/vddk/README.VDDK b/plugins/vddk/README.VDDK -index f2204d75..c38eaa51 100644 ---- a/plugins/vddk/README.VDDK -+++ b/plugins/vddk/README.VDDK -@@ -14,21 +14,10 @@ export VMDK files and VMware disks over NBD. - You do NOT require VDDK to compile the plugin, and the plugin does not - contain any VMware code. You only need VDDK at runtime. The plugin - uses dlopen to load the library from a directory determined by the --configuration parameter libdir (LD_LIBRARY_PATH or the standard shared --library locations can also be used, although that approach is not --recommended). -+configuration parameter libdir. It is NOT recommended to put VDDK in -+your regular library path (eg /usr/lib) because it contains components -+that conflict with system libraries. - - After building nbdkit-vddk-plugin.so, read the man page to find out - how to use it (nbdkit-vddk-plugin(1)). You'll probably also want to - read the VDDK developer documentation. -- --Bugs ------ -- --Write calls sometimes return VIX_E_DISK_OUTOFRANGE even for write --requests which are well inside the disk. -- --The way we do threading in nbdkit is not congruent with the way you're --supposed to call VDDK from multithreaded programs. For more --information see: --https://www.redhat.com/archives/libguestfs/2019-October/msg00062.html --- -2.31.1 - diff --git a/0008-vddk-Fix-man-page-section-in-help-output.patch b/0008-vddk-Fix-man-page-section-in-help-output.patch deleted file mode 100644 index 4b1c05d..0000000 --- a/0008-vddk-Fix-man-page-section-in-help-output.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 6a1d99df5750e0da071f7a246b2adea5ee297dd1 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 30 Oct 2021 08:35:05 +0100 -Subject: [PATCH] vddk: Fix man page section in --help output - -$ nbdkit vddk --help -... -Many optional parameters are supported, see nbdkit-vddk-plugin(3). - ^^^^^^^^^^ - -(cherry picked from commit 10c43ad240ec219e7af3d680599dd8c7ef841bba) ---- - plugins/vddk/vddk.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c -index f5fa3dfc..80f5870e 100644 ---- a/plugins/vddk/vddk.c -+++ b/plugins/vddk/vddk.c -@@ -513,7 +513,7 @@ vddk_config_complete (void) - - #define vddk_config_help \ - "[file=] (required) The filename (eg. VMDK file) to serve.\n" \ -- "Many optional parameters are supported, see nbdkit-vddk-plugin(3)." -+ "Many optional parameters are supported, see nbdkit-vddk-plugin(1)." - - static int - vddk_get_ready (void) --- -2.31.1 - diff --git a/0016-vddk-Only-print-vddk_library_version-when-we-managed.patch b/0008-vddk-Only-print-vddk_library_version-when-we-managed.patch similarity index 96% rename from 0016-vddk-Only-print-vddk_library_version-when-we-managed.patch rename to 0008-vddk-Only-print-vddk_library_version-when-we-managed.patch index 279a56c..0e9dd8f 100644 --- a/0016-vddk-Only-print-vddk_library_version-when-we-managed.patch +++ b/0008-vddk-Only-print-vddk_library_version-when-we-managed.patch @@ -1,4 +1,4 @@ -From 99d0b4cc090efe3af47b14fdb089929af1ed09bf Mon Sep 17 00:00:00 2001 +From 1cb810a416e1bdd78a8e5df886a3185d3cfa54d0 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 23 Oct 2021 19:50:52 +0100 Subject: [PATCH] vddk: Only print vddk_library_version when we managed to load diff --git a/0017-vddk-Print-one-line-in-dump-plugin-output-for-each-V.patch b/0009-vddk-Print-one-line-in-dump-plugin-output-for-each-V.patch similarity index 97% rename from 0017-vddk-Print-one-line-in-dump-plugin-output-for-each-V.patch rename to 0009-vddk-Print-one-line-in-dump-plugin-output-for-each-V.patch index 62c3b5a..786076d 100644 --- a/0017-vddk-Print-one-line-in-dump-plugin-output-for-each-V.patch +++ b/0009-vddk-Print-one-line-in-dump-plugin-output-for-each-V.patch @@ -1,4 +1,4 @@ -From 157ccfc0445eaa8cae99555d8ad31ba3cdf8c4bf Mon Sep 17 00:00:00 2001 +From 8780009ec092d9cc5a408b7597d88aa54db13639 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 25 Oct 2021 08:36:53 +0100 Subject: [PATCH] vddk: Print one line in --dump-plugin output for each VDDK diff --git a/0018-vddk-Move-minimum-version-to-VDDK-6.5.patch b/0010-vddk-Move-minimum-version-to-VDDK-6.5.patch similarity index 98% rename from 0018-vddk-Move-minimum-version-to-VDDK-6.5.patch rename to 0010-vddk-Move-minimum-version-to-VDDK-6.5.patch index 9a5302b..913ddfc 100644 --- a/0018-vddk-Move-minimum-version-to-VDDK-6.5.patch +++ b/0010-vddk-Move-minimum-version-to-VDDK-6.5.patch @@ -1,4 +1,4 @@ -From cf4a8fe83b9f232a16631c157edb1b560ee893a1 Mon Sep 17 00:00:00 2001 +From e34016cbba4340b25f9a52c98db918aa72b38a7c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 26 Oct 2021 19:46:32 +0100 Subject: [PATCH] vddk: Move minimum version to VDDK 6.5 diff --git a/0019-vddk-Add-read-write-and-wait-asynchronous-functions.patch b/0011-vddk-Add-read-write-and-wait-asynchronous-functions.patch similarity index 97% rename from 0019-vddk-Add-read-write-and-wait-asynchronous-functions.patch rename to 0011-vddk-Add-read-write-and-wait-asynchronous-functions.patch index 1e3f894..c836f82 100644 --- a/0019-vddk-Add-read-write-and-wait-asynchronous-functions.patch +++ b/0011-vddk-Add-read-write-and-wait-asynchronous-functions.patch @@ -1,4 +1,4 @@ -From 96d09a3a3d5306891300eb4b07af7bb605d4515c Mon Sep 17 00:00:00 2001 +From 69b989b37c8e33f52d928c7202146e9e11a2a93c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 27 Oct 2021 11:57:35 +0100 Subject: [PATCH] vddk: Add read, write and wait asynchronous functions diff --git a/0020-vddk-Start-to-split-VDDK-over-several-files.patch b/0012-vddk-Start-to-split-VDDK-over-several-files.patch similarity index 99% rename from 0020-vddk-Start-to-split-VDDK-over-several-files.patch rename to 0012-vddk-Start-to-split-VDDK-over-several-files.patch index f295d18..0e49adf 100644 --- a/0020-vddk-Start-to-split-VDDK-over-several-files.patch +++ b/0012-vddk-Start-to-split-VDDK-over-several-files.patch @@ -1,4 +1,4 @@ -From 11b89043e0f1875b3ce912fe85d79fe61f3e6386 Mon Sep 17 00:00:00 2001 +From 98a499c0e9d08f208474759012ec3ed823ce2335 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 27 Oct 2021 12:20:31 +0100 Subject: [PATCH] vddk: Start to split VDDK over several files diff --git a/0021-vddk-Refactor-D-vddk.stats-1-into-a-new-file.patch b/0013-vddk-Refactor-D-vddk.stats-1-into-a-new-file.patch similarity index 99% rename from 0021-vddk-Refactor-D-vddk.stats-1-into-a-new-file.patch rename to 0013-vddk-Refactor-D-vddk.stats-1-into-a-new-file.patch index 074ec8a..5dc720a 100644 --- a/0021-vddk-Refactor-D-vddk.stats-1-into-a-new-file.patch +++ b/0013-vddk-Refactor-D-vddk.stats-1-into-a-new-file.patch @@ -1,4 +1,4 @@ -From 10a6d7b4a1552862d6a68dd4a0d8a55f6938c8b5 Mon Sep 17 00:00:00 2001 +From d602150dbb5ebacea42c25a0f6c8c26c45766a49 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 27 Oct 2021 12:30:41 +0100 Subject: [PATCH] vddk: Refactor -D vddk.stats=1 into a new file diff --git a/0022-vddk-Implement-parallel-thread-model.patch b/0014-vddk-Implement-parallel-thread-model.patch similarity index 99% rename from 0022-vddk-Implement-parallel-thread-model.patch rename to 0014-vddk-Implement-parallel-thread-model.patch index 41a4dcf..4b12382 100644 --- a/0022-vddk-Implement-parallel-thread-model.patch +++ b/0014-vddk-Implement-parallel-thread-model.patch @@ -1,4 +1,4 @@ -From bec712790d982f4e33a2e68157eef47372435f38 Mon Sep 17 00:00:00 2001 +From 5744b0000addaa0d50b6e0ee8e4540349623be0a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 27 Oct 2021 10:17:22 +0100 Subject: [PATCH] vddk: Implement parallel thread model diff --git a/0023-vddk-Assume-that-VixDiskLib_Flush-is-available.patch b/0015-vddk-Assume-that-VixDiskLib_Flush-is-available.patch similarity index 96% rename from 0023-vddk-Assume-that-VixDiskLib_Flush-is-available.patch rename to 0015-vddk-Assume-that-VixDiskLib_Flush-is-available.patch index 744df6a..5735b1d 100644 --- a/0023-vddk-Assume-that-VixDiskLib_Flush-is-available.patch +++ b/0015-vddk-Assume-that-VixDiskLib_Flush-is-available.patch @@ -1,4 +1,4 @@ -From 1baf75aa963bf3193ba62f9c8865cd0feeca1c82 Mon Sep 17 00:00:00 2001 +From eda9dd7f5e610fd4e17019813c5a045f0b3603df Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 29 Oct 2021 20:56:55 +0100 Subject: [PATCH] vddk: Assume that VixDiskLib_Flush is available diff --git a/0024-vddk-Simplify-detection-of-VDDK-symbols-and-baseline.patch b/0016-vddk-Simplify-detection-of-VDDK-symbols-and-baseline.patch similarity index 99% rename from 0024-vddk-Simplify-detection-of-VDDK-symbols-and-baseline.patch rename to 0016-vddk-Simplify-detection-of-VDDK-symbols-and-baseline.patch index 534ae8c..85b8528 100644 --- a/0024-vddk-Simplify-detection-of-VDDK-symbols-and-baseline.patch +++ b/0016-vddk-Simplify-detection-of-VDDK-symbols-and-baseline.patch @@ -1,4 +1,4 @@ -From 85f208d1641be515c21f8a3cded609cb1e5f8765 Mon Sep 17 00:00:00 2001 +From 1b2b386c9a254808a25fbfce3640c96bdb8cf9be Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 29 Oct 2021 21:02:54 +0100 Subject: [PATCH] vddk: Simplify detection of VDDK symbols and baseline 6.5 diff --git a/0025-vddk-Remove-some-whitespace-from-a-couple-of-functio.patch b/0017-vddk-Remove-some-whitespace-from-a-couple-of-functio.patch similarity index 94% rename from 0025-vddk-Remove-some-whitespace-from-a-couple-of-functio.patch rename to 0017-vddk-Remove-some-whitespace-from-a-couple-of-functio.patch index e4caae8..d62f431 100644 --- a/0025-vddk-Remove-some-whitespace-from-a-couple-of-functio.patch +++ b/0017-vddk-Remove-some-whitespace-from-a-couple-of-functio.patch @@ -1,4 +1,4 @@ -From be040472beb5a4d2aeac088ec8c9c4e654c37b0f Mon Sep 17 00:00:00 2001 +From 2363e76ab34a2e11b57970d82161f73453a4a8ec Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 30 Oct 2021 08:34:28 +0100 Subject: [PATCH] vddk: Remove some whitespace from a couple of functions diff --git a/0026-vddk-Move-config-debug-error-and-utility-functions-a.patch b/0018-vddk-Move-config-debug-error-and-utility-functions-a.patch similarity index 99% rename from 0026-vddk-Move-config-debug-error-and-utility-functions-a.patch rename to 0018-vddk-Move-config-debug-error-and-utility-functions-a.patch index b4d6efc..fbfa113 100644 --- a/0026-vddk-Move-config-debug-error-and-utility-functions-a.patch +++ b/0018-vddk-Move-config-debug-error-and-utility-functions-a.patch @@ -1,4 +1,4 @@ -From 71d2609243de560f1e49e6e5d3ad1f638e198108 Mon Sep 17 00:00:00 2001 +From 6c0034cf8802d466b170135fec0d6a97d1eb2f2a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 30 Oct 2021 08:27:39 +0100 Subject: [PATCH] vddk: Move config, debug/error and utility functions around diff --git a/0019-common-utils-test-vector.c-Add-vector-benchmarks.patch b/0019-common-utils-test-vector.c-Add-vector-benchmarks.patch new file mode 100644 index 0000000..02c96c2 --- /dev/null +++ b/0019-common-utils-test-vector.c-Add-vector-benchmarks.patch @@ -0,0 +1,245 @@ +From 6459704cc66f5fa0a2e6fc1e199458b77327fe52 Mon Sep 17 00:00:00 2001 +From: Nir Soffer +Date: Fri, 5 Nov 2021 20:36:42 +0200 +Subject: [PATCH] common/utils/test-vector.c: Add vector benchmarks + +The generic vector reallocs on every append. Add benchmarks to measure +the cost with uint32 vector (used for copying extents) and the effect of +reserving space upfront. + +The tests show that realloc is pretty efficient, but calling reserve +before the appends speeds the appends up significantly. + + NBDKIT_BENCH=1 ./test-vector + bench_reserve: 1000000 appends in 0.004503 s + bench_append: 1000000 appends in 0.014986 s + +The new benchmarks do not run by default to avoid trouble in CI on +overloaded machines or under qemu emulation. + +A new target added to run all benchmaks: + + make bench + +Ported from libnbd: +- commit dc9ae0174ab1384081a57a8d54b10f8147ea6430 +- commit f6c06a3b4d87fe976a96ea04f8da1f22b2531dbd + +(cherry picked from commit a227af7921c9a51c4f1ab699a3b9f06a9a645126) +--- + Makefile.am | 5 +++ + README | 7 ++++ + common/utils/Makefile.am | 5 ++- + common/utils/bench.h | 72 ++++++++++++++++++++++++++++++++++++++ + common/utils/test-vector.c | 55 +++++++++++++++++++++++++++-- + 5 files changed, 141 insertions(+), 3 deletions(-) + create mode 100644 common/utils/bench.h + +diff --git a/Makefile.am b/Makefile.am +index b21d69ed..49f5d91c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -102,6 +102,11 @@ check-root: + check-vddk: + $(MAKE) -C tests check-vddk + ++bench: all ++ @for d in common/utils; do \ ++ $(MAKE) -C $$d bench || exit 1; \ ++ done ++ + #---------------------------------------------------------------------- + # Maintainers only! + +diff --git a/README b/README +index a04325be..b001620c 100644 +--- a/README ++++ b/README +@@ -274,6 +274,13 @@ nbdkit-vddk-plugin against the library like this: + + make check-vddk vddkdir=vmware-vix-disklib-distrib + ++Running the benchmarks ++---------------------- ++ ++To run benchmarks: ++ ++ make bench ++ + DOWNLOAD TARBALLS + ================= + +diff --git a/common/utils/Makefile.am b/common/utils/Makefile.am +index 14e9dfc4..55415535 100644 +--- a/common/utils/Makefile.am ++++ b/common/utils/Makefile.am +@@ -100,6 +100,9 @@ test_quotes_SOURCES = test-quotes.c quote.c utils.h + test_quotes_CPPFLAGS = -I$(srcdir) + test_quotes_CFLAGS = $(WARNINGS_CFLAGS) + +-test_vector_SOURCES = test-vector.c vector.c vector.h ++test_vector_SOURCES = test-vector.c vector.c vector.h bench.h + test_vector_CPPFLAGS = -I$(srcdir) + test_vector_CFLAGS = $(WARNINGS_CFLAGS) ++ ++bench: test-vector ++ NBDKIT_BENCH=1 ./test-vector +diff --git a/common/utils/bench.h b/common/utils/bench.h +new file mode 100644 +index 00000000..496a3614 +--- /dev/null ++++ b/common/utils/bench.h +@@ -0,0 +1,72 @@ ++/* libnbd ++ * Copyright (C) 2021 Red Hat Inc. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions are ++ * met: ++ * ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * ++ * * Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * * Neither the name of Red Hat nor the names of its contributors may be ++ * used to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ++ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ++ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ++ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ++ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ++ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#ifndef LIBNBD_BENCH_H ++#define LIBNBD_BENCH_H ++ ++#include ++ ++#define MICROSECONDS 1000000 ++ ++struct bench { ++ struct timeval start, stop; ++}; ++ ++static inline void ++bench_start(struct bench *b) ++{ ++ gettimeofday (&b->start, NULL); ++} ++ ++static inline void ++bench_stop(struct bench *b) ++{ ++ gettimeofday (&b->stop, NULL); ++} ++ ++static inline double ++bench_sec(struct bench *b) ++{ ++ struct timeval dt; ++ ++ dt.tv_sec = b->stop.tv_sec - b->start.tv_sec; ++ dt.tv_usec = b->stop.tv_usec - b->start.tv_usec; ++ ++ if (dt.tv_usec < 0) { ++ dt.tv_sec -= 1; ++ dt.tv_usec += MICROSECONDS; ++ } ++ ++ return ((double)dt.tv_sec * MICROSECONDS + dt.tv_usec) / MICROSECONDS; ++} ++ ++#endif /* LIBNBD_BENCH_H */ +diff --git a/common/utils/test-vector.c b/common/utils/test-vector.c +index 94b2aeb7..28af59b8 100644 +--- a/common/utils/test-vector.c ++++ b/common/utils/test-vector.c +@@ -38,9 +38,13 @@ + #undef NDEBUG /* Keep test strong even for nbdkit built without assertions */ + #include + ++#include "bench.h" + #include "vector.h" + ++#define APPENDS 1000000 ++ + DEFINE_VECTOR_TYPE(int64_vector, int64_t); ++DEFINE_VECTOR_TYPE(uint32_vector, uint32_t); + DEFINE_VECTOR_TYPE(string_vector, char *); + + static int +@@ -113,10 +117,57 @@ test_string_vector (void) + free (v.ptr); + } + ++static void ++bench_reserve (void) ++{ ++ uint32_vector v = empty_vector; ++ struct bench b; ++ ++ bench_start(&b); ++ ++ uint32_vector_reserve(&v, APPENDS); ++ ++ for (uint32_t i = 0; i < APPENDS; i++) { ++ uint32_vector_append (&v, i); ++ } ++ ++ bench_stop(&b); ++ ++ assert (v.ptr[APPENDS - 1] == APPENDS - 1); ++ free (v.ptr); ++ ++ printf ("bench_reserve: %d appends in %.6f s\n", APPENDS, bench_sec (&b)); ++} ++ ++static void ++bench_append (void) ++{ ++ uint32_vector v = empty_vector; ++ struct bench b; ++ ++ bench_start(&b); ++ ++ for (uint32_t i = 0; i < APPENDS; i++) { ++ uint32_vector_append (&v, i); ++ } ++ ++ bench_stop(&b); ++ ++ assert (v.ptr[APPENDS - 1] == APPENDS - 1); ++ free (v.ptr); ++ ++ printf ("bench_append: %d appends in %.6f s\n", APPENDS, bench_sec (&b)); ++} ++ + int + main (int argc, char *argv[]) + { +- test_int64_vector (); +- test_string_vector (); ++ if (getenv("NBDKIT_BENCH")) { ++ bench_reserve (); ++ bench_append (); ++ } else { ++ test_int64_vector (); ++ test_string_vector (); ++ } + return 0; + } +-- +2.31.1 + diff --git a/0020-common-urils-vector.c-Optimize-vector-append.patch b/0020-common-urils-vector.c-Optimize-vector-append.patch new file mode 100644 index 0000000..99da6d7 --- /dev/null +++ b/0020-common-urils-vector.c-Optimize-vector-append.patch @@ -0,0 +1,54 @@ +From 5454ced7c8cfc2ba278c2635eecb9a5e4841e613 Mon Sep 17 00:00:00 2001 +From: Nir Soffer +Date: Fri, 5 Nov 2021 22:16:26 +0200 +Subject: [PATCH] common/urils/vector.c: Optimize vector append + +Minimize reallocs by growing the backing array by factor of 1.5. + +Testing show that now append() is fast without calling reserve() +upfront, simplifying code using vector. + + NBDKIT_BENCH=1 ./test-vector + bench_reserve: 1000000 appends in 0.004496 s + bench_append: 1000000 appends in 0.004180 s + +This can make a difference in code appending millions of items. + +Ported from libnbd commit 985dfa72ae2e41901f0af21e7205ef85428cd4bd. + +(cherry picked from commit 12356fa97a840de19bb61e0abedd6e7c7e578e5a) +--- + common/utils/vector.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/common/utils/vector.c b/common/utils/vector.c +index 00cd2546..7df17e1b 100644 +--- a/common/utils/vector.c ++++ b/common/utils/vector.c +@@ -41,11 +41,21 @@ int + generic_vector_reserve (struct generic_vector *v, size_t n, size_t itemsize) + { + void *newptr; ++ size_t reqalloc, newalloc; + +- newptr = realloc (v->ptr, (n + v->alloc) * itemsize); ++ reqalloc = v->alloc + n; ++ if (reqalloc < v->alloc) ++ return -1; /* overflow */ ++ ++ newalloc = (v->alloc * 3 + 1) / 2; ++ ++ if (newalloc < reqalloc) ++ newalloc = reqalloc; ++ ++ newptr = realloc (v->ptr, newalloc * itemsize); + if (newptr == NULL) + return -1; + v->ptr = newptr; +- v->alloc += n; ++ v->alloc = newalloc; + return 0; + } +-- +2.31.1 + diff --git a/0021-common-utils-vector-Rename-alloc-to-cap.patch b/0021-common-utils-vector-Rename-alloc-to-cap.patch new file mode 100644 index 0000000..0cf18b9 --- /dev/null +++ b/0021-common-utils-vector-Rename-alloc-to-cap.patch @@ -0,0 +1,188 @@ +From 304f180b61fa28421b9901d2173a280e633b55c2 Mon Sep 17 00:00:00 2001 +From: Nir Soffer +Date: Fri, 5 Nov 2021 22:59:38 +0200 +Subject: [PATCH] common/utils/vector: Rename `alloc` to `cap` + +The `alloc` field is the maximum number of items you can append to a +vector before it need to be resized. This may confuse users with the +size of the `ptr` array which is `alloc * itemsize`. Rename to "cap", +common term for this property in many languages (e.g C++, Rust, Go). + +Tested with "make check". Tests requiring root or external libraries +(vddk) not tested. + +Ported from libnbd commit e3c7f02a2a844295564c832108d36c939c4e4ecf. + +(cherry picked from commit 75a44237c4463524dbf7951bb62b59c373c85865) +--- + common/allocators/malloc.c | 24 ++++++++++++------------ + common/utils/vector.c | 16 ++++++++-------- + common/utils/vector.h | 12 ++++++------ + plugins/vddk/reexec.c | 2 +- + 4 files changed, 27 insertions(+), 27 deletions(-) + +diff --git a/common/allocators/malloc.c b/common/allocators/malloc.c +index 59409c24..f7474465 100644 +--- a/common/allocators/malloc.c ++++ b/common/allocators/malloc.c +@@ -88,16 +88,16 @@ extend (struct m_alloc *ma, uint64_t new_size) + ACQUIRE_WRLOCK_FOR_CURRENT_SCOPE (&ma->lock); + size_t old_size, n; + +- if (ma->ba.alloc < new_size) { +- old_size = ma->ba.alloc; +- n = new_size - ma->ba.alloc; ++ if (ma->ba.cap < new_size) { ++ old_size = ma->ba.cap; ++ n = new_size - ma->ba.cap; + + #ifdef HAVE_MUNLOCK + /* Since the memory might be moved by realloc, we must unlock the + * original array. + */ + if (ma->use_mlock) +- munlock (ma->ba.ptr, ma->ba.alloc); ++ munlock (ma->ba.ptr, ma->ba.cap); + #endif + + if (bytearray_reserve (&ma->ba, n) == -1) { +@@ -110,7 +110,7 @@ extend (struct m_alloc *ma, uint64_t new_size) + + #ifdef HAVE_MLOCK + if (ma->use_mlock) { +- if (mlock (ma->ba.ptr, ma->ba.alloc) == -1) { ++ if (mlock (ma->ba.ptr, ma->ba.cap) == -1) { + nbdkit_error ("allocator=malloc: mlock: %m"); + return -1; + } +@@ -138,11 +138,11 @@ m_alloc_read (struct allocator *a, void *buf, + /* Avoid reading beyond the end of the allocated array. Return + * zeroes for that part. + */ +- if (offset >= ma->ba.alloc) ++ if (offset >= ma->ba.cap) + memset (buf, 0, count); +- else if (offset + count > ma->ba.alloc) { +- memcpy (buf, ma->ba.ptr + offset, ma->ba.alloc - offset); +- memset (buf + ma->ba.alloc - offset, 0, offset + count - ma->ba.alloc); ++ else if (offset + count > ma->ba.cap) { ++ memcpy (buf, ma->ba.ptr + offset, ma->ba.cap - offset); ++ memset (buf + ma->ba.cap - offset, 0, offset + count - ma->ba.cap); + } + else + memcpy (buf, ma->ba.ptr + offset, count); +@@ -191,9 +191,9 @@ m_alloc_zero (struct allocator *a, uint64_t count, uint64_t offset) + /* Try to avoid extending the array, since the unallocated part + * always reads as zero. + */ +- if (offset < ma->ba.alloc) { +- if (offset + count > ma->ba.alloc) +- memset (ma->ba.ptr + offset, 0, ma->ba.alloc - offset); ++ if (offset < ma->ba.cap) { ++ if (offset + count > ma->ba.cap) ++ memset (ma->ba.ptr + offset, 0, ma->ba.cap - offset); + else + memset (ma->ba.ptr + offset, 0, count); + } +diff --git a/common/utils/vector.c b/common/utils/vector.c +index 7df17e1b..a4b43ce7 100644 +--- a/common/utils/vector.c ++++ b/common/utils/vector.c +@@ -41,21 +41,21 @@ int + generic_vector_reserve (struct generic_vector *v, size_t n, size_t itemsize) + { + void *newptr; +- size_t reqalloc, newalloc; ++ size_t reqcap, newcap; + +- reqalloc = v->alloc + n; +- if (reqalloc < v->alloc) ++ reqcap = v->cap + n; ++ if (reqcap < v->cap) + return -1; /* overflow */ + +- newalloc = (v->alloc * 3 + 1) / 2; ++ newcap = (v->cap * 3 + 1) / 2; + +- if (newalloc < reqalloc) +- newalloc = reqalloc; ++ if (newcap < reqcap) ++ newcap = reqcap; + +- newptr = realloc (v->ptr, newalloc * itemsize); ++ newptr = realloc (v->ptr, newcap * itemsize); + if (newptr == NULL) + return -1; + v->ptr = newptr; +- v->alloc = newalloc; ++ v->cap = newcap; + return 0; + } +diff --git a/common/utils/vector.h b/common/utils/vector.h +index f6a0af78..782dcba6 100644 +--- a/common/utils/vector.h ++++ b/common/utils/vector.h +@@ -86,7 +86,7 @@ + struct name { \ + type *ptr; /* Pointer to array of items. */ \ + size_t size; /* Number of valid items in the array. */ \ +- size_t alloc; /* Number of items allocated. */ \ ++ size_t cap; /* Maximum number of items. */ \ + }; \ + typedef struct name name; \ + \ +@@ -106,7 +106,7 @@ + name##_insert (name *v, type elem, size_t i) \ + { \ + assert (i <= v->size); \ +- if (v->size >= v->alloc) { \ ++ if (v->size >= v->cap) { \ + if (name##_reserve (v, 1) == -1) return -1; \ + } \ + memmove (&v->ptr[i+1], &v->ptr[i], (v->size-i) * sizeof (elem)); \ +@@ -137,7 +137,7 @@ + { \ + free (v->ptr); \ + v->ptr = NULL; \ +- v->size = v->alloc = 0; \ ++ v->size = v->cap = 0; \ + } \ + \ + /* Iterate over the vector, calling f() on each element. */ \ +@@ -181,17 +181,17 @@ + if (newptr == NULL) return -1; \ + memcpy (newptr, vptr, len); \ + copy->ptr = newptr; \ +- copy->size = copy->alloc = v->size; \ ++ copy->size = copy->cap = v->size; \ + return 0; \ + } \ + \ + +-#define empty_vector { .ptr = NULL, .size = 0, .alloc = 0 } ++#define empty_vector { .ptr = NULL, .size = 0, .cap = 0 } + + struct generic_vector { + void *ptr; + size_t size; +- size_t alloc; ++ size_t cap; + }; + + extern int generic_vector_reserve (struct generic_vector *v, +diff --git a/plugins/vddk/reexec.c b/plugins/vddk/reexec.c +index 46acdb62..9e87025e 100644 +--- a/plugins/vddk/reexec.c ++++ b/plugins/vddk/reexec.c +@@ -116,7 +116,7 @@ perform_reexec (const char *env, const char *prepend) + nbdkit_error ("realloc: %m"); + exit (EXIT_FAILURE); + } +- r = read (fd, buf.ptr + buf.size, buf.alloc - buf.size); ++ r = read (fd, buf.ptr + buf.size, buf.cap - buf.size); + if (r == -1) { + nbdkit_error ("read: %s: %m", cmdline_file); + exit (EXIT_FAILURE); +-- +2.31.1 + diff --git a/0022-common-utils-vector-Rename-size-to-len.patch b/0022-common-utils-vector-Rename-size-to-len.patch new file mode 100644 index 0000000..822f84e --- /dev/null +++ b/0022-common-utils-vector-Rename-size-to-len.patch @@ -0,0 +1,1747 @@ +From a53a2234147543b04ee483aff7b9895c0d5082b5 Mon Sep 17 00:00:00 2001 +From: Nir Soffer +Date: Sat, 6 Nov 2021 00:03:11 +0200 +Subject: [PATCH] common/utils/vector: Rename `size` to `len` + +The field `size` may be confusing with the size of the underlying array. +Rename to `len`, a common term for this concept. + +Tested with "make check" as regular user, tests that need root or +external libraries (vddk) are not tested. + +Ported from libnbd commit cc0567e9aed7e6b40a44bf8eac0a262ac7314fec. + +(cherry picked from commit 0b0eece73f04963a66b9adc507e5cbaba608660b) +--- + common/allocators/allocator.c | 2 +- + common/allocators/malloc.c | 2 +- + common/allocators/sparse.c | 6 +- + common/allocators/zstd.c | 6 +- + common/regions/regions.h | 6 +- + common/utils/environ.c | 2 +- + common/utils/test-vector.c | 2 +- + common/utils/vector.h | 52 ++++++------ + filters/ddrescue/ddrescue.c | 2 +- + filters/exitwhen/exitwhen.c | 2 +- + filters/extentlist/extentlist.c | 14 ++-- + filters/multi-conn/multi-conn.c | 16 ++-- + plugins/cc/cc.c | 4 +- + plugins/data/data.c | 4 +- + plugins/data/format.c | 114 +++++++++++++-------------- + plugins/eval/eval.c | 2 +- + plugins/floppy/directory-lfn.c | 24 +++--- + plugins/floppy/floppy.c | 2 +- + plugins/floppy/virtual-floppy.c | 32 ++++---- + plugins/iso/iso.c | 4 +- + plugins/nbd/nbd.c | 6 +- + plugins/partitioning/partition-mbr.c | 8 +- + plugins/partitioning/partitioning.c | 18 ++--- + plugins/partitioning/virtual-disk.c | 12 +-- + plugins/partitioning/virtual-disk.h | 2 +- + plugins/split/split.c | 14 ++-- + plugins/ssh/ssh.c | 2 +- + plugins/vddk/reexec.c | 8 +- + plugins/vddk/stats.c | 4 +- + plugins/vddk/worker.c | 4 +- + server/exports.c | 6 +- + server/extents.c | 22 +++--- + server/main.c | 2 +- + server/sockets.c | 8 +- + wrapper.c | 4 +- + 35 files changed, 209 insertions(+), 209 deletions(-) + +diff --git a/common/allocators/allocator.c b/common/allocators/allocator.c +index d306a842..019c68cd 100644 +--- a/common/allocators/allocator.c ++++ b/common/allocators/allocator.c +@@ -137,7 +137,7 @@ create_allocator (const char *type, bool debug) + return NULL; + + /* See if we can find the allocator. */ +- for (i = 0; i < allocators.size; ++i) { ++ for (i = 0; i < allocators.len; ++i) { + if (strncmp (type, allocators.ptr[i]->type, type_len) == 0) { + ret = allocators.ptr[i]->create (¶ms); + break; +diff --git a/common/allocators/malloc.c b/common/allocators/malloc.c +index f7474465..eea44432 100644 +--- a/common/allocators/malloc.c ++++ b/common/allocators/malloc.c +@@ -241,7 +241,7 @@ m_alloc_create (const void *paramsv) + size_t i; + + /* Parse the optional mlock=true|false parameter. */ +- for (i = 0; i < params->size; ++i) { ++ for (i = 0; i < params->len; ++i) { + if (strcmp (params->ptr[i].key, "mlock") == 0) { + int r = nbdkit_parse_bool (params->ptr[i].value); + if (r == -1) return NULL; +diff --git a/common/allocators/sparse.c b/common/allocators/sparse.c +index ca508c35..7c6d1636 100644 +--- a/common/allocators/sparse.c ++++ b/common/allocators/sparse.c +@@ -150,7 +150,7 @@ sparse_array_free (struct allocator *a) + size_t i; + + if (sa) { +- for (i = 0; i < sa->l1_dir.size; ++i) ++ for (i = 0; i < sa->l1_dir.len; ++i) + free_l2_dir (sa->l1_dir.ptr[i].l2_dir); + free (sa->l1_dir.ptr); + pthread_mutex_destroy (&sa->lock); +@@ -184,7 +184,7 @@ insert_l1_entry (struct sparse_array *sa, const struct l1_entry *entry) + { + size_t i; + +- for (i = 0; i < sa->l1_dir.size; ++i) { ++ for (i = 0; i < sa->l1_dir.len; ++i) { + if (entry->offset < sa->l1_dir.ptr[i].offset) { + /* Insert new entry before i'th directory entry. */ + if (l1_dir_insert (&sa->l1_dir, *entry, i) == -1) { +@@ -508,7 +508,7 @@ sparse_array_create (const void *paramsv) + const allocator_parameters *params = paramsv; + struct sparse_array *sa; + +- if (params->size > 0) { ++ if (params->len > 0) { + nbdkit_error ("allocator=sparse does not take extra parameters"); + return NULL; + } +diff --git a/common/allocators/zstd.c b/common/allocators/zstd.c +index 81fe4ed0..1675d21c 100644 +--- a/common/allocators/zstd.c ++++ b/common/allocators/zstd.c +@@ -136,7 +136,7 @@ zstd_array_free (struct allocator *a) + + ZSTD_freeCCtx (za->zcctx); + ZSTD_freeDStream (za->zdstrm); +- for (i = 0; i < za->l1_dir.size; ++i) ++ for (i = 0; i < za->l1_dir.len; ++i) + free_l2_dir (za->l1_dir.ptr[i].l2_dir); + free (za->l1_dir.ptr); + pthread_mutex_destroy (&za->lock); +@@ -170,7 +170,7 @@ insert_l1_entry (struct zstd_array *za, const struct l1_entry *entry) + { + size_t i; + +- for (i = 0; i < za->l1_dir.size; ++i) { ++ for (i = 0; i < za->l1_dir.len; ++i) { + if (entry->offset < za->l1_dir.ptr[i].offset) { + /* Insert new entry before i'th directory entry. */ + if (l1_dir_insert (&za->l1_dir, *entry, i) == -1) { +@@ -600,7 +600,7 @@ zstd_array_create (const void *paramsv) + const allocator_parameters *params = paramsv; + struct zstd_array *za; + +- if (params->size > 0) { ++ if (params->len > 0) { + nbdkit_error ("allocator=zstd does not take extra parameters"); + return NULL; + } +diff --git a/common/regions/regions.h b/common/regions/regions.h +index 13fc41e2..34a398cd 100644 +--- a/common/regions/regions.h ++++ b/common/regions/regions.h +@@ -84,17 +84,17 @@ extern void free_regions (regions *regions) + static inline size_t __attribute__((__nonnull__ (1))) + nr_regions (regions *rs) + { +- return rs->size; ++ return rs->len; + } + + /* Return the virtual size of the disk. */ + static inline int64_t __attribute__((__nonnull__ (1))) + virtual_size (regions *rs) + { +- if (rs->size == 0) ++ if (rs->len == 0) + return 0; + else +- return rs->ptr[rs->size-1].end + 1; ++ return rs->ptr[rs->len-1].end + 1; + } + + /* Look up the region corresponding to the given offset. If the +diff --git a/common/utils/environ.c b/common/utils/environ.c +index e70976cb..2ad996eb 100644 +--- a/common/utils/environ.c ++++ b/common/utils/environ.c +@@ -82,7 +82,7 @@ copy_environ (char **env, ...) + + /* Search for key in the existing environment. It's O(n^2) ... */ + len = strlen (key); +- for (i = 0; i < ret.size; ++i) { ++ for (i = 0; i < ret.len; ++i) { + if (strncmp (key, ret.ptr[i], len) == 0 && ret.ptr[i][len] == '=') { + /* Replace the existing key. */ + free (ret.ptr[i]); +diff --git a/common/utils/test-vector.c b/common/utils/test-vector.c +index 28af59b8..6d89a281 100644 +--- a/common/utils/test-vector.c ++++ b/common/utils/test-vector.c +@@ -73,7 +73,7 @@ test_int64_vector (void) + assert (v.ptr[i] == i); + + int64_vector_remove (&v, 1); +- assert (v.size == 9); ++ assert (v.len == 9); + assert (v.ptr[1] == 2); + + tmp = 10; +diff --git a/common/utils/vector.h b/common/utils/vector.h +index 782dcba6..1d04f812 100644 +--- a/common/utils/vector.h ++++ b/common/utils/vector.h +@@ -59,14 +59,14 @@ + * + * string_vector names = empty_vector; + * +- * where ‘names.ptr[]’ will be an array of strings and ‘names.size’ ++ * where ‘names.ptr[]’ will be an array of strings and ‘names.len’ + * will be the number of strings. There are no get/set accessors. To + * iterate over the strings you can use the ‘.ptr’ field directly: + * +- * for (size_t i = 0; i < names.size; ++i) ++ * for (size_t i = 0; i < names.len; ++i) + * printf ("%s\n", names.ptr[i]); + * +- * Initializing with ‘empty_vector’ sets ‘.ptr = NULL’ and ‘.size = 0’. ++ * Initializing with ‘empty_vector’ sets ‘.ptr = NULL’ and ‘.len = 0’. + * + * DEFINE_VECTOR_TYPE also defines utility functions. For the full + * list see the definition below, but useful functions include: +@@ -84,15 +84,15 @@ + */ + #define DEFINE_VECTOR_TYPE(name, type) \ + struct name { \ +- type *ptr; /* Pointer to array of items. */ \ +- size_t size; /* Number of valid items in the array. */ \ +- size_t cap; /* Maximum number of items. */ \ ++ type *ptr; /* Pointer to array of items. */ \ ++ size_t len; /* Number of valid items in the array. */ \ ++ size_t cap; /* Maximum number of items. */ \ + }; \ + typedef struct name name; \ + \ + /* Reserve n elements at the end of the vector. Note space is \ +- * allocated but the vector size is not increased and the new \ +- * elements are not initialized. \ ++ * allocated and capacity is increased, but the vector length \ ++ * is not increased and the new elements are not initialized. \ + */ \ + static inline int \ + name##_reserve (name *v, size_t n) \ +@@ -101,17 +101,17 @@ + sizeof (type)); \ + } \ + \ +- /* Insert at i'th element. i=0 => beginning i=size => append */ \ ++ /* Insert at i'th element. i=0 => beginning i=len => append */ \ + static inline int \ + name##_insert (name *v, type elem, size_t i) \ + { \ +- assert (i <= v->size); \ +- if (v->size >= v->cap) { \ ++ assert (i <= v->len); \ ++ if (v->len >= v->cap) { \ + if (name##_reserve (v, 1) == -1) return -1; \ + } \ +- memmove (&v->ptr[i+1], &v->ptr[i], (v->size-i) * sizeof (elem)); \ ++ memmove (&v->ptr[i+1], &v->ptr[i], (v->len-i) * sizeof (elem)); \ + v->ptr[i] = elem; \ +- v->size++; \ ++ v->len++; \ + return 0; \ + } \ + \ +@@ -119,16 +119,16 @@ + static inline int \ + name##_append (name *v, type elem) \ + { \ +- return name##_insert (v, elem, v->size); \ ++ return name##_insert (v, elem, v->len); \ + } \ + \ +- /* Remove i'th element. i=0 => beginning i=size-1 => end */ \ ++ /* Remove i'th element. i=0 => beginning i=len-1 => end */ \ + static inline void \ + name##_remove (name *v, size_t i) \ + { \ +- assert (i < v->size); \ +- memmove (&v->ptr[i], &v->ptr[i+1], (v->size-i-1) * sizeof (type)); \ +- v->size--; \ ++ assert (i < v->len); \ ++ memmove (&v->ptr[i], &v->ptr[i+1], (v->len-i-1) * sizeof (type)); \ ++ v->len--; \ + } \ + \ + /* Remove all elements and deallocate the vector. */ \ +@@ -137,7 +137,7 @@ + { \ + free (v->ptr); \ + v->ptr = NULL; \ +- v->size = v->cap = 0; \ ++ v->len = v->cap = 0; \ + } \ + \ + /* Iterate over the vector, calling f() on each element. */ \ +@@ -145,7 +145,7 @@ + name##_iter (name *v, void (*f) (type elem)) \ + { \ + size_t i; \ +- for (i = 0; i < v->size; ++i) \ ++ for (i = 0; i < v->len; ++i) \ + f (v->ptr[i]); \ + } \ + \ +@@ -154,7 +154,7 @@ + name##_sort (name *v, \ + int (*compare) (const type *p1, const type *p2)) \ + { \ +- qsort (v->ptr, v->size, sizeof (type), (void *) compare); \ ++ qsort (v->ptr, v->len, sizeof (type), (void *) compare); \ + } \ + \ + /* Search for an exactly matching element in the vector using a \ +@@ -164,7 +164,7 @@ + name##_search (const name *v, const void *key, \ + int (*compare) (const void *key, const type *v)) \ + { \ +- return bsearch (key, v->ptr, v->size, sizeof (type), \ ++ return bsearch (key, v->ptr, v->len, sizeof (type), \ + (void *) compare); \ + } \ + \ +@@ -175,22 +175,22 @@ + /* Note it's allowed for v and copy to be the same pointer. */ \ + type *vptr = v->ptr; \ + type *newptr; \ +- size_t len = v->size * sizeof (type); \ ++ size_t len = v->len * sizeof (type); \ + \ + newptr = malloc (len); \ + if (newptr == NULL) return -1; \ + memcpy (newptr, vptr, len); \ + copy->ptr = newptr; \ +- copy->size = copy->cap = v->size; \ ++ copy->len = copy->cap = v->len; \ + return 0; \ + } \ + \ + +-#define empty_vector { .ptr = NULL, .size = 0, .cap = 0 } ++#define empty_vector { .ptr = NULL, .len = 0, .cap = 0 } + + struct generic_vector { + void *ptr; +- size_t size; ++ size_t len; + size_t cap; + }; + +diff --git a/filters/ddrescue/ddrescue.c b/filters/ddrescue/ddrescue.c +index 7b1c9c1e..218c8ee5 100644 +--- a/filters/ddrescue/ddrescue.c ++++ b/filters/ddrescue/ddrescue.c +@@ -180,7 +180,7 @@ ddrescue_pread (nbdkit_next *next, + { + size_t i; + +- for (i = 0; i < map.ranges.size; i++) { ++ for (i = 0; i < map.ranges.len; i++) { + if (map.ranges.ptr[i].status != '+') + continue; + if (offset >= map.ranges.ptr[i].start && offset <= map.ranges.ptr[i].end) { +diff --git a/filters/exitwhen/exitwhen.c b/filters/exitwhen/exitwhen.c +index 543af058..83e99953 100644 +--- a/filters/exitwhen/exitwhen.c ++++ b/filters/exitwhen/exitwhen.c +@@ -143,7 +143,7 @@ check_for_event (void) + size_t i; + + if (!exiting) { +- for (i = 0; i < events.size; ++i) { ++ for (i = 0; i < events.len; ++i) { + const struct event *event = &events.ptr[i]; + + switch (event->type) { +diff --git a/filters/extentlist/extentlist.c b/filters/extentlist/extentlist.c +index 7e6f1b78..c91fbfea 100644 +--- a/filters/extentlist/extentlist.c ++++ b/filters/extentlist/extentlist.c +@@ -134,7 +134,7 @@ parse_extentlist (void) + + assert (extentlist != NULL); + assert (extents.ptr == NULL); +- assert (extents.size == 0); ++ assert (extents.len == 0); + + fp = fopen (extentlist, "r"); + if (!fp) { +@@ -200,7 +200,7 @@ parse_extentlist (void) + + /* There must not be overlaps at this point. */ + end = 0; +- for (i = 0; i < extents.size; ++i) { ++ for (i = 0; i < extents.len; ++i) { + if (extents.ptr[i].offset < end || + extents.ptr[i].offset + extents.ptr[i].length < extents.ptr[i].offset) { + nbdkit_error ("extents in the extent list are overlapping"); +@@ -210,8 +210,8 @@ parse_extentlist (void) + } + + /* If there's a gap at the beginning, insert a hole|zero extent. */ +- if (extents.size == 0 || extents.ptr[0].offset > 0) { +- end = extents.size == 0 ? UINT64_MAX : extents.ptr[0].offset; ++ if (extents.len == 0 || extents.ptr[0].offset > 0) { ++ end = extents.len == 0 ? UINT64_MAX : extents.ptr[0].offset; + if (extent_list_insert (&extents, + (struct extent){.offset = 0, .length = end, + .type = HOLE}, +@@ -224,7 +224,7 @@ parse_extentlist (void) + /* Now insert hole|zero extents after every extent where there + * is a gap between that extent and the next one. + */ +- for (i = 0; i < extents.size-1; ++i) { ++ for (i = 0; i < extents.len-1; ++i) { + end = extents.ptr[i].offset + extents.ptr[i].length; + if (end < extents.ptr[i+1].offset) + if (extent_list_insert (&extents, +@@ -238,7 +238,7 @@ parse_extentlist (void) + } + + /* If there's a gap at the end, insert a hole|zero extent. */ +- end = extents.ptr[extents.size-1].offset + extents.ptr[extents.size-1].length; ++ end = extents.ptr[extents.len-1].offset + extents.ptr[extents.len-1].length; + if (end < UINT64_MAX) { + if (extent_list_append (&extents, + (struct extent){.offset = end, +@@ -250,7 +250,7 @@ parse_extentlist (void) + } + + /* Debug the final list. */ +- for (i = 0; i < extents.size; ++i) { ++ for (i = 0; i < extents.len; ++i) { + nbdkit_debug ("extentlist: " + "extent[%zu] = %" PRIu64 "-%" PRIu64 " (length %" PRIu64 ")" + " type %" PRIu32, +diff --git a/filters/multi-conn/multi-conn.c b/filters/multi-conn/multi-conn.c +index a6a25ef9..c7421a39 100644 +--- a/filters/multi-conn/multi-conn.c ++++ b/filters/multi-conn/multi-conn.c +@@ -207,14 +207,14 @@ multi_conn_prepare (nbdkit_next *next, void *handle, int readonly) + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); + if (byname) { + g = NULL; +- for (i = 0; i < groups.size; i++) ++ for (i = 0; i < groups.len; i++) + if (strcmp (groups.ptr[i]->name, h->name) == 0) { + g = groups.ptr[i]; + break; + } + } + else +- g = groups.size ? groups.ptr[0] : NULL; ++ g = groups.len ? groups.ptr[0] : NULL; + + if (!g) { + g = calloc (1, sizeof *g); +@@ -230,7 +230,7 @@ multi_conn_prepare (nbdkit_next *next, void *handle, int readonly) + } + if (conns_vector_append (&g->conns, h) == -1) { + if (new_group) { +- group_vector_remove (&groups, groups.size - 1); ++ group_vector_remove (&groups, groups.len - 1); + free (g->name); + free (g); + } +@@ -251,14 +251,14 @@ multi_conn_finalize (nbdkit_next *next, void *handle) + assert (h->group); + + /* XXX should we add a config param to flush if the client forgot? */ +- for (i = 0; i < h->group->conns.size; i++) { ++ for (i = 0; i < h->group->conns.len; i++) { + if (h->group->conns.ptr[i] == h) { + conns_vector_remove (&h->group->conns, i); + break; + } + } +- if (h->group->conns.size == 0) { +- for (i = 0; i < groups.size; i++) ++ if (h->group->conns.len == 0) { ++ for (i = 0; i < groups.len; i++) + if (groups.ptr[i] == h->group) { + group_vector_remove (&groups, i); + free (h->group->name); +@@ -451,7 +451,7 @@ multi_conn_flush (nbdkit_next *next, + assert (h->group); + if (h->mode == EMULATE) { + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); +- for (i = 0; i < h->group->conns.size; i++) { ++ for (i = 0; i < h->group->conns.len; i++) { + h2 = h->group->conns.ptr[i]; + if (track == OFF || (h->group->dirty && + (track == FAST || h2->dirty & READ)) || +@@ -474,7 +474,7 @@ multi_conn_flush (nbdkit_next *next, + case CONN: + if (next->can_multi_conn (next) == 1) { + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); +- for (i = 0; i < h->group->conns.size; i++) ++ for (i = 0; i < h->group->conns.len; i++) + h->group->conns.ptr[i]->dirty = 0; + h->group->dirty = 0; + } +diff --git a/plugins/cc/cc.c b/plugins/cc/cc.c +index 3251f312..c8c3c86b 100644 +--- a/plugins/cc/cc.c ++++ b/plugins/cc/cc.c +@@ -292,12 +292,12 @@ cc_config_complete (void) + if (subplugin.load) + subplugin.load (); + if (subplugin.config) { +- for (i = 0; i < params.size; ++i) { ++ for (i = 0; i < params.len; ++i) { + if (subplugin.config (params.ptr[i].key, params.ptr[i].value) == -1) + return -1; + } + } +- else if (params.size > 0) { ++ else if (params.len > 0) { + /* Just print the first one in the error message. */ + nbdkit_error ("unknown parameter: %s", params.ptr[0].key); + return -1; +diff --git a/plugins/data/data.c b/plugins/data/data.c +index 03bcc8a5..960cf97d 100644 +--- a/plugins/data/data.c ++++ b/plugins/data/data.c +@@ -158,7 +158,7 @@ get_extra_param (const char *name) + { + size_t i; + +- for (i = 0; i < params.size; ++i) { ++ for (i = 0; i < params.len; ++i) { + if (strcmp (params.ptr[i].key, name) == 0) + return params.ptr[i].value; + } +@@ -176,7 +176,7 @@ data_config_complete (void) + return -1; + } + +- if (data_seen != DATA && params.size != 0) { ++ if (data_seen != DATA && params.len != 0) { + nbdkit_error ("extra parameters passed and not using data='...'"); + return -1; + } +diff --git a/plugins/data/format.c b/plugins/data/format.c +index d351f79a..986a0f6e 100644 +--- a/plugins/data/format.c ++++ b/plugins/data/format.c +@@ -83,7 +83,7 @@ substring (string s, size_t offset, size_t len) + string r = empty_vector; + + for (i = 0; i < len; ++i) { +- assert (offset+i < s.size); ++ assert (offset+i < s.len); + if (string_append (&r, s.ptr[offset+i]) == -1) { + nbdkit_error ("realloc: %m"); + exit (EXIT_FAILURE); +@@ -167,7 +167,7 @@ static expr_list expr_table; + static node_id + new_node (const expr_t e) + { +- if (expr_table.size == 0) { ++ if (expr_table.len == 0) { + static const expr_t enull = { .t = EXPR_NULL }; + if (expr_list_append (&expr_table, enull) == -1) + goto out_of_memory; +@@ -179,14 +179,14 @@ new_node (const expr_t e) + nbdkit_error ("realloc"); + exit (EXIT_FAILURE); + } +- return expr_table.size-1; ++ return expr_table.len-1; + } + + /* Get an expression by node_id. */ + static expr_t + get_node (node_id id) + { +- assert (id < expr_table.size); ++ assert (id < expr_table.len); + return expr_table.ptr[id]; + } + +@@ -196,7 +196,7 @@ free_expr_table (void) + size_t i; + expr_t e; + +- for (i = 0; i < expr_table.size; ++i) { ++ for (i = 0; i < expr_table.len; ++i) { + e = get_node (i); + switch (e.t) { + case EXPR_LIST: free (e.list.ptr); break; +@@ -344,7 +344,7 @@ debug_expr (node_id id, int level) + break; + case EXPR_LIST: + nbdkit_debug ("%s(", debug_indent (level)); +- for (i = 0; i < e.list.size; ++i) ++ for (i = 0; i < e.list.len; ++i) + debug_expr (e.list.ptr[i], level+1); + nbdkit_debug ("%s)", debug_indent (level)); + break; +@@ -370,7 +370,7 @@ debug_expr (node_id id, int level) + CLEANUP_FREE_STRING string s = empty_vector; + static const char hex[] = "0123456789abcdef"; + +- for (i = 0; i < e.string.size; ++i) { ++ for (i = 0; i < e.string.len; ++i) { + char c = e.string.ptr[i]; + if (ascii_isprint ((char) c)) + string_append (&s, e.string.ptr[i]); +@@ -445,7 +445,7 @@ read_data_format (const char *value, struct allocator *a, uint64_t *size_rtn) + uint64_t offset = 0; + int r = -1; + +- assert (expr_table.size == 0); ++ assert (expr_table.len == 0); + + /* Run the parser across the entire string, returning the top level + * expression. +@@ -600,11 +600,11 @@ parser (int level, const char *value, size_t *start, size_t len, + + case '*': /* expr*N */ + i++; +- if (list.size == 0) { ++ if (list.len == 0) { + nbdkit_error ("*N must follow an expression"); + return -1; + } +- if (! is_data_expr (get_node (list.ptr[list.size-1]))) { ++ if (! is_data_expr (get_node (list.ptr[list.len-1]))) { + nbdkit_error ("*N cannot be applied to this type of expression"); + return -1; + } +@@ -619,18 +619,18 @@ parser (int level, const char *value, size_t *start, size_t len, + nbdkit_error ("*N not numeric"); + return -1; + } +- id = list.ptr[list.size-1]; +- list.size--; ++ id = list.ptr[list.len-1]; ++ list.len--; + APPEND_EXPR (new_node (expr (EXPR_REPEAT, id, (uint64_t) i64))); + break; + + case '[': /* expr[k:m] */ + i++; +- if (list.size == 0) { ++ if (list.len == 0) { + nbdkit_error ("[N:M] must follow an expression"); + return -1; + } +- if (! is_data_expr (get_node (list.ptr[list.size-1]))) { ++ if (! is_data_expr (get_node (list.ptr[list.len-1]))) { + nbdkit_error ("[N:M] cannot be applied to this type of expression"); + return -1; + } +@@ -647,8 +647,8 @@ parser (int level, const char *value, size_t *start, size_t len, + nbdkit_error ("enclosed pattern (...)[N:M] not numeric"); + return -1; + } +- id = list.ptr[list.size-1]; +- list.size--; ++ id = list.ptr[list.len-1]; ++ list.len--; + APPEND_EXPR (new_node (expr (EXPR_SLICE, id, i64, m))); + break; + +@@ -720,11 +720,11 @@ parser (int level, const char *value, size_t *start, size_t len, + i++; + if (value[i] != '>') goto parse_error; + i++; +- if (list.size == 0) { ++ if (list.len == 0) { + nbdkit_error ("-> must follow an expression"); + return -1; + } +- if (! is_data_expr (get_node (list.ptr[list.size-1]))) { ++ if (! is_data_expr (get_node (list.ptr[list.len-1]))) { + nbdkit_error ("-> cannot be applied to this type of expression"); + return -1; + } +@@ -735,9 +735,9 @@ parser (int level, const char *value, size_t *start, size_t len, + nbdkit_error ("strndup: %m"); + return -1; + } +- id = list.ptr[list.size-1]; ++ id = list.ptr[list.len-1]; + i += flen; +- list.size--; ++ list.len--; + APPEND_EXPR (new_node (expr (EXPR_ASSIGN, name, id))); + break; + } +@@ -1023,7 +1023,7 @@ parse_word (const char *value, size_t *start, size_t len, string *rtn) + } + memcpy (copy.ptr, &value[*start], n); + copy.ptr[n] = '\0'; +- copy.size = n + 1; ++ copy.len = n + 1; + *start = i; + + /* Reserve enough space in the return buffer for the longest +@@ -1036,22 +1036,22 @@ parse_word (const char *value, size_t *start, size_t len, string *rtn) + + /* Parse the rest of {le|be}{16|32|64}: */ + if (strncmp (copy.ptr, "le16:", 5) == 0) { +- endian = little; rtn->size = 2; ++ endian = little; rtn->len = 2; + } + else if (strncmp (copy.ptr, "le32:", 5) == 0) { +- endian = little; rtn->size = 4; ++ endian = little; rtn->len = 4; + } + else if (strncmp (copy.ptr, "le64:", 5) == 0) { +- endian = little; rtn->size = 8; ++ endian = little; rtn->len = 8; + } + else if (strncmp (copy.ptr, "be16:", 5) == 0) { +- endian = big; rtn->size = 2; ++ endian = big; rtn->len = 2; + } + else if (strncmp (copy.ptr, "be32:", 5) == 0) { +- endian = big; rtn->size = 4; ++ endian = big; rtn->len = 4; + } + else if (strncmp (copy.ptr, "be64:", 5) == 0) { +- endian = big; rtn->size = 8; ++ endian = big; rtn->len = 8; + } + else { + nbdkit_error ("data parameter: expected \"le16/32/64:\" " +@@ -1060,7 +1060,7 @@ parse_word (const char *value, size_t *start, size_t len, string *rtn) + } + + /* Parse the word field into a host-order unsigned int. */ +- switch (rtn->size) { ++ switch (rtn->len) { + case 2: + if (nbdkit_parse_uint16_t ("data", ©.ptr[5], &u16) == -1) + return -1; +@@ -1081,7 +1081,7 @@ parse_word (const char *value, size_t *start, size_t len, string *rtn) + */ + switch (endian) { + case little: +- switch (rtn->size) { ++ switch (rtn->len) { + case 2: /* le16: */ + *((uint16_t *) rtn->ptr) = htole16 (u16); + break; +@@ -1096,7 +1096,7 @@ parse_word (const char *value, size_t *start, size_t len, string *rtn) + break; + + case big: +- switch (rtn->size) { ++ switch (rtn->len) { + case 2: /* be16: */ + *((uint16_t *) rtn->ptr) = htobe16 (u16); + break; +@@ -1134,7 +1134,7 @@ optimize_ast (node_id root, node_id *root_rtn) + /* For convenience this makes a new list node. */ + + /* Optimize each element of the list. */ +- for (i = 0; i < get_node (root).list.size; ++i) { ++ for (i = 0; i < get_node (root).list.len; ++i) { + id = get_node (root).list.ptr[i]; + if (optimize_ast (id, &id) == -1) + return -1; +@@ -1148,7 +1148,7 @@ optimize_ast (node_id root, node_id *root_rtn) + * because flattening the list changes the scope. + */ + if (list_safe_to_inline (get_node (id).list)) { +- for (j = 0; j < get_node (id).list.size; ++j) { ++ for (j = 0; j < get_node (id).list.len; ++j) { + if (node_ids_append (&list, get_node (id).list.ptr[j]) == -1) + goto list_append_error; + } +@@ -1165,7 +1165,7 @@ optimize_ast (node_id root, node_id *root_rtn) + } + + /* Combine adjacent pairs of elements if possible. */ +- for (i = 1; i < list.size; ++i) { ++ for (i = 1; i < list.len; ++i) { + node_id id0, id1; + + id0 = list.ptr[i-1]; +@@ -1178,7 +1178,7 @@ optimize_ast (node_id root, node_id *root_rtn) + } + + /* List of length 0 is replaced with null. */ +- if (list.size == 0) { ++ if (list.len == 0) { + free (list.ptr); + *root_rtn = new_node (expr (EXPR_NULL)); + return 0; +@@ -1187,7 +1187,7 @@ optimize_ast (node_id root, node_id *root_rtn) + /* List of length 1 is replaced with the first element, but as + * above avoid inlining if it is not a safe expression. + */ +- if (list.size == 1 && expr_safe_to_inline (get_node (list.ptr[0]))) { ++ if (list.len == 1 && expr_safe_to_inline (get_node (list.ptr[0]))) { + id = list.ptr[0]; + free (list.ptr); + *root_rtn = id; +@@ -1242,13 +1242,13 @@ optimize_ast (node_id root, node_id *root_rtn) + */ + if (get_node (id).t == EXPR_STRING && + get_node (root).r.n <= 4 && +- get_node (id).string.size <= 512) { ++ get_node (id).string.len <= 512) { + string s = empty_vector; + size_t n = get_node (root).r.n; + const string sub = get_node (id).string; + + for (i = 0; i < n; ++i) { +- for (j = 0; j < sub.size; ++j) { ++ for (j = 0; j < sub.len; ++j) { + if (string_append (&s, sub.ptr[j]) == -1) { + nbdkit_error ("realloc: %m"); + return -1; +@@ -1307,7 +1307,7 @@ optimize_ast (node_id root, node_id *root_rtn) + } + break; + case EXPR_STRING: /* substring */ +- len = get_node (id).string.size; ++ len = get_node (id).string.len; + if (m >= 0 && n <= m && m <= len) { + if (m-n == 1) + *root_rtn = new_node (expr (EXPR_BYTE, get_node (id).string.ptr[n])); +@@ -1355,23 +1355,23 @@ optimize_ast (node_id root, node_id *root_rtn) + + case EXPR_STRING: + /* A zero length string can be replaced with null. */ +- if (get_node (root).string.size == 0) { ++ if (get_node (root).string.len == 0) { + *root_rtn = new_node (expr (EXPR_NULL)); + return 0; + } + /* Strings containing the same character can be replaced by a + * fill. These can be produced by other optimizations. + */ +- if (get_node (root).string.size > 1) { ++ if (get_node (root).string.len > 1) { + const string s = get_node (root).string; + uint8_t b = s.ptr[0]; + +- for (i = 1; i < s.size; ++i) ++ for (i = 1; i < s.len; ++i) + if (s.ptr[i] != b) + break; + +- if (i == s.size) { +- *root_rtn = new_node (expr (EXPR_FILL, b, (uint64_t) s.size)); ++ if (i == s.len) { ++ *root_rtn = new_node (expr (EXPR_FILL, b, (uint64_t) s.len)); + return 0; + } + } +@@ -1442,7 +1442,7 @@ list_safe_to_inline (const node_ids list) + { + size_t i; + +- for (i = 0; i < list.size; ++i) { ++ for (i = 0; i < list.len; ++i) { + if (!expr_safe_to_inline (get_node (list.ptr[i]))) + return false; + } +@@ -1461,11 +1461,11 @@ expr_is_single_byte (const expr_t e, uint8_t *b) + if (b) *b = e.b; + return true; + case EXPR_LIST: /* A single element list if it is single byte */ +- if (e.list.size != 1) ++ if (e.list.len != 1) + return false; + return expr_is_single_byte (get_node (e.list.ptr[0]), b); + case EXPR_STRING: /* A length-1 string. */ +- if (e.string.size != 1) ++ if (e.string.len != 1) + return false; + if (b) *b = e.string.ptr[0]; + return true; +@@ -1511,10 +1511,10 @@ exprs_can_combine (expr_t e0, expr_t e1, node_id *id_rtn) + } + return true; + case EXPR_STRING: /* byte string => string */ +- len = e1.string.size; ++ len = e1.string.len; + if (string_reserve (&s, len+1) == -1) + goto out_of_memory; +- s.size = len+1; ++ s.len = len+1; + s.ptr[0] = e0.b; + memcpy (&s.ptr[1], e1.string.ptr, len); + *id_rtn = new_node (expr (EXPR_STRING, s)); +@@ -1533,20 +1533,20 @@ exprs_can_combine (expr_t e0, expr_t e1, node_id *id_rtn) + case EXPR_STRING: + switch (e1.t) { + case EXPR_BYTE: /* string byte => string */ +- len = e0.string.size; ++ len = e0.string.len; + if (string_reserve (&s, len+1) == -1) + goto out_of_memory; +- s.size = len+1; ++ s.len = len+1; + memcpy (s.ptr, e0.string.ptr, len); + s.ptr[len] = e1.b; + *id_rtn = new_node (expr (EXPR_STRING, s)); + return true; + case EXPR_STRING: /* string string => string */ +- len = e0.string.size; +- len1 = e1.string.size; ++ len = e0.string.len; ++ len1 = e1.string.len; + if (string_reserve (&s, len+len1) == -1) + goto out_of_memory; +- s.size = len+len1; ++ s.len = len+len1; + memcpy (s.ptr, e0.string.ptr, len); + memcpy (&s.ptr[len], e1.string.ptr, len1); + *id_rtn = new_node (expr (EXPR_STRING, s)); +@@ -1618,11 +1618,11 @@ evaluate (const dict_t *dict, node_id root, + list = get_node (root).list; + } + else { +- list.size = 1; ++ list.len = 1; + list.ptr = &root; + } + +- for (i = 0; i < list.size; ++i) { ++ for (i = 0; i < list.len; ++i) { + const expr_t e = get_node (list.ptr[i]); + + switch (e.t) { +@@ -1667,9 +1667,9 @@ evaluate (const dict_t *dict, node_id root, + + case EXPR_STRING: + /* Copy the string into the allocator. */ +- if (a->f->write (a, e.string.ptr, e.string.size, *offset) == -1) ++ if (a->f->write (a, e.string.ptr, e.string.len, *offset) == -1) + return -1; +- *offset += e.string.size; ++ *offset += e.string.len; + break; + + case EXPR_FILL: +diff --git a/plugins/eval/eval.c b/plugins/eval/eval.c +index fa1c23ff..b312a59c 100644 +--- a/plugins/eval/eval.c ++++ b/plugins/eval/eval.c +@@ -114,7 +114,7 @@ insert_method_script (const char *method, char *script) + size_t i; + struct method_script new_entry = { .method = method, .script = script }; + +- for (i = 0; i < method_scripts.size; ++i) { ++ for (i = 0; i < method_scripts.len; ++i) { + r = compare_script (method, &method_scripts.ptr[i]); + /* This shouldn't happen. insert_method_script() must not be + * called if the method has already been added. Call get_script() +diff --git a/plugins/floppy/directory-lfn.c b/plugins/floppy/directory-lfn.c +index a87d376a..fe47e0b6 100644 +--- a/plugins/floppy/directory-lfn.c ++++ b/plugins/floppy/directory-lfn.c +@@ -79,8 +79,8 @@ create_directory (size_t di, const char *label, + struct virtual_floppy *floppy) + { + size_t i; +- const size_t nr_subdirs = floppy->dirs.ptr[di].subdirs.size; +- const size_t nr_files = floppy->dirs.ptr[di].fileidxs.size; ++ const size_t nr_subdirs = floppy->dirs.ptr[di].subdirs.len; ++ const size_t nr_files = floppy->dirs.ptr[di].fileidxs.len; + struct lfn *lfns, *lfn; + const char *name; + uint8_t attributes; +@@ -109,14 +109,14 @@ create_directory (size_t di, const char *label, + } + for (i = 0; i < nr_subdirs; ++i) { + const size_t sdi = floppy->dirs.ptr[di].subdirs.ptr[i]; +- assert (sdi < floppy->dirs.size); ++ assert (sdi < floppy->dirs.len); + + name = floppy->dirs.ptr[sdi].name; + lfns[i].name = name; + } + for (i = 0; i < nr_files; ++i) { + const size_t fi = floppy->dirs.ptr[di].fileidxs.ptr[i]; +- assert (fi < floppy->files.size); ++ assert (fi < floppy->files.len); + + name = floppy->files.ptr[fi].name; + lfns[nr_subdirs+i].name = name; +@@ -132,7 +132,7 @@ create_directory (size_t di, const char *label, + file_size = 0; + for (i = 0; i < nr_subdirs; ++i) { + const size_t sdi = floppy->dirs.ptr[di].subdirs.ptr[i]; +- assert (sdi < floppy->dirs.size); ++ assert (sdi < floppy->dirs.len); + + lfn = &lfns[i]; + statbuf = &floppy->dirs.ptr[sdi].statbuf; +@@ -148,7 +148,7 @@ create_directory (size_t di, const char *label, + attributes = DIR_ENTRY_ARCHIVE; /* Same as set by Linux kernel. */ + for (i = 0; i < nr_files; ++i) { + const size_t fi = floppy->dirs.ptr[di].fileidxs.ptr[i]; +- assert (fi < floppy->files.size); ++ assert (fi < floppy->files.len); + + lfn = &lfns[nr_subdirs+i]; + statbuf = &floppy->files.ptr[fi].statbuf; +@@ -532,7 +532,7 @@ append_dir_table (size_t di, const struct dir_entry *entry, + { + size_t i; + +- i = floppy->dirs.ptr[di].table.size; ++ i = floppy->dirs.ptr[di].table.len; + if (dir_entries_append (&floppy->dirs.ptr[di].table, *entry) == -1) { + nbdkit_error ("realloc: %m"); + return -1; +@@ -550,8 +550,8 @@ int + update_directory_first_cluster (size_t di, struct virtual_floppy *floppy) + { + size_t i, j, pdi; +- const size_t nr_subdirs = floppy->dirs.ptr[di].subdirs.size; +- const size_t nr_files = floppy->dirs.ptr[di].fileidxs.size; ++ const size_t nr_subdirs = floppy->dirs.ptr[di].subdirs.len; ++ const size_t nr_files = floppy->dirs.ptr[di].fileidxs.len; + uint32_t first_cluster; + struct dir_entry *entry; + +@@ -561,7 +561,7 @@ update_directory_first_cluster (size_t di, struct virtual_floppy *floppy) + * table entries. + */ + i = 0; +- for (j = 0; j < floppy->dirs.ptr[di].table.size; ++j) { ++ for (j = 0; j < floppy->dirs.ptr[di].table.len; ++j) { + entry = &floppy->dirs.ptr[di].table.ptr[j]; + + /* Skip LFN entries. */ +@@ -596,12 +596,12 @@ update_directory_first_cluster (size_t di, struct virtual_floppy *floppy) + */ + if (i < nr_subdirs) { + const size_t sdi = floppy->dirs.ptr[di].subdirs.ptr[i]; +- assert (sdi < floppy->dirs.size); ++ assert (sdi < floppy->dirs.len); + first_cluster = floppy->dirs.ptr[sdi].first_cluster; + } + else if (i < nr_subdirs + nr_files) { + const size_t fi = floppy->dirs.ptr[di].fileidxs.ptr[i-nr_subdirs]; +- assert (fi < floppy->files.size); ++ assert (fi < floppy->files.len); + first_cluster = floppy->files.ptr[fi].first_cluster; + } + else +diff --git a/plugins/floppy/floppy.c b/plugins/floppy/floppy.c +index 80f350af..938f5bec 100644 +--- a/plugins/floppy/floppy.c ++++ b/plugins/floppy/floppy.c +@@ -172,7 +172,7 @@ floppy_pread (void *handle, void *buf, uint32_t count, uint64_t offset) + switch (region->type) { + case region_file: + i = region->u.i; +- assert (i < floppy.files.size); ++ assert (i < floppy.files.len); + host_path = floppy.files.ptr[i].host_path; + fd = open (host_path, O_RDONLY|O_CLOEXEC); + if (fd == -1) { +diff --git a/plugins/floppy/virtual-floppy.c b/plugins/floppy/virtual-floppy.c +index 6eae5600..b1546bd5 100644 +--- a/plugins/floppy/virtual-floppy.c ++++ b/plugins/floppy/virtual-floppy.c +@@ -97,10 +97,10 @@ create_virtual_floppy (const char *dir, const char *label, uint64_t size, + return -1; + + nbdkit_debug ("floppy: %zu directories and %zu files", +- floppy->dirs.size, floppy->files.size); ++ floppy->dirs.len, floppy->files.len); + + /* Create the on disk directory tables. */ +- for (i = 0; i < floppy->dirs.size; ++i) { ++ for (i = 0; i < floppy->dirs.len; ++i) { + if (create_directory (i, label, floppy) == -1) + return -1; + } +@@ -115,10 +115,10 @@ create_virtual_floppy (const char *dir, const char *label, uint64_t size, + */ + data_used_size = 0; + cluster = 2; +- for (i = 0; i < floppy->dirs.size; ++i) { ++ for (i = 0; i < floppy->dirs.len; ++i) { + floppy->dirs.ptr[i].first_cluster = cluster; + nr_bytes = +- ROUND_UP (floppy->dirs.ptr[i].table.size * sizeof (struct dir_entry), ++ ROUND_UP (floppy->dirs.ptr[i].table.len * sizeof (struct dir_entry), + CLUSTER_SIZE); + data_used_size += nr_bytes; + nr_clusters = nr_bytes / CLUSTER_SIZE; +@@ -127,7 +127,7 @@ create_virtual_floppy (const char *dir, const char *label, uint64_t size, + floppy->dirs.ptr[i].nr_clusters = nr_clusters; + cluster += nr_clusters; + } +- for (i = 0; i < floppy->files.size; ++i) { ++ for (i = 0; i < floppy->files.len; ++i) { + floppy->files.ptr[i].first_cluster = cluster; + nr_bytes = ROUND_UP (floppy->files.ptr[i].statbuf.st_size, CLUSTER_SIZE); + data_used_size += nr_bytes; +@@ -187,7 +187,7 @@ create_virtual_floppy (const char *dir, const char *label, uint64_t size, + * directory entries (which we didn't have available during + * create_directory above). + */ +- for (i = 0; i < floppy->dirs.size; ++i) { ++ for (i = 0; i < floppy->dirs.len; ++i) { + if (update_directory_first_cluster (i, floppy) == -1) + return -1; + } +@@ -230,13 +230,13 @@ free_virtual_floppy (struct virtual_floppy *floppy) + + free (floppy->fat); + +- for (i = 0; i < floppy->files.size; ++i) { ++ for (i = 0; i < floppy->files.len; ++i) { + free (floppy->files.ptr[i].name); + free (floppy->files.ptr[i].host_path); + } + free (floppy->files.ptr); + +- for (i = 0; i < floppy->dirs.size; ++i) { ++ for (i = 0; i < floppy->dirs.len; ++i) { + free (floppy->dirs.ptr[i].name); + free (floppy->dirs.ptr[i].subdirs.ptr); + free (floppy->dirs.ptr[i].fileidxs.ptr); +@@ -266,7 +266,7 @@ visit (const char *dir, struct virtual_floppy *floppy) + * directory will always be at dirs[0]. + */ + memset (&null_dir, 0, sizeof null_dir); +- di = floppy->dirs.size; ++ di = floppy->dirs.len; + if (dirs_append (&floppy->dirs, null_dir) == -1) { + nbdkit_error ("realloc: %m"); + goto error0; +@@ -423,7 +423,7 @@ visit_file (const char *dir, const char *name, + } + new_file.host_path = host_path; + new_file.statbuf = *statbuf; +- fi = floppy->files.size; ++ fi = floppy->files.len; + if (files_append (&floppy->files, new_file) == -1) { + nbdkit_error ("realloc: %m"); + free (host_path); +@@ -574,11 +574,11 @@ create_fat (struct virtual_floppy *floppy) + floppy->fat[0] = htole32 (0x0ffffff8); + floppy->fat[1] = htole32 (0x0fffffff); + +- for (i = 0; i < floppy->dirs.size; ++i) { ++ for (i = 0; i < floppy->dirs.len; ++i) { + write_fat_file (floppy->dirs.ptr[i].first_cluster, + floppy->dirs.ptr[i].nr_clusters, floppy); + } +- for (i = 0; i < floppy->files.size; ++i) { ++ for (i = 0; i < floppy->files.len; ++i) { + write_fat_file (floppy->files.ptr[i].first_cluster, + floppy->files.ptr[i].nr_clusters, floppy); + } +@@ -676,15 +676,15 @@ create_regions (struct virtual_floppy *floppy) + /* Now we're into the data region. We add all directory tables + * first. + */ +- for (i = 0; i < floppy->dirs.size; ++i) { ++ for (i = 0; i < floppy->dirs.len; ++i) { + /* Directories can never be completely empty because of the volume + * label (root) or "." and ".." entries (non-root). + */ +- assert (floppy->dirs.ptr[i].table.size > 0); ++ assert (floppy->dirs.ptr[i].table.len > 0); + + if (append_region_len (&floppy->regions, + i == 0 ? "root directory" : floppy->dirs.ptr[i].name, +- floppy->dirs.ptr[i].table.size * ++ floppy->dirs.ptr[i].table.len * + sizeof (struct dir_entry), + 0, CLUSTER_SIZE, + region_data, +@@ -693,7 +693,7 @@ create_regions (struct virtual_floppy *floppy) + } + + /* Add all files. */ +- for (i = 0; i < floppy->files.size; ++i) { ++ for (i = 0; i < floppy->files.len; ++i) { + /* It's possible for a file to have zero size, in which case it + * doesn't occupy a region or cluster. + */ +diff --git a/plugins/iso/iso.c b/plugins/iso/iso.c +index cb621f41..e232175f 100644 +--- a/plugins/iso/iso.c ++++ b/plugins/iso/iso.c +@@ -105,7 +105,7 @@ make_iso (void) + fprintf (fp, " -quiet"); + if (params) + fprintf (fp, " %s", params); +- for (i = 0; i < dirs.size; ++i) { ++ for (i = 0; i < dirs.len; ++i) { + fputc (' ', fp); + shell_quote (dirs.ptr[i], fp); + } +@@ -169,7 +169,7 @@ iso_config (const char *key, const char *value) + static int + iso_config_complete (void) + { +- if (dirs.size == 0) { ++ if (dirs.len == 0) { + nbdkit_error ("you must supply the dir= parameter " + "after the plugin name on the command line"); + return -1; +diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c +index 488eadb2..ae595ea7 100644 +--- a/plugins/nbd/nbd.c ++++ b/plugins/nbd/nbd.c +@@ -244,7 +244,7 @@ static int + nbdplug_config_complete (void) + { + int c = !!sockname + !!hostname + !!uri + +- (command.size > 0) + (socket_fd >= 0) + !!raw_cid; ++ (command.len > 0) + (socket_fd >= 0) + !!raw_cid; + + /* Check the user passed exactly one connection parameter. */ + if (c > 1) { +@@ -303,7 +303,7 @@ nbdplug_config_complete (void) + return -1; + #endif + } +- else if (command.size > 0) { ++ else if (command.len > 0) { + /* Add NULL sentinel to the command. */ + if (string_vector_append (&command, NULL) == -1) { + nbdkit_error ("realloc: %m"); +@@ -574,7 +574,7 @@ nbdplug_connect (struct nbd_handle *nbd) + #else + return nbd_connect_vsock (nbd, cid, vport); + #endif +- else if (command.size > 0) ++ else if (command.len > 0) + return nbd_connect_systemd_socket_activation (nbd, (char **) command.ptr); + else if (socket_fd >= 0) + return nbd_connect_socket (nbd, socket_fd); +diff --git a/plugins/partitioning/partition-mbr.c b/plugins/partitioning/partition-mbr.c +index 9a1a043c..1f178dcb 100644 +--- a/plugins/partitioning/partition-mbr.c ++++ b/plugins/partitioning/partition-mbr.c +@@ -62,9 +62,9 @@ create_mbr_layout (void) + primary[0x1fe] = 0x55; + primary[0x1ff] = 0xaa; + +- if (the_files.size <= 4) { ++ if (the_files.len <= 4) { + /* Basic MBR with no extended partition. */ +- for (i = 0; i < the_files.size; ++i) { ++ for (i = 0; i < the_files.len; ++i) { + const struct region *region = find_file_region (i, &j); + + create_mbr_partition_table_entry (region, i == 0, the_files.ptr[i].mbr_id, +@@ -97,7 +97,7 @@ create_mbr_layout (void) + /* The remaining files are mapped to logical partitions living in + * the fourth extended partition. + */ +- for (i = 3; i < the_files.size; ++i) { ++ for (i = 3; i < the_files.len; ++i) { + if (i == 3) + eptr = eptr0; + else +@@ -117,7 +117,7 @@ create_mbr_layout (void) + create_mbr_partition_table_entry (®ion, false, the_files.ptr[i].mbr_id, + &ebr[i-3][0x1be]); + +- if (i < the_files.size-1) { ++ if (i < the_files.len-1) { + size_t j2 = j; + const struct region *enext = find_ebr_region (i+1, &j2); + const struct region *rnext = find_file_region (i+1, &j2); +diff --git a/plugins/partitioning/partitioning.c b/plugins/partitioning/partitioning.c +index 231b2d77..2301ba4e 100644 +--- a/plugins/partitioning/partitioning.c ++++ b/plugins/partitioning/partitioning.c +@@ -104,7 +104,7 @@ partitioning_unload (void) + { + size_t i; + +- for (i = 0; i < the_files.size; ++i) ++ for (i = 0; i < the_files.len; ++i) + close (the_files.ptr[i].fd); + free (the_files.ptr); + +@@ -116,7 +116,7 @@ partitioning_unload (void) + free (primary); + free (secondary); + if (ebr) { +- for (i = 0; i < the_files.size-3; ++i) ++ for (i = 0; i < the_files.len-3; ++i) + free (ebr[i]); + free (ebr); + } +@@ -235,19 +235,19 @@ partitioning_config_complete (void) + bool needs_gpt; + + /* Not enough / too many files? */ +- if (the_files.size == 0) { ++ if (the_files.len == 0) { + nbdkit_error ("at least one file= parameter must be supplied"); + return -1; + } + + total_size = 0; +- for (i = 0; i < the_files.size; ++i) ++ for (i = 0; i < the_files.len; ++i) + total_size += the_files.ptr[i].statbuf.st_size; + needs_gpt = total_size > MAX_MBR_DISK_SIZE; + + /* Choose default parttype if not set. */ + if (parttype == PARTTYPE_UNSET) { +- if (needs_gpt || the_files.size > 4) { ++ if (needs_gpt || the_files.len > 4) { + parttype = PARTTYPE_GPT; + nbdkit_debug ("picking partition type GPT"); + } +@@ -262,7 +262,7 @@ partitioning_config_complete (void) + "but you requested %zu partition(s) " + "and a total size of %" PRIu64 " bytes (> %" PRIu64 "). " + "Try using: partition-type=gpt", +- the_files.size, total_size, (uint64_t) MAX_MBR_DISK_SIZE); ++ the_files.len, total_size, (uint64_t) MAX_MBR_DISK_SIZE); + return -1; + } + +@@ -327,7 +327,7 @@ partitioning_pread (void *handle, void *buf, uint32_t count, uint64_t offset) + switch (region->type) { + case region_file: + i = region->u.i; +- assert (i < the_files.size); ++ assert (i < the_files.len); + r = pread (the_files.ptr[i].fd, buf, len, offset - region->start); + if (r == -1) { + nbdkit_error ("pread: %s: %m", the_files.ptr[i].filename); +@@ -376,7 +376,7 @@ partitioning_pwrite (void *handle, + switch (region->type) { + case region_file: + i = region->u.i; +- assert (i < the_files.size); ++ assert (i < the_files.len); + r = pwrite (the_files.ptr[i].fd, buf, len, offset - region->start); + if (r == -1) { + nbdkit_error ("pwrite: %s: %m", the_files.ptr[i].filename); +@@ -418,7 +418,7 @@ partitioning_flush (void *handle) + { + size_t i; + +- for (i = 0; i < the_files.size; ++i) { ++ for (i = 0; i < the_files.len; ++i) { + if (fdatasync (the_files.ptr[i].fd) == -1) { + nbdkit_error ("fdatasync: %m"); + return -1; +diff --git a/plugins/partitioning/virtual-disk.c b/plugins/partitioning/virtual-disk.c +index 389a17b6..d46ca46a 100644 +--- a/plugins/partitioning/virtual-disk.c ++++ b/plugins/partitioning/virtual-disk.c +@@ -56,7 +56,7 @@ create_virtual_disk_layout (void) + size_t i; + + assert (nr_regions (&the_regions) == 0); +- assert (the_files.size > 0); ++ assert (the_files.len > 0); + assert (primary == NULL); + assert (secondary == NULL); + +@@ -68,17 +68,17 @@ create_virtual_disk_layout (void) + return -1; + } + +- if (the_files.size > 4) { ++ if (the_files.len > 4) { + /* The first 3 primary partitions will be real partitions, the + * 4th will be an extended partition, and so we need to store + * EBRs for the_files.size-3 logical partitions. + */ +- ebr = malloc (sizeof (unsigned char *) * (the_files.size-3)); ++ ebr = malloc (sizeof (unsigned char *) * (the_files.len-3)); + if (ebr == NULL) { + nbdkit_error ("malloc: %m"); + return -1; + } +- for (i = 0; i < the_files.size-3; ++i) { ++ for (i = 0; i < the_files.len-3; ++i) { + ebr[i] = calloc (1, SECTOR_SIZE); + if (ebr[i] == NULL) { + nbdkit_error ("malloc: %m"); +@@ -117,7 +117,7 @@ create_virtual_disk_layout (void) + } + + /* The partitions. */ +- for (i = 0; i < the_files.size; ++i) { ++ for (i = 0; i < the_files.len; ++i) { + uint64_t offset; + + offset = virtual_size (&the_regions); +@@ -127,7 +127,7 @@ create_virtual_disk_layout (void) + assert (IS_ALIGNED (offset, SECTOR_SIZE)); + + /* Logical partitions are preceeded by an EBR. */ +- if (parttype == PARTTYPE_MBR && the_files.size > 4 && i >= 3) { ++ if (parttype == PARTTYPE_MBR && the_files.len > 4 && i >= 3) { + if (append_region_len (&the_regions, "EBR", + SECTOR_SIZE, 0, 0, + region_data, ebr[i-3]) == -1) +diff --git a/plugins/partitioning/virtual-disk.h b/plugins/partitioning/virtual-disk.h +index 7032dfc8..d56c2b86 100644 +--- a/plugins/partitioning/virtual-disk.h ++++ b/plugins/partitioning/virtual-disk.h +@@ -55,7 +55,7 @@ + * 32 if the number of files is <= GPT_MIN_PARTITIONS, which is the + * normal case. + */ +-#define GPT_PTA_SIZE ROUND_UP (the_files.size, GPT_MIN_PARTITIONS) ++#define GPT_PTA_SIZE ROUND_UP (the_files.len, GPT_MIN_PARTITIONS) + #define GPT_PTA_LBAs (GPT_PTA_SIZE * GPT_PT_ENTRY_SIZE / SECTOR_SIZE) + + /* Maximum possible and default alignment between partitions. */ +diff --git a/plugins/split/split.c b/plugins/split/split.c +index c559a0cd..4c9790a6 100644 +--- a/plugins/split/split.c ++++ b/plugins/split/split.c +@@ -121,13 +121,13 @@ split_open (int readonly) + return NULL; + } + +- h->files = malloc (filenames.size * sizeof (struct file)); ++ h->files = malloc (filenames.len * sizeof (struct file)); + if (h->files == NULL) { + nbdkit_error ("malloc: %m"); + free (h); + return NULL; + } +- for (i = 0; i < filenames.size; ++i) ++ for (i = 0; i < filenames.len; ++i) + h->files[i].fd = -1; + + /* Open the files. */ +@@ -137,7 +137,7 @@ split_open (int readonly) + else + flags |= O_RDWR; + +- for (i = 0; i < filenames.size; ++i) { ++ for (i = 0; i < filenames.len; ++i) { + h->files[i].fd = open (filenames.ptr[i], flags); + if (h->files[i].fd == -1) { + nbdkit_error ("open: %s: %m", filenames.ptr[i]); +@@ -146,7 +146,7 @@ split_open (int readonly) + } + + offset = 0; +- for (i = 0; i < filenames.size; ++i) { ++ for (i = 0; i < filenames.len; ++i) { + h->files[i].offset = offset; + + if (fstat (h->files[i].fd, &statbuf) == -1) { +@@ -179,7 +179,7 @@ split_open (int readonly) + return h; + + err: +- for (i = 0; i < filenames.size; ++i) { ++ for (i = 0; i < filenames.len; ++i) { + if (h->files[i].fd >= 0) + close (h->files[i].fd); + } +@@ -195,7 +195,7 @@ split_close (void *handle) + struct handle *h = handle; + size_t i; + +- for (i = 0; i < filenames.size; ++i) ++ for (i = 0; i < filenames.len; ++i) + close (h->files[i].fd); + free (h->files); + free (h); +@@ -242,7 +242,7 @@ static struct file * + get_file (struct handle *h, uint64_t offset) + { + return bsearch (&offset, h->files, +- filenames.size, sizeof (struct file), ++ filenames.len, sizeof (struct file), + compare_offset); + } + +diff --git a/plugins/ssh/ssh.c b/plugins/ssh/ssh.c +index 535caf1a..80623525 100644 +--- a/plugins/ssh/ssh.c ++++ b/plugins/ssh/ssh.c +@@ -397,7 +397,7 @@ ssh_open (int readonly) + * as this file is rarely present. + */ + } +- for (i = 0; i < identities.size; ++i) { ++ for (i = 0; i < identities.len; ++i) { + r = ssh_options_set (h->session, + SSH_OPTIONS_ADD_IDENTITY, identities.ptr[i]); + if (r != SSH_OK) { +diff --git a/plugins/vddk/reexec.c b/plugins/vddk/reexec.c +index 9e87025e..4eae2221 100644 +--- a/plugins/vddk/reexec.c ++++ b/plugins/vddk/reexec.c +@@ -116,20 +116,20 @@ perform_reexec (const char *env, const char *prepend) + nbdkit_error ("realloc: %m"); + exit (EXIT_FAILURE); + } +- r = read (fd, buf.ptr + buf.size, buf.cap - buf.size); ++ r = read (fd, buf.ptr + buf.len, buf.cap - buf.len); + if (r == -1) { + nbdkit_error ("read: %s: %m", cmdline_file); + exit (EXIT_FAILURE); + } + if (r == 0) + break; +- buf.size += r; ++ buf.len += r; + } + close (fd); +- nbdkit_debug ("original command line occupies %zu bytes", buf.size); ++ nbdkit_debug ("original command line occupies %zu bytes", buf.len); + + /* Split cmdline into argv, then append one more arg. */ +- for (len = 0; len < buf.size; len += strlen (buf.ptr + len) + 1) { ++ for (len = 0; len < buf.len; len += strlen (buf.ptr + len) + 1) { + char *arg = buf.ptr + len; /* Next \0-terminated argument. */ + + /* See below for why we eat password parameter(s). */ +diff --git a/plugins/vddk/stats.c b/plugins/vddk/stats.c +index 76e0c244..bb5401b1 100644 +--- a/plugins/vddk/stats.c ++++ b/plugins/vddk/stats.c +@@ -94,12 +94,12 @@ display_stats (void) + #undef STUB + #undef OPTIONAL_STUB + +- qsort (stats.ptr, stats.size, sizeof stats.ptr[0], stat_compare); ++ qsort (stats.ptr, stats.len, sizeof stats.ptr[0], stat_compare); + + nbdkit_debug ("VDDK function stats (-D vddk.stats=1):"); + nbdkit_debug ("%-24s %15s %5s %15s", + "VixDiskLib_...", "µs", "calls", "bytes"); +- for (i = 0; i < stats.size; ++i) { ++ for (i = 0; i < stats.len; ++i) { + if (stats.ptr[i].usecs) { + if (stats.ptr[i].bytes > 0) + nbdkit_debug (" %-22s %15" PRIi64 " %5" PRIu64 " %15" PRIu64, +diff --git a/plugins/vddk/worker.c b/plugins/vddk/worker.c +index 2a1d4f26..c6e2fd22 100644 +--- a/plugins/vddk/worker.c ++++ b/plugins/vddk/worker.c +@@ -82,7 +82,7 @@ send_command_and_wait (struct vddk_handle *h, struct command *cmd) + return -1; + + /* Signal the caller if it could be sleeping on an empty queue. */ +- if (h->commands.size == 1) ++ if (h->commands.len == 1) + pthread_cond_signal (&h->commands_cond); + + /* This will be used to signal command completion back to us. */ +@@ -497,7 +497,7 @@ vddk_worker_thread (void *handle) + /* Wait until we are sent at least one command. */ + { + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->commands_lock); +- while (h->commands.size == 0) ++ while (h->commands.len == 0) + pthread_cond_wait (&h->commands_cond, &h->commands_lock); + cmd = h->commands.ptr[0]; + command_queue_remove (&h->commands, 0); +diff --git a/server/exports.c b/server/exports.c +index 7ce1eda9..12c8a879 100644 +--- a/server/exports.c ++++ b/server/exports.c +@@ -90,13 +90,13 @@ nbdkit_exports_free (struct nbdkit_exports *exps) + NBDKIT_DLL_PUBLIC size_t + nbdkit_exports_count (const struct nbdkit_exports *exps) + { +- return exps->exports.size; ++ return exps->exports.len; + } + + NBDKIT_DLL_PUBLIC const struct nbdkit_export + nbdkit_get_export (const struct nbdkit_exports *exps, size_t i) + { +- assert (i < exps->exports.size); ++ assert (i < exps->exports.len); + return exps->exports.ptr[i]; + } + +@@ -106,7 +106,7 @@ nbdkit_add_export (struct nbdkit_exports *exps, + { + struct nbdkit_export e = { NULL, NULL }; + +- if (exps->exports.size == MAX_EXPORTS) { ++ if (exps->exports.len == MAX_EXPORTS) { + nbdkit_error ("nbdkit_add_export: too many exports"); + errno = EINVAL; + return -1; +diff --git a/server/extents.c b/server/extents.c +index 8da82cf1..e180e313 100644 +--- a/server/extents.c ++++ b/server/extents.c +@@ -117,13 +117,13 @@ nbdkit_extents_free (struct nbdkit_extents *exts) + NBDKIT_DLL_PUBLIC size_t + nbdkit_extents_count (const struct nbdkit_extents *exts) + { +- return exts->extents.size; ++ return exts->extents.len; + } + + NBDKIT_DLL_PUBLIC struct nbdkit_extent + nbdkit_get_extent (const struct nbdkit_extents *exts, size_t i) + { +- assert (i < exts->extents.size); ++ assert (i < exts->extents.len); + return exts->extents.ptr[i]; + } + +@@ -160,7 +160,7 @@ nbdkit_add_extent (struct nbdkit_extents *exts, + return 0; + + /* Ignore extents beyond the end of the range, or if list is full. */ +- if (offset >= exts->end || exts->extents.size >= MAX_EXTENTS) ++ if (offset >= exts->end || exts->extents.len >= MAX_EXTENTS) + return 0; + + /* Shorten extents that overlap the end of the range. */ +@@ -169,7 +169,7 @@ nbdkit_add_extent (struct nbdkit_extents *exts, + length -= overlap; + } + +- if (exts->extents.size == 0) { ++ if (exts->extents.len == 0) { + /* If there are no existing extents, and the new extent is + * entirely before start, ignore it. + */ +@@ -196,10 +196,10 @@ nbdkit_add_extent (struct nbdkit_extents *exts, + } + + /* If we get here we are going to either add or extend. */ +- if (exts->extents.size > 0 && +- exts->extents.ptr[exts->extents.size-1].type == type) { ++ if (exts->extents.len > 0 && ++ exts->extents.ptr[exts->extents.len-1].type == type) { + /* Coalesce with the last extent. */ +- exts->extents.ptr[exts->extents.size-1].length += length; ++ exts->extents.ptr[exts->extents.len-1].length += length; + return 0; + } + else { +@@ -226,13 +226,13 @@ nbdkit_extents_aligned (struct context *next_c, + /* Perform an initial query, then scan for the first unaligned extent. */ + if (next->extents (next_c, count, offset, flags, exts, err) == -1) + return -1; +- for (i = 0; i < exts->extents.size; ++i) { ++ for (i = 0; i < exts->extents.len; ++i) { + e = &exts->extents.ptr[i]; + if (!IS_ALIGNED(e->length, align)) { + /* If the unalignment is past align, just truncate and return early */ + if (e->offset + e->length > offset + align) { + e->length = ROUND_DOWN (e->length, align); +- exts->extents.size = i + !!e->length; ++ exts->extents.len = i + !!e->length; + exts->next = e->offset + e->length; + break; + } +@@ -249,7 +249,7 @@ nbdkit_extents_aligned (struct context *next_c, + */ + assert (i == 0); + while (e->length < align) { +- if (exts->extents.size > 1) { ++ if (exts->extents.len > 1) { + e->length += exts->extents.ptr[1].length; + e->type &= exts->extents.ptr[1].type; + extents_remove (&exts->extents, 1); +@@ -284,7 +284,7 @@ nbdkit_extents_aligned (struct context *next_c, + } + } + e->length = align; +- exts->extents.size = 1; ++ exts->extents.len = 1; + exts->next = e->offset + e->length; + break; + } +diff --git a/server/main.c b/server/main.c +index 5fd8308f..225258de 100644 +--- a/server/main.c ++++ b/server/main.c +@@ -940,7 +940,7 @@ start_serving (void) + r = sockets_append (&socks, s); + assert (r == 0); + } +- debug ("using socket activation, nr_socks = %zu", socks.size); ++ debug ("using socket activation, nr_socks = %zu", socks.len); + change_user (); + write_pidfile (); + top->after_fork (top); +diff --git a/server/sockets.c b/server/sockets.c +index 95fce484..f13f8600 100644 +--- a/server/sockets.c ++++ b/server/sockets.c +@@ -246,14 +246,14 @@ bind_tcpip_socket (sockets *socks) + + freeaddrinfo (ai); + +- if (socks->size == 0 && addr_in_use) { ++ if (socks->len == 0 && addr_in_use) { + fprintf (stderr, "%s: unable to bind to any sockets: %s\n", + program_name, strerror (EADDRINUSE)); + exit (EXIT_FAILURE); + } + + debug ("bound to IP address %s:%s (%zu socket(s))", +- ipaddr ? ipaddr : "", port, socks->size); ++ ipaddr ? ipaddr : "", port, socks->len); + } + + void +@@ -443,7 +443,7 @@ accept_connection (int listen_sock) + static void + check_sockets_and_quit_fd (const sockets *socks) + { +- const size_t nr_socks = socks->size; ++ const size_t nr_socks = socks->len; + size_t i; + int r; + +@@ -552,7 +552,7 @@ accept_incoming_connections (const sockets *socks) + } + pthread_mutex_unlock (&count_mutex); + +- for (i = 0; i < socks->size; ++i) ++ for (i = 0; i < socks->len; ++i) + closesocket (socks->ptr[i]); + free (socks->ptr); + } +diff --git a/wrapper.c b/wrapper.c +index 3bab2074..87e5a033 100644 +--- a/wrapper.c ++++ b/wrapper.c +@@ -130,9 +130,9 @@ print_command (void) + { + size_t i; + +- if (cmd.size > 0) ++ if (cmd.len > 0) + shell_quote (cmd.ptr[0], stderr); +- for (i = 1; i < cmd.size && cmd.ptr[i] != NULL; ++i) { ++ for (i = 1; i < cmd.len && cmd.ptr[i] != NULL; ++i) { + fputc (' ', stderr); + shell_quote (cmd.ptr[i], stderr); + } +-- +2.31.1 + diff --git a/0023-podwrapper.pl.in-Use-short-commit-date.patch b/0023-podwrapper.pl.in-Use-short-commit-date.patch new file mode 100644 index 0000000..e4b16de --- /dev/null +++ b/0023-podwrapper.pl.in-Use-short-commit-date.patch @@ -0,0 +1,32 @@ +From ece6d7e1a5827de17e86a20f7dae5f6f853d419b Mon Sep 17 00:00:00 2001 +From: Nir Soffer +Date: Mon, 8 Nov 2021 19:47:57 +0200 +Subject: [PATCH] podwrapper.pl.in: Use short commit date + +We can use git short commit date format $cs. Maybe it was not available +when podwrapper.pl was created. + +Signed-off-by: Nir Soffer +(cherry picked from libnbd commit 0306fdcb08e8dc5957a9e344b54200711fca1220) +(cherry picked from commit 7a1e79c6b5ca4adcef47fc0929d25d54610fc417) +--- + podwrapper.pl.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/podwrapper.pl.in b/podwrapper.pl.in +index abad578d..63c1025a 100755 +--- a/podwrapper.pl.in ++++ b/podwrapper.pl.in +@@ -233,8 +233,7 @@ my $date; + my $filename = "$abs_top_srcdir/.git"; + if (!$date && -d $filename) { + local $ENV{GIT_DIR} = $filename; +- $_ = `git show -O/dev/null -s --format=%ci`; +- $date = $1 if /^(\d+-\d+-\d+)\s/; ++ $date = `git show -O/dev/null -s --format=%cs`; + } + if (!$date) { + my ($day, $month, $year) = (gmtime($ENV{SOURCE_DATE_EPOCH} || time))[3,4,5]; +-- +2.31.1 + diff --git a/0024-ocaml-Replace-noalloc-with-noalloc-annotation.patch b/0024-ocaml-Replace-noalloc-with-noalloc-annotation.patch new file mode 100644 index 0000000..983c610 --- /dev/null +++ b/0024-ocaml-Replace-noalloc-with-noalloc-annotation.patch @@ -0,0 +1,92 @@ +From 2955179919fc6233427b82d27ae61755b2b5e3d7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 9 Nov 2021 09:07:42 +0000 +Subject: [PATCH] ocaml: Replace "noalloc" with [@@noalloc] annotation + +This requires OCaml >= 4.03 (released April 2016). The previous +minimum version was 4.02.2. + +(cherry picked from commit d15dd73845065cc9ca04aa785e2be994f76bf832) +--- + README | 2 +- + plugins/ocaml/NBDKit.ml | 18 +++++++++--------- + plugins/ocaml/nbdkit-ocaml-plugin.pod | 5 +---- + 3 files changed, 11 insertions(+), 14 deletions(-) + +diff --git a/README b/README +index b001620c..160856b6 100644 +--- a/README ++++ b/README +@@ -155,7 +155,7 @@ For the Python plugin: + + For the OCaml plugin: + +- - OCaml >= 4.02.2 ++ - OCaml >= 4.03 + + For the Tcl plugin: + +diff --git a/plugins/ocaml/NBDKit.ml b/plugins/ocaml/NBDKit.ml +index ecdc00c1..c9ce31b5 100644 +--- a/plugins/ocaml/NBDKit.ml ++++ b/plugins/ocaml/NBDKit.ml +@@ -152,13 +152,13 @@ let default_callbacks = { + export_description = None; + } + +-external set_name : string -> unit = "ocaml_nbdkit_set_name" "noalloc" +-external set_longname : string -> unit = "ocaml_nbdkit_set_longname" "noalloc" +-external set_version : string -> unit = "ocaml_nbdkit_set_version" "noalloc" +-external set_description : string -> unit = "ocaml_nbdkit_set_description" "noalloc" +-external set_config_help : string -> unit = "ocaml_nbdkit_set_config_help" "noalloc" ++external set_name : string -> unit = "ocaml_nbdkit_set_name" [@@noalloc] ++external set_longname : string -> unit = "ocaml_nbdkit_set_longname" [@@noalloc] ++external set_version : string -> unit = "ocaml_nbdkit_set_version" [@@noalloc] ++external set_description : string -> unit = "ocaml_nbdkit_set_description" [@@noalloc] ++external set_config_help : string -> unit = "ocaml_nbdkit_set_config_help" [@@noalloc] + +-external set_field : string -> 'a -> unit = "ocaml_nbdkit_set_field" "noalloc" ++external set_field : string -> 'a -> unit = "ocaml_nbdkit_set_field" [@@noalloc] + + let register_plugin plugin = + (* Check the required fields have been set by the caller. *) +@@ -220,7 +220,7 @@ let register_plugin plugin = + + (* Bindings to nbdkit server functions. *) + +-external _set_error : int -> unit = "ocaml_nbdkit_set_error" "noalloc" ++external _set_error : int -> unit = "ocaml_nbdkit_set_error" [@@noalloc] + + let set_error unix_error = + (* There's an awkward triple translation going on here, because +@@ -250,9 +250,9 @@ external read_password : string -> string = "ocaml_nbdkit_read_password" + external realpath : string -> string = "ocaml_nbdkit_realpath" + external nanosleep : int -> int -> unit = "ocaml_nbdkit_nanosleep" + external export_name : unit -> string = "ocaml_nbdkit_export_name" +-external shutdown : unit -> unit = "ocaml_nbdkit_shutdown" "noalloc" ++external shutdown : unit -> unit = "ocaml_nbdkit_shutdown" [@@noalloc] + +-external _debug : string -> unit = "ocaml_nbdkit_debug" "noalloc" ++external _debug : string -> unit = "ocaml_nbdkit_debug" [@@noalloc] + + let debug fs = + ksprintf _debug fs +diff --git a/plugins/ocaml/nbdkit-ocaml-plugin.pod b/plugins/ocaml/nbdkit-ocaml-plugin.pod +index 2bd0af25..293f8143 100644 +--- a/plugins/ocaml/nbdkit-ocaml-plugin.pod ++++ b/plugins/ocaml/nbdkit-ocaml-plugin.pod +@@ -11,10 +11,7 @@ nbdkit-ocaml-plugin - writing nbdkit plugins in OCaml + =head1 DESCRIPTION + + This manual page describes how to write nbdkit plugins in natively +-compiled OCaml code. +- +-Note this requires OCaml E 4.02.2, which has support for shared +-libraries. See L ++compiled OCaml code. This requires OCaml E 4.03. + + =head1 WRITING AN OCAML NBDKIT PLUGIN + +-- +2.31.1 + diff --git a/nbdkit.spec b/nbdkit.spec index 7556ce8..815a753 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -50,8 +50,8 @@ ExclusiveArch: x86_64 %global source_directory 1.28-stable Name: nbdkit -Version: 1.28.1 -Release: 2%{?dist} +Version: 1.28.2 +Release: 1%{?dist} Summary: NBD server License: BSD @@ -76,32 +76,30 @@ Source3: copy-patches.sh # https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-9.0/ # Patches. -Patch0001: 0001-Skip-vsock-related-checks-if-AF_VSOCK-is-not-support.patch -Patch0002: 0002-vddk-Update-comment-about-VixDiskLib_PrepareForAcces.patch -Patch0003: 0003-vddk-Document-what-I-found-about-VixDiskLib_Flush.patch -Patch0004: 0004-vddk-Note-that-we-have-tested-VDDK-7.0.3.patch -Patch0005: 0005-tests-vddk-Cannot-test-real-VDDK-under-valgrind.patch -Patch0006: 0006-tests-test-vddk-real.sh-Don-t-hide-log-messages-on-f.patch -Patch0007: 0007-vddk-Small-copyedits-to-README.VDDK.patch -Patch0008: 0008-vddk-Fix-man-page-section-in-help-output.patch -Patch0009: 0009-vddk-Refactor-how-D-vddk.stats-1-is-collected.patch -Patch0010: 0010-vddk-Extend-D-vddk.stats-1-to-show-number-of-calls-a.patch -Patch0011: 0011-vddk-Simplify-and-consolidate-VDDK_CALL_START-END-ma.patch -Patch0012: 0012-vddk-Document-troubleshooting-performance-problems.patch -Patch0013: 0013-vddk-Include-VDDK-major-library-version-in-dump-plug.patch -Patch0014: 0014-vddk-Add-logical-and-physical-sector-size-to-D-vddk..patch -Patch0015: 0015-vddk-Fix-typo-in-debug-message.patch -Patch0016: 0016-vddk-Only-print-vddk_library_version-when-we-managed.patch -Patch0017: 0017-vddk-Print-one-line-in-dump-plugin-output-for-each-V.patch -Patch0018: 0018-vddk-Move-minimum-version-to-VDDK-6.5.patch -Patch0019: 0019-vddk-Add-read-write-and-wait-asynchronous-functions.patch -Patch0020: 0020-vddk-Start-to-split-VDDK-over-several-files.patch -Patch0021: 0021-vddk-Refactor-D-vddk.stats-1-into-a-new-file.patch -Patch0022: 0022-vddk-Implement-parallel-thread-model.patch -Patch0023: 0023-vddk-Assume-that-VixDiskLib_Flush-is-available.patch -Patch0024: 0024-vddk-Simplify-detection-of-VDDK-symbols-and-baseline.patch -Patch0025: 0025-vddk-Remove-some-whitespace-from-a-couple-of-functio.patch -Patch0026: 0026-vddk-Move-config-debug-error-and-utility-functions-a.patch +Patch0001: 0001-vddk-Refactor-how-D-vddk.stats-1-is-collected.patch +Patch0002: 0002-vddk-Extend-D-vddk.stats-1-to-show-number-of-calls-a.patch +Patch0003: 0003-vddk-Simplify-and-consolidate-VDDK_CALL_START-END-ma.patch +Patch0004: 0004-vddk-Document-troubleshooting-performance-problems.patch +Patch0005: 0005-vddk-Include-VDDK-major-library-version-in-dump-plug.patch +Patch0006: 0006-vddk-Add-logical-and-physical-sector-size-to-D-vddk..patch +Patch0007: 0007-vddk-Fix-typo-in-debug-message.patch +Patch0008: 0008-vddk-Only-print-vddk_library_version-when-we-managed.patch +Patch0009: 0009-vddk-Print-one-line-in-dump-plugin-output-for-each-V.patch +Patch0010: 0010-vddk-Move-minimum-version-to-VDDK-6.5.patch +Patch0011: 0011-vddk-Add-read-write-and-wait-asynchronous-functions.patch +Patch0012: 0012-vddk-Start-to-split-VDDK-over-several-files.patch +Patch0013: 0013-vddk-Refactor-D-vddk.stats-1-into-a-new-file.patch +Patch0014: 0014-vddk-Implement-parallel-thread-model.patch +Patch0015: 0015-vddk-Assume-that-VixDiskLib_Flush-is-available.patch +Patch0016: 0016-vddk-Simplify-detection-of-VDDK-symbols-and-baseline.patch +Patch0017: 0017-vddk-Remove-some-whitespace-from-a-couple-of-functio.patch +Patch0018: 0018-vddk-Move-config-debug-error-and-utility-functions-a.patch +Patch0019: 0019-common-utils-test-vector.c-Add-vector-benchmarks.patch +Patch0020: 0020-common-urils-vector.c-Optimize-vector-append.patch +Patch0021: 0021-common-utils-vector-Rename-alloc-to-cap.patch +Patch0022: 0022-common-utils-vector-Rename-size-to-len.patch +Patch0023: 0023-podwrapper.pl.in-Use-short-commit-date.patch +Patch0024: 0024-ocaml-Replace-noalloc-with-noalloc-annotation.patch BuildRequires: make %if 0%{patches_touch_autotools} @@ -127,7 +125,7 @@ BuildRequires: libnbd-devel >= 1.3.11 BuildRequires: libssh-devel BuildRequires: e2fsprogs, e2fsprogs-devel %if !0%{?rhel} -BuildRequires: genisoimage +BuildRequires: xorriso BuildRequires: rb_libtorrent-devel %endif BuildRequires: bash-completion @@ -219,16 +217,18 @@ reading the nbdkit(1) and nbdkit-plugin(3) manual pages. %package server Summary: The %{name} server License: BSD - +Provides: %{name}-null-plugin = %{version}-%{release} %description server -This package contains the %{name} server with no plugins or filters. +This package contains the %{name} server with only the null plugin +and no filters. To install a basic set of plugins and filters you +need to install "nbdkit-basic-plugins", "nbdkit-basic-filters" or +the metapackage "nbdkit". %package basic-plugins Summary: Basic plugins for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} Provides: %{name}-data-plugin = %{version}-%{release} Provides: %{name}-eval-plugin = %{version}-%{release} @@ -237,7 +237,6 @@ Provides: %{name}-floppy-plugin = %{version}-%{release} Provides: %{name}-full-plugin = %{version}-%{release} Provides: %{name}-info-plugin = %{version}-%{release} Provides: %{name}-memory-plugin = %{version}-%{release} -Provides: %{name}-null-plugin = %{version}-%{release} Provides: %{name}-ondemand-plugin = %{version}-%{release} Provides: %{name}-pattern-plugin = %{version}-%{release} Provides: %{name}-partitioning-plugin = %{version}-%{release} @@ -267,8 +266,6 @@ nbdkit-info-plugin Serve client and server information. nbdkit-memory-plugin A virtual memory plugin. -nbdkit-null-plugin A null (bitbucket) plugin. - nbdkit-ondemand-plugin Create filesystems on demand. nbdkit-pattern-plugin Fixed test pattern. @@ -289,14 +286,12 @@ nbdkit-zero-plugin Zero-length plugin for testing. %package example-plugins Summary: Example plugins for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} %if !0%{?rhel} # example4 is written in Perl. Requires: %{name}-perl-plugin %endif - %description example-plugins This package contains example plugins for %{name}. @@ -308,12 +303,10 @@ This package contains example plugins for %{name}. %package cc-plugin Summary: Write small inline C plugins and scripts for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: gcc Requires: %{_bindir}/cat - %description cc-plugin This package contains support for writing inline C plugins and scripts for %{name}. NOTE this is NOT the right package for writing plugins @@ -325,12 +318,10 @@ in C, install %{name}-devel for that. %package cdi-plugin Summary: Containerized Data Import plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: jq Requires: podman - %description cdi-plugin This package contains Containerized Data Import support for %{name}. %endif @@ -339,10 +330,8 @@ This package contains Containerized Data Import support for %{name}. %package curl-plugin Summary: HTTP/FTP (cURL) plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description curl-plugin This package contains cURL (HTTP/FTP) support for %{name}. @@ -351,10 +340,8 @@ This package contains cURL (HTTP/FTP) support for %{name}. %package guestfs-plugin Summary: libguestfs plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description guestfs-plugin This package is a libguestfs plugin for %{name}. %endif @@ -364,10 +351,8 @@ This package is a libguestfs plugin for %{name}. %package iso-plugin Summary: Virtual ISO 9660 plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} -Requires: genisoimage - +Requires: xorriso %description iso-plugin This package is a virtual ISO 9660 (CD-ROM) plugin for %{name}. @@ -378,10 +363,8 @@ This package is a virtual ISO 9660 (CD-ROM) plugin for %{name}. %package libvirt-plugin Summary: Libvirt plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description libvirt-plugin This package is a libvirt plugin for %{name}. It lets you access libvirt guest disks readonly. It is implemented using the libvirt @@ -392,12 +375,10 @@ virDomainBlockPeek API. %package linuxdisk-plugin Summary: Virtual Linux disk plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} # for mke2fs Requires: e2fsprogs - %description linuxdisk-plugin This package is a virtual Linux disk plugin for %{name}. @@ -406,10 +387,8 @@ This package is a virtual Linux disk plugin for %{name}. %package lua-plugin Summary: Lua plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description lua-plugin This package lets you write Lua plugins for %{name}. %endif @@ -418,10 +397,8 @@ This package lets you write Lua plugins for %{name}. %package nbd-plugin Summary: NBD proxy / forward plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description nbd-plugin This package lets you forward NBD connections from %{name} to another NBD server. @@ -431,10 +408,8 @@ to another NBD server. %package ocaml-plugin Summary: OCaml plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description ocaml-plugin This package lets you run OCaml plugins for %{name}. @@ -445,11 +420,9 @@ To compile OCaml plugins you will also need to install %package ocaml-plugin-devel Summary: OCaml development environment for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: %{name}-ocaml-plugin%{?_isa} = %{version}-%{release} - %description ocaml-plugin-devel This package lets you write OCaml plugins for %{name}. %endif @@ -459,10 +432,8 @@ This package lets you write OCaml plugins for %{name}. %package perl-plugin Summary: Perl plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description perl-plugin This package lets you write Perl plugins for %{name}. %endif @@ -471,10 +442,8 @@ This package lets you write Perl plugins for %{name}. %package python-plugin Summary: Python 3 plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description python-plugin This package lets you write Python 3 plugins for %{name}. @@ -483,10 +452,8 @@ This package lets you write Python 3 plugins for %{name}. %package ruby-plugin Summary: Ruby plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description ruby-plugin This package lets you write Ruby plugins for %{name}. %endif @@ -498,12 +465,10 @@ This package lets you write Ruby plugins for %{name}. %package S3-plugin Summary: Amazon S3 and Ceph plugin for %{name} License: BSD - Requires: %{name}-python-plugin >= 1.22 # XXX Should not need to add this. Requires: python3-boto3 - %description S3-plugin This package lets you open disk images stored in Amazon S3 or Ceph using %{name}. @@ -513,10 +478,8 @@ or Ceph using %{name}. %package ssh-plugin Summary: SSH plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description ssh-plugin This package contains SSH support for %{name}. @@ -525,10 +488,8 @@ This package contains SSH support for %{name}. %package tcl-plugin Summary: Tcl plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description tcl-plugin This package lets you write Tcl plugins for %{name}. %endif @@ -537,7 +498,6 @@ This package lets you write Tcl plugins for %{name}. %package tmpdisk-plugin Summary: Remote temporary filesystem disk plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} # For mkfs and mke2fs (defaults). Requires: util-linux, e2fsprogs @@ -547,7 +507,6 @@ Suggests: xfsprogs Suggests: ntfsprogs, dosfstools %endif - %description tmpdisk-plugin This package is a remote temporary filesystem disk plugin for %{name}. @@ -556,10 +515,8 @@ This package is a remote temporary filesystem disk plugin for %{name}. %package torrent-plugin Summary: BitTorrent plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description torrent-plugin This package is a BitTorrent plugin for %{name}. %endif @@ -569,12 +526,10 @@ This package is a BitTorrent plugin for %{name}. %package vddk-plugin Summary: VMware VDDK plugin for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} # https://bugzilla.redhat.com/show_bug.cgi?id=1931818 Requires: libxcrypt-compat - %description vddk-plugin This package is a plugin for %{name} which connects to VMware VDDK for accessing VMware disks and servers. @@ -584,7 +539,6 @@ VMware VDDK for accessing VMware disks and servers. %package basic-filters Summary: Basic filters for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} Provides: %{name}-blocksize-filter = %{version}-%{release} Provides: %{name}-cache-filter = %{version}-%{release} @@ -619,7 +573,6 @@ Provides: %{name}-swab-filter = %{version}-%{release} Provides: %{name}-tls-fallback-filter = %{version}-%{release} Provides: %{name}-truncate-filter = %{version}-%{release} - %description basic-filters This package contains filters for %{name} which only depend on simple C libraries: glibc, gnutls. Other filters for nbdkit with more @@ -694,10 +647,8 @@ nbdkit-truncate-filter Truncate, expand, round up or round down size. %package ext2-filter Summary: ext2, ext3 and ext4 filesystem support for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description ext2-filter This package contains ext2, ext3 and ext4 filesystem support for %{name}. @@ -707,10 +658,8 @@ This package contains ext2, ext3 and ext4 filesystem support for %package gzip-filter Summary: GZip filter for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description gzip-filter This package is a gzip filter for %{name}. @@ -718,13 +667,10 @@ This package is a gzip filter for %{name}. %package tar-filter Summary: Tar archive filter for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: tar - Obsoletes: %{name}-tar-plugin < 1.23.9-3 - %description tar-filter This package is a tar archive filter for %{name}. @@ -732,10 +678,8 @@ This package is a tar archive filter for %{name}. %package xz-filter Summary: XZ filter for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} - %description xz-filter This package is the xz filter for %{name}. @@ -743,11 +687,9 @@ This package is the xz filter for %{name}. %package devel Summary: Development files and documentation for %{name} License: BSD - Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: pkgconfig - %description devel This package contains development files and documentation for %{name}. Install this package if you want to develop @@ -760,7 +702,6 @@ BuildArch: noarch Requires: bash-completion >= 2.0 Requires: %{name}-server = %{version}-%{release} - %description bash-completion Install this package if you want intelligent bash tab-completion for %{name}. @@ -909,11 +850,13 @@ export LIBGUESTFS_TRACE=1 %{_sbindir}/nbdkit %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/plugins +%{_libdir}/%{name}/plugins/nbdkit-null-plugin.so %dir %{_libdir}/%{name}/filters %{_mandir}/man1/nbdkit.1* %{_mandir}/man1/nbdkit-captive.1* %{_mandir}/man1/nbdkit-client.1* %{_mandir}/man1/nbdkit-loop.1* +%{_mandir}/man1/nbdkit-null-plugin.1* %{_mandir}/man1/nbdkit-probing.1* %{_mandir}/man1/nbdkit-protocol.1* %{_mandir}/man1/nbdkit-service.1* @@ -931,7 +874,6 @@ export LIBGUESTFS_TRACE=1 %{_libdir}/%{name}/plugins/nbdkit-full-plugin.so %{_libdir}/%{name}/plugins/nbdkit-info-plugin.so %{_libdir}/%{name}/plugins/nbdkit-memory-plugin.so -%{_libdir}/%{name}/plugins/nbdkit-null-plugin.so %{_libdir}/%{name}/plugins/nbdkit-ondemand-plugin.so %{_libdir}/%{name}/plugins/nbdkit-partitioning-plugin.so %{_libdir}/%{name}/plugins/nbdkit-pattern-plugin.so @@ -947,7 +889,6 @@ export LIBGUESTFS_TRACE=1 %{_mandir}/man1/nbdkit-full-plugin.1* %{_mandir}/man1/nbdkit-info-plugin.1* %{_mandir}/man1/nbdkit-memory-plugin.1* -%{_mandir}/man1/nbdkit-null-plugin.1* %{_mandir}/man1/nbdkit-ondemand-plugin.1* %{_mandir}/man1/nbdkit-partitioning-plugin.1* %{_mandir}/man1/nbdkit-pattern-plugin.1* @@ -1272,11 +1213,15 @@ export LIBGUESTFS_TRACE=1 %changelog -* Sat Oct 30 2021 Richard W.M. Jones - 1.28.1-2 +* Tue Nov 09 2021 Richard W.M. Jones - 1.28.2-1 +- Move nbdkit-null-plugin to nbdkit-server package + resolves: rhbz#2021154 - Add asynchronous support in nbdkit-vddk-plugin resolves: rhbz#2018463 -- Rebase to new stable branch version 1.28.0 +- Rebase to new stable branch version 1.28.2 resolves: rhbz#2011709 +- Switch to xorriso (instead of genisoimage) +- Distribute README.VDDK in nbdkit-vddk-plugin subpackage * Thu Aug 19 2021 Richard W.M. Jones - 1.26.5-1 - Rebase along stable branch to 1.26.5 diff --git a/sources b/sources index 40fcfb6..8da0698 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.28.1.tar.gz) = 058b50b6674cb6af0ca24b200919423852eacdf80d04913f2d2680575292078644b39c8bdf2f9f3c7fa31f4aefbcc31f3c736d3e9fc4753e74e6701321bc4cab -SHA512 (nbdkit-1.28.1.tar.gz.sig) = b69409503dd3b40e1f160ec98b599207158b42549fae4be9f1db79d512633b34b41e7229249a4c6d09b2b9bee38d57c232e78564fc43d0d6e37fd786c3ddda0d +SHA512 (nbdkit-1.28.2.tar.gz) = 6ce0971415ee8bb1754c66f95d3897619a7fcf87246af9eda902faf047b834caca61731ca20ae2f47efc302926c6674802177a58c2236f9b1084645d1f4611d2 +SHA512 (nbdkit-1.28.2.tar.gz.sig) = d624813814dc0ebcd895630387d3d72365970faae0b6afcf5d42ac0dda8ab11669731c36795f75c8777460888881dd2005b1693bd967c1aae1b76581f16d7c33