Move nbdkit-null-plugin to nbdkit-server package

resolves: rhbz#2021154
Rebase to new stable branch version 1.28.2
resolves: rhbz#2011709

Switch to xorriso (instead of genisoimage)

Upstream prefers it since:

  commit 174a0caf7eaf1943360f9d8f714f466ea7449d90
  Author: Richard W.M. Jones <rjones@redhat.com>
  Date:   Sat Apr 3 17:15:34 2021 +0100

    iso: Pick xorriso in preference to genisoimage or mkisofs.

    See this Debian page explaining the situation with genisoimage:
    https://wiki.debian.org/genisoimage

(cherry picked from commit df8ac05e24cebe463c822281b5cdc903352ed8ed)

Move nbdkit-null-plugin to the nbdkit-server package

This plugin is required for probing the presence of filters (see
nbdkit-probing(1) man page), so it makes sense to always have it
around.  The null plugin is only 16K in size so it does not add
significantly to the nbdkit-server package.

(cherry picked from commit 048b8de83c0e54418e01b3f75fc541fcf1b539e3)

Consistent use of whitespace

Remove double line whitespace between %package and %description.
Also remove whitespace lines within %package sections.

Double line whitespace is kept between subpackages for visual clarity.

(cherry picked from commit 9fbfa6cc49fb6c7d602534f4886d789ce3ef8d5c)
This commit is contained in:
Richard W.M. Jones 2021-11-09 12:48:31 +00:00
parent ceffede5b1
commit b3fb585f58
34 changed files with 2419 additions and 446 deletions

View File

@ -1,73 +0,0 @@
From 5c4dcc9ade4b2d46d69478f711bd98b14b99c3d2 Mon Sep 17 00:00:00 2001
From: Hilko Bengen <bengen@hilluzination.de>
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

View File

@ -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" <rjones@redhat.com>
Date: Thu, 21 Oct 2021 14:49:52 +0100
Subject: [PATCH] vddk: Refactor how -D vddk.stats=1 is collected

View File

@ -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" <rjones@redhat.com>
Date: Thu, 21 Oct 2021 15:10:00 +0100
Subject: [PATCH] vddk: Extend -D vddk.stats=1 to show number of calls and

View File

@ -1,31 +0,0 @@
From 98da45afe98a59a1dc783968bb3b08008a3d6a68 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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

View File

@ -1,32 +0,0 @@
From 7d72530453550a613ee311dd0f3bbbbc87165b1c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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

View File

@ -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" <rjones@redhat.com>
Date: Thu, 21 Oct 2021 22:55:17 +0100
Subject: [PATCH] vddk: Simplify and consolidate VDDK_CALL_START/END macros

View File

@ -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" <rjones@redhat.com>
Date: Fri, 22 Oct 2021 18:00:27 +0100
Subject: [PATCH] vddk: Document troubleshooting performance problems

View File

@ -1,26 +0,0 @@
From aa9fdf84c9d77f2334501777a3800ac64b494c54 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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<https://bugzilla.redhat.com/1614276>.
This plugin requires VDDK E<ge> 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<ge> 6.0 should be used if possible. This is the first version
--
2.31.1

View File

@ -1,54 +0,0 @@
From 31317e5d7c249ed318398451ab36d81b0eb5095f Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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

View File

@ -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" <rjones@redhat.com>
Date: Sat, 23 Oct 2021 16:16:39 +0100
Subject: [PATCH] vddk: Include VDDK major library version in --dump-plugin

View File

@ -1,36 +0,0 @@
From 4b69e586155d10781390a607eb346421187bd72d Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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

View File

@ -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" <rjones@redhat.com>
Date: Sat, 23 Oct 2021 16:24:27 +0100
Subject: [PATCH] vddk: Add logical and physical sector size to -D

View File

@ -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" <rjones@redhat.com>
Date: Sat, 23 Oct 2021 19:41:07 +0100
Subject: [PATCH] vddk: Fix typo in debug message

View File

@ -1,47 +0,0 @@
From 0923b0e70735139e1a548addecf6e20c567a96a0 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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

View File

@ -1,31 +0,0 @@
From 6a1d99df5750e0da071f7a246b2adea5ee297dd1 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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=]<FILENAME> (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

View File

@ -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" <rjones@redhat.com>
Date: Sat, 23 Oct 2021 19:50:52 +0100
Subject: [PATCH] vddk: Only print vddk_library_version when we managed to load

View File

@ -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" <rjones@redhat.com>
Date: Mon, 25 Oct 2021 08:36:53 +0100
Subject: [PATCH] vddk: Print one line in --dump-plugin output for each VDDK

View File

@ -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" <rjones@redhat.com>
Date: Tue, 26 Oct 2021 19:46:32 +0100
Subject: [PATCH] vddk: Move minimum version to VDDK 6.5

View File

@ -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" <rjones@redhat.com>
Date: Wed, 27 Oct 2021 11:57:35 +0100
Subject: [PATCH] vddk: Add read, write and wait asynchronous functions

View File

@ -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" <rjones@redhat.com>
Date: Wed, 27 Oct 2021 12:20:31 +0100
Subject: [PATCH] vddk: Start to split VDDK over several files

View File

@ -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" <rjones@redhat.com>
Date: Wed, 27 Oct 2021 12:30:41 +0100
Subject: [PATCH] vddk: Refactor -D vddk.stats=1 into a new file

View File

@ -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" <rjones@redhat.com>
Date: Wed, 27 Oct 2021 10:17:22 +0100
Subject: [PATCH] vddk: Implement parallel thread model

View File

@ -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" <rjones@redhat.com>
Date: Fri, 29 Oct 2021 20:56:55 +0100
Subject: [PATCH] vddk: Assume that VixDiskLib_Flush is available

View File

@ -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" <rjones@redhat.com>
Date: Fri, 29 Oct 2021 21:02:54 +0100
Subject: [PATCH] vddk: Simplify detection of VDDK symbols and baseline 6.5

View File

@ -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" <rjones@redhat.com>
Date: Sat, 30 Oct 2021 08:34:28 +0100
Subject: [PATCH] vddk: Remove some whitespace from a couple of functions

View File

@ -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" <rjones@redhat.com>
Date: Sat, 30 Oct 2021 08:27:39 +0100
Subject: [PATCH] vddk: Move config, debug/error and utility functions around

View File

@ -0,0 +1,245 @@
From 6459704cc66f5fa0a2e6fc1e199458b77327fe52 Mon Sep 17 00:00:00 2001
From: Nir Soffer <nsoffer@redhat.com>
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 <sys/time.h>
+
+#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 <assert.h>
+#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

View File

@ -0,0 +1,54 @@
From 5454ced7c8cfc2ba278c2635eecb9a5e4841e613 Mon Sep 17 00:00:00 2001
From: Nir Soffer <nsoffer@redhat.com>
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

View File

@ -0,0 +1,188 @@
From 304f180b61fa28421b9901d2173a280e633b55c2 Mon Sep 17 00:00:00 2001
From: Nir Soffer <nsoffer@redhat.com>
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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
From ece6d7e1a5827de17e86a20f7dae5f6f853d419b Mon Sep 17 00:00:00 2001
From: Nir Soffer <nsoffer@redhat.com>
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 <nsoffer@redhat.com>
(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

View File

@ -0,0 +1,92 @@
From 2955179919fc6233427b82d27ae61755b2b5e3d7 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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<ge> 4.02.2, which has support for shared
-libraries. See L<http://caml.inria.fr/mantis/view.php?id=6693>
+compiled OCaml code. This requires OCaml E<ge> 4.03.
=head1 WRITING AN OCAML NBDKIT PLUGIN
--
2.31.1

View File

@ -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 <rjones@redhat.com> - 1.28.1-2
* Tue Nov 09 2021 Richard W.M. Jones <rjones@redhat.com> - 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 <rjones@redhat.com> - 1.26.5-1
- Rebase along stable branch to 1.26.5

View File

@ -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