From 08ddafd5a24e4704f0a91846ff507a103ba0b683 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Thu, 28 Mar 2024 11:13:05 +0000 Subject: [PATCH] import CS nbdkit-1.36.2-1.el9 --- .gitignore | 2 +- .nbdkit.metadata | 2 +- ...itialization-from-incompatible-point.patch | 44 + ...ct.c-Skip-if-exit-with-parent-is-not.patch | 33 - ...work-documentation-for-dir-parameter.patch | 58 + ...it-with-parent-in-the-test-framework.patch | 70 - ...when-referencing-dir-option-from-dir.patch | 28 + ...-and-paste-error-in-the-documentatio.patch | 26 - ...it-protocol.pod-Fix-manual-page-name.patch | 26 - ...ework-documentation-of-dir-parameter.patch | 108 + ...arkup-for-linking-to-other-man-pages.patch | 29 + ...int-operation-we-are-retrying-in-deb.patch | 110 - ...call-nbdkit_error-twice-on-error-pat.patch | 30 + ...-errorcodes.c-Don-t-use-assert-in-te.patch | 53 - ...ggest-alternate-partition-sectorsize.patch | 52 + ...-errorcodes.c-Enable-verbose-message.patch | 30 - ...8-curl-Use-the-parallel-thread-model.patch | 80 - SOURCES/0009-curl-Add-ipresolve-option.patch | 115 - SOURCES/0010-curl-Add-resolve-option.patch | 113 - ...stract-load_pool-and-unload_pool-fun.patch | 82 - ...l.times-1-to-collect-time-statistics.patch | 278 --- .../0013-curl-Fix-call-to-update_times.patch | 34 - ...onfiguration-code-to-a-separate-file.patch | 2075 ----------------- ...e-times-seconds-field-slightly-wider.patch | 53 - ...omic-type-to-accumulate-curl-timings.patch | 51 - ...verbose.ids-1-to-display-conn-and-xf.patch | 120 - ...ad_config-unload_pool-config_unload-.patch | 85 - ...e-get_ready-and-after_fork-functions.patch | 96 - ...-Do-pool_unload-before-config_unload.patch | 36 - ...low-get_size-operation-to-be-retried.patch | 52 - ...-request-mirror.c-Don-t-assume-state.patch | 42 - .../0023-curl-Use-curl-multi-interface.patch | 1279 ---------- ...nnections-N-parameter-as-number-of-H.patch | 139 -- ...-curl-Disable-this-plugin-on-Windows.patch | 57 - SOURCES/copy-patches.sh | 2 +- SOURCES/nbdkit-1.34.2.tar.gz.sig | 17 - SOURCES/nbdkit-1.36.2.tar.gz.sig | 17 + SPECS/nbdkit.spec | 124 +- 38 files changed, 426 insertions(+), 5222 deletions(-) create mode 100644 SOURCES/0001-configure-Fix-initialization-from-incompatible-point.patch delete mode 100644 SOURCES/0001-tests-test-connect.c-Skip-if-exit-with-parent-is-not.patch create mode 100644 SOURCES/0002-file-Rework-documentation-for-dir-parameter.patch delete mode 100644 SOURCES/0002-tests-Use-exit-with-parent-in-the-test-framework.patch create mode 100644 SOURCES/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch delete mode 100644 SOURCES/0003-protect-Fix-copy-and-paste-error-in-the-documentatio.patch delete mode 100644 SOURCES/0004-docs-nbdkit-protocol.pod-Fix-manual-page-name.patch create mode 100644 SOURCES/0004-file-Further-rework-documentation-of-dir-parameter.patch create mode 100644 SOURCES/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch delete mode 100644 SOURCES/0005-retry-request-Print-operation-we-are-retrying-in-deb.patch create mode 100644 SOURCES/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch delete mode 100644 SOURCES/0006-tests-test-ocaml-errorcodes.c-Don-t-use-assert-in-te.patch create mode 100644 SOURCES/0007-partition-Suggest-alternate-partition-sectorsize.patch delete mode 100644 SOURCES/0007-tests-test-ocaml-errorcodes.c-Enable-verbose-message.patch delete mode 100644 SOURCES/0008-curl-Use-the-parallel-thread-model.patch delete mode 100644 SOURCES/0009-curl-Add-ipresolve-option.patch delete mode 100644 SOURCES/0010-curl-Add-resolve-option.patch delete mode 100644 SOURCES/0011-curl-pool-Add-abstract-load_pool-and-unload_pool-fun.patch delete mode 100644 SOURCES/0012-curl-Add-D-curl.times-1-to-collect-time-statistics.patch delete mode 100644 SOURCES/0013-curl-Fix-call-to-update_times.patch delete mode 100644 SOURCES/0014-curl-Move-configuration-code-to-a-separate-file.patch delete mode 100644 SOURCES/0015-curl-Make-times-seconds-field-slightly-wider.patch delete mode 100644 SOURCES/0016-curl-Use-_Atomic-type-to-accumulate-curl-timings.patch delete mode 100644 SOURCES/0017-curl-Add-D-curl.verbose.ids-1-to-display-conn-and-xf.patch delete mode 100644 SOURCES/0018-curl-Rename-unload_config-unload_pool-config_unload-.patch delete mode 100644 SOURCES/0019-pool-Add-outline-get_ready-and-after_fork-functions.patch delete mode 100644 SOURCES/0020-curl-Do-pool_unload-before-config_unload.patch delete mode 100644 SOURCES/0021-retry-request-Allow-get_size-operation-to-be-retried.patch delete mode 100644 SOURCES/0022-tests-test-retry-request-mirror.c-Don-t-assume-state.patch delete mode 100644 SOURCES/0023-curl-Use-curl-multi-interface.patch delete mode 100644 SOURCES/0024-curl-Redefine-connections-N-parameter-as-number-of-H.patch delete mode 100644 SOURCES/0025-curl-Disable-this-plugin-on-Windows.patch delete mode 100644 SOURCES/nbdkit-1.34.2.tar.gz.sig create mode 100644 SOURCES/nbdkit-1.36.2.tar.gz.sig diff --git a/.gitignore b/.gitignore index 5d9b836..409e0a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ SOURCES/libguestfs.keyring -SOURCES/nbdkit-1.34.2.tar.gz +SOURCES/nbdkit-1.36.2.tar.gz diff --git a/.nbdkit.metadata b/.nbdkit.metadata index 49bfebd..6653ce4 100644 --- a/.nbdkit.metadata +++ b/.nbdkit.metadata @@ -1,2 +1,2 @@ cc1b37b9cfafa515aab3eefd345ecc59aac2ce7b SOURCES/libguestfs.keyring -d1c190dcfe1e601e0eeb4862c49df45c7052955b SOURCES/nbdkit-1.34.2.tar.gz +ca7c103dc96a65bfa5f6263bb5df8478f8038948 SOURCES/nbdkit-1.36.2.tar.gz diff --git a/SOURCES/0001-configure-Fix-initialization-from-incompatible-point.patch b/SOURCES/0001-configure-Fix-initialization-from-incompatible-point.patch new file mode 100644 index 0000000..77863d5 --- /dev/null +++ b/SOURCES/0001-configure-Fix-initialization-from-incompatible-point.patch @@ -0,0 +1,44 @@ +From ac87babe2d1652e3f37715efe9f29ad6f16eb9df Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 4 Dec 2023 10:23:29 +0000 +Subject: [PATCH] configure: Fix initialization from incompatible pointer type + +With GCC 14: + + configure:20816: checking if environ is declared in header files + configure:20833: gcc -c -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grec +ord-gcc-switches -pipe -Wall -Werror=format-security +-Werror=implicit-function-declaration -Werror=implicit-int +-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS +-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong +-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic +-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection +-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer conftest.c >&5 + conftest.c: In function 'test': + conftest.c:62:22: error: initialization of 'const char **' from incompatible p +ointer type 'char **' + 62 | const char **env = environ; + | ^~~~~~~ + +Thanks: Florian Weimer +(cherry picked from commit 32a9ee6650654469cd591a3ae26842c54f898392) +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 3b12e357..beab4674 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -335,7 +335,7 @@ AC_LANG_SOURCE([[ + static int + test (void) + { +- const char **env = environ; ++ char **env = environ; + return env ? 1 : 0; // this just forces env to be used + } + ]]) +-- +2.39.3 + diff --git a/SOURCES/0001-tests-test-connect.c-Skip-if-exit-with-parent-is-not.patch b/SOURCES/0001-tests-test-connect.c-Skip-if-exit-with-parent-is-not.patch deleted file mode 100644 index 8acd9c9..0000000 --- a/SOURCES/0001-tests-test-connect.c-Skip-if-exit-with-parent-is-not.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 41775572a5beb8ae49287271af31264684b2bbe3 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 21 Jul 2023 19:00:31 +0100 -Subject: [PATCH] tests/test-connect.c: Skip if --exit-with-parent is not - supported - -Fixes: commit 933d7401ff623077ba43b4ef1e7f16a7864c5fde -(cherry picked from commit 59664b8b146edcba0353de628528e0a2035b3ba7) ---- - tests/test-connect.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/tests/test-connect.c b/tests/test-connect.c -index f463415b..d7118330 100644 ---- a/tests/test-connect.c -+++ b/tests/test-connect.c -@@ -47,6 +47,13 @@ main (int argc, char *argv[]) - struct nbd_handle *nbd; - int64_t size; - -+ if (system ("nbdkit --exit-with-parent --version") != 0) { -+ printf ("%s: --exit-with-parent is not implemented on this platform, " -+ "skipping\n", -+ argv[0]); -+ exit (77); -+ } -+ - nbd = nbd_create (); - if (nbd == NULL) { - fprintf (stderr, "%s\n", nbd_get_error ()); --- -2.39.3 - diff --git a/SOURCES/0002-file-Rework-documentation-for-dir-parameter.patch b/SOURCES/0002-file-Rework-documentation-for-dir-parameter.patch new file mode 100644 index 0000000..c368250 --- /dev/null +++ b/SOURCES/0002-file-Rework-documentation-for-dir-parameter.patch @@ -0,0 +1,58 @@ +From 054798ca11b9f0b71fbad302edf66b52519f5aa2 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 14 Dec 2023 17:47:10 +0000 +Subject: [PATCH] file: Rework documentation for dir= parameter + +The existing documentation tended towards jargon and lacked examples. + +(cherry picked from commit 7cbd49ced6414e49fcf4ff1a967929a2b83ab44e) +--- + plugins/file/nbdkit-file-plugin.pod | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index 857ad21e..e47eae97 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -64,13 +64,23 @@ symbolic links. Other special files in the directory (such as + subdirectories, pipes, or Unix sockets) are ignored. + + When this mode is used, the file to be served is chosen by the export +-name passed by the client, where the client can request a list of +-available exports using NBD_OPT_LIST. A client that requests the +-default export (C<"">) will be rejected. However, you can use +-L to adjust what export names the client +-sees or uses as a default. For security, when using directory mode, ++name passed by the client. For security, when using directory mode, + this plugin will not accept export names containing slash (C). + ++To list exports, use L I<--list> option, for example: ++ ++ nbdinfo --list nbd://localhost ++ ++An NBD client can request a list of available exports using ++C. ++ ++A client that requests the default export (C<"">) will be rejected. ++However, you can use L to adjust what ++export names the client sees, and which one the client uses as a ++default. For example to make F be the default export: ++ ++ nbdkit file dir=/dir --filter=exportname default-export=file ++ + =item BFILE_DESCRIPTOR + + (nbdkit E 1.34, not Windows) +@@ -262,7 +272,8 @@ L, + L, + L, + L, +-L. ++L, ++L. + + =head1 AUTHORS + +-- +2.39.3 + diff --git a/SOURCES/0002-tests-Use-exit-with-parent-in-the-test-framework.patch b/SOURCES/0002-tests-Use-exit-with-parent-in-the-test-framework.patch deleted file mode 100644 index 367eddb..0000000 --- a/SOURCES/0002-tests-Use-exit-with-parent-in-the-test-framework.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 93a2c7321dc5ccd36368d50887cf239cfb883a72 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 21 Jul 2023 19:01:35 +0100 -Subject: [PATCH] tests: Use --exit-with-parent in the test framework - -Make sure nbdkit always exits, in case some other part of the test is -killed. - -(cherry picked from commit c6299889e80217cfadf488a67961be9eb6d24e38) ---- - tests/Makefile.am | 2 ++ - tests/test.c | 22 +++++++++++++--------- - 2 files changed, 15 insertions(+), 9 deletions(-) - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index e1087689..f6c5ac9a 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -594,6 +594,8 @@ EXTRA_DIST += \ - check_LTLIBRARIES += libtest.la - libtest_la_SOURCES = test.c test.h - libtest_la_CFLAGS = $(WARNINGS_CFLAGS) -+libtest_la_CPPFLAGS = -I$(top_srcdir)/common/utils -+libtest_la_LIBADD = $(top_builddir)/common/utils/libutils.la - - # Basic connection test. - LIBNBD_TESTS += test-connect -diff --git a/tests/test.c b/tests/test.c -index 67f69fab..6be10f12 100644 ---- a/tests/test.c -+++ b/tests/test.c -@@ -50,6 +50,8 @@ - #include - #endif - -+#include "exit-with-parent.h" -+ - #include "test.h" - - #ifndef WIN32 -@@ -161,15 +163,17 @@ test_start_nbdkit (const char *arg, ...) - const char *argv[MAX_ARGS+1]; - va_list args; - -- argv[0] = "nbdkit"; -- argv[1] = "-U"; -- argv[2] = kit->sockpath; -- argv[3] = "-P"; -- argv[4] = kit->pidpath; -- argv[5] = "-f"; -- argv[6] = "-v"; -- argv[7] = arg; -- i = 8; -+ i = 0; -+ argv[i++] = "nbdkit"; -+ argv[i++] = "-U"; -+ argv[i++] = kit->sockpath; -+ argv[i++] = "-P"; -+ argv[i++] = kit->pidpath; -+ argv[i++] = "-f"; -+ argv[i++] = "-v"; -+ if (can_exit_with_parent ()) -+ argv[i++] = "--exit-with-parent"; -+ argv[i++] = arg; - - va_start (args, arg); - while ((p = va_arg (args, const char *)) != NULL) { --- -2.39.3 - diff --git a/SOURCES/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch b/SOURCES/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch new file mode 100644 index 0000000..56610e5 --- /dev/null +++ b/SOURCES/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch @@ -0,0 +1,28 @@ +From 596f97316e65c151741e6ee42893023f6e945c01 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:08:37 +0000 +Subject: [PATCH] file: Fix markup when referencing dir= option from dirfd= + docs + +Fixes: commit dd28b005430d020ccd1825437937c317332d3007 +(cherry picked from commit 5b8c9c49cc352e9b0fba4dde9e0f57c53c9c2457) +--- + plugins/file/nbdkit-file-plugin.pod | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index e47eae97..5feb8ea9 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -85,7 +85,7 @@ default. For example to make F be the default export: + + (nbdkit E 1.34, not Windows) + +-This is like the I option, but instead of specifying the ++This is like the C option, but instead of specifying the + directory by name, the parent process should open the directory and + pass this file descriptor by inheritance to nbdkit. + +-- +2.39.3 + diff --git a/SOURCES/0003-protect-Fix-copy-and-paste-error-in-the-documentatio.patch b/SOURCES/0003-protect-Fix-copy-and-paste-error-in-the-documentatio.patch deleted file mode 100644 index 41608e4..0000000 --- a/SOURCES/0003-protect-Fix-copy-and-paste-error-in-the-documentatio.patch +++ /dev/null @@ -1,26 +0,0 @@ -From e3a62ebad571d6512501941c49f7a8ab66ef5646 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 22 Jul 2023 09:50:44 +0100 -Subject: [PATCH] protect: Fix copy and paste error in the documentation - -(cherry picked from commit f04607c95c27c4342f41d083ad00ac02c579b391) ---- - filters/protect/nbdkit-protect-filter.pod | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/filters/protect/nbdkit-protect-filter.pod b/filters/protect/nbdkit-protect-filter.pod -index b5ffc7ca..aad72a68 100644 ---- a/filters/protect/nbdkit-protect-filter.pod -+++ b/filters/protect/nbdkit-protect-filter.pod -@@ -102,7 +102,7 @@ Use C to find the location of C<$filterdir>. - - =head1 VERSION - --C first appeared in nbdkit 1.30. -+C first appeared in nbdkit 1.30. - - =head1 SEE ALSO - --- -2.39.3 - diff --git a/SOURCES/0004-docs-nbdkit-protocol.pod-Fix-manual-page-name.patch b/SOURCES/0004-docs-nbdkit-protocol.pod-Fix-manual-page-name.patch deleted file mode 100644 index f568fc9..0000000 --- a/SOURCES/0004-docs-nbdkit-protocol.pod-Fix-manual-page-name.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c6da52fd3d9a9e5e8ad4648bba686c37b5d3fae7 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sun, 23 Jul 2023 20:15:23 +0100 -Subject: [PATCH] docs/nbdkit-protocol.pod: Fix manual page name - -Updates: commit dce32051318c3e8bd20825cc0db5df15f95d11fa -(cherry picked from commit 00aa248cec0a64ca293bbedffbf47426ee2b2340) ---- - docs/nbdkit-protocol.pod | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/docs/nbdkit-protocol.pod b/docs/nbdkit-protocol.pod -index 7e89a607..dabdf23c 100644 ---- a/docs/nbdkit-protocol.pod -+++ b/docs/nbdkit-protocol.pod -@@ -1,6 +1,6 @@ - =head1 NAME - --nbdkit - which parts of the NBD protocol nbdkit supports -+nbdkit-protocol - which parts of the NBD protocol nbdkit supports - - =head1 SYNOPSIS - --- -2.39.3 - diff --git a/SOURCES/0004-file-Further-rework-documentation-of-dir-parameter.patch b/SOURCES/0004-file-Further-rework-documentation-of-dir-parameter.patch new file mode 100644 index 0000000..88fc6e8 --- /dev/null +++ b/SOURCES/0004-file-Further-rework-documentation-of-dir-parameter.patch @@ -0,0 +1,108 @@ +From 0d080223a8567a5ef673deb6ac49152fd67dd1b7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:03:13 +0000 +Subject: [PATCH] file: Further rework documentation of dir= parameter + +Move the documentation to a new section, allowing us to expand on this +topic. This also makes the HTML documentation linkable. + +Updates: commit 7cbd49ced6414e49fcf4ff1a967929a2b83ab44e +(cherry picked from commit 74621ec608d0edd76c2d8de140e7d1d5626c8251) +--- + plugins/file/nbdkit-file-plugin.pod | 66 +++++++++++++++++++++-------- + 1 file changed, 49 insertions(+), 17 deletions(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index 5feb8ea9..de8fbeba 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -63,23 +63,7 @@ directory named C, including those found by following + symbolic links. Other special files in the directory (such as + subdirectories, pipes, or Unix sockets) are ignored. + +-When this mode is used, the file to be served is chosen by the export +-name passed by the client. For security, when using directory mode, +-this plugin will not accept export names containing slash (C). +- +-To list exports, use L I<--list> option, for example: +- +- nbdinfo --list nbd://localhost +- +-An NBD client can request a list of available exports using +-C. +- +-A client that requests the default export (C<"">) will be rejected. +-However, you can use L to adjust what +-export names the client sees, and which one the client uses as a +-default. For example to make F be the default export: +- +- nbdkit file dir=/dir --filter=exportname default-export=file ++See L below. + + =item BFILE_DESCRIPTOR + +@@ -89,6 +73,8 @@ This is like the C option, but instead of specifying the + directory by name, the parent process should open the directory and + pass this file descriptor by inheritance to nbdkit. + ++See L below. ++ + =item B + + =item B +@@ -140,6 +126,52 @@ L (or C) you can serve all regular ++files and block devices located directly inside the directory named ++C, including those found by following symbolic links. ++Other special files in the directory (such as subdirectories, pipes, ++or Unix sockets) are ignored. ++ ++When this mode is used, the file to be served is chosen by the export ++name passed by the client. For security, when using directory mode, ++this plugin will not accept export names containing slash (C). ++ ++For example: ++ ++ $ ls -l /var/tmp/exports ++ total 0 ++ -rw-r--r--. 1 rjones rjones 1048576 Dec 14 15:34 disk1 ++ -rw-r--r--. 1 rjones rjones 2097152 Dec 14 15:34 disk2 ++ lrwxrwxrwx. 1 rjones rjones 9 Dec 14 15:35 sda1 -> /dev/sda1 ++ $ nbdkit file dir=/var/tmp/exports ++ ++will serve three exports called C<"disk1">, C<"disk2"> and C<"sda1">. ++The first two are regular files and the last is a block device. You ++can add or remove files or symbolic links from the directory while ++nbdkit is running. ++ ++To list exports, use L I<--list> option, for example: ++ ++ $ nbdinfo --list nbd://localhost ++ protocol: newstyle-fixed without TLS, using structured packets ++ export="disk1": ++ export-size: 1048576 (1M) ++ uri: nbd://localhost:10809/disk1 ++ [etc] ++ ++An NBD client can request a list of available exports using ++C. For libnbd clients see nbd_opt_list(3). ++ ++A client that requests the default export (C<"">) will be rejected. ++However, you can use L to adjust the ++default export as well as other transformations of export names. For ++example to make F be the default export: ++ ++ nbdkit file dir=/var/tmp/exports \ ++ --filter=exportname default-export=disk1 ++ + =head2 Optimizing for random or sequential access + + If you know in advance that the NBD client will access the file +-- +2.39.3 + diff --git a/SOURCES/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch b/SOURCES/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch new file mode 100644 index 0000000..3c2c4f2 --- /dev/null +++ b/SOURCES/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch @@ -0,0 +1,29 @@ +From c155987ee521c2d6a163d2814dc869ec1e89fd90 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:32:50 +0000 +Subject: [PATCH] exportname: Fix markup for linking to other man pages + +Fixes: commit 7623b2cc45078cca88fdd2d96c70c7f82a0db49d +(cherry picked from commit 6104f55f3851f3b82dc69f7e78c32e9c7a93dbc9) +--- + filters/exportname/nbdkit-exportname-filter.pod | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/filters/exportname/nbdkit-exportname-filter.pod b/filters/exportname/nbdkit-exportname-filter.pod +index 1d69f7d4..f95a37be 100644 +--- a/filters/exportname/nbdkit-exportname-filter.pod ++++ b/filters/exportname/nbdkit-exportname-filter.pod +@@ -10,8 +10,8 @@ nbdkit-exportname-filter - adjust export names between client and plugin + + =head1 DESCRIPTION + +-Some plugins (such as C and filters (such as +-C are able to serve different content based on ++Some plugins (such as L and filters (such as ++L are able to serve different content based on + the export name requested by the client. The NBD protocol allows a + server to advertise the set of export names it is serving. However, + the list advertised (or absent) from the plugin may not always match +-- +2.39.3 + diff --git a/SOURCES/0005-retry-request-Print-operation-we-are-retrying-in-deb.patch b/SOURCES/0005-retry-request-Print-operation-we-are-retrying-in-deb.patch deleted file mode 100644 index 0ff2d65..0000000 --- a/SOURCES/0005-retry-request-Print-operation-we-are-retrying-in-deb.patch +++ /dev/null @@ -1,110 +0,0 @@ -From e206e3a645ee6d350df210d2ef95614d3f5d97e7 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 28 Jul 2023 16:43:07 +0100 -Subject: [PATCH] retry-request: Print operation we are retrying in debug - messages - -Reviewed-by: Eric Blake -(cherry picked from commit dbc91fd2eac5eac77293e3deded92e11c0b8d6e3) ---- - filters/retry-request/retry-request.c | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/filters/retry-request/retry-request.c b/filters/retry-request/retry-request.c -index ed566080..e5b8344c 100644 ---- a/filters/retry-request/retry-request.c -+++ b/filters/retry-request/retry-request.c -@@ -100,15 +100,15 @@ retry_request_config (nbdkit_next_config *next, nbdkit_backend *nxdata, - * The code between RETRY_START...RETRY_END must set r to 0 or -1 on - * success or failure. *err may also be implicitly assigned. - */ --#define RETRY_START \ -+#define RETRY_START(what) \ - { \ - unsigned i; \ - \ - r = -1; \ - for (i = 0; r == -1 && i <= retries; ++i) { \ - if (i > 0) { \ -- nbdkit_debug ("retry %u: waiting %u seconds before retrying", \ -- i, delay); \ -+ nbdkit_debug ("retry %u: waiting %u seconds before retrying %s",\ -+ i, delay, what); \ - if (nbdkit_nanosleep (delay, 0) == -1) { \ - if (*err == 0) \ - *err = errno; \ -@@ -130,7 +130,7 @@ retry_request_open (nbdkit_next_open *next, nbdkit_context *nxdata, - if (retry_open_call) { - int *err = &errno; /* used by the RETRY_* macros */ - -- RETRY_START -+ RETRY_START("open") - r = next (nxdata, readonly, exportname); - RETRY_END; - } -@@ -148,7 +148,7 @@ retry_request_pread (nbdkit_next *next, - { - int r; - -- RETRY_START -+ RETRY_START("pread") - r = next->pread (next, buf, count, offset, flags, err); - RETRY_END; - return r; -@@ -162,7 +162,7 @@ retry_request_pwrite (nbdkit_next *next, - { - int r; - -- RETRY_START -+ RETRY_START("pwrite") - r = next->pwrite (next, buf, count, offset, flags, err); - RETRY_END; - return r; -@@ -176,7 +176,7 @@ retry_request_trim (nbdkit_next *next, - { - int r; - -- RETRY_START -+ RETRY_START("trim") - r = next->trim (next, count, offset, flags, err); - RETRY_END; - return r; -@@ -189,7 +189,7 @@ retry_request_flush (nbdkit_next *next, - { - int r; - -- RETRY_START -+ RETRY_START("flush") - r = next->flush (next, flags, err); - RETRY_END; - return r; -@@ -203,7 +203,7 @@ retry_request_zero (nbdkit_next *next, - { - int r; - -- RETRY_START -+ RETRY_START("zero") - r = next->zero (next, count, offset, flags, err); - RETRY_END; - return r; -@@ -218,7 +218,7 @@ retry_request_extents (nbdkit_next *next, - CLEANUP_EXTENTS_FREE struct nbdkit_extents *extents2 = NULL; - int r; - -- RETRY_START { -+ RETRY_START("extents") { - /* Each retry must begin with extents reset to the right beginning. */ - nbdkit_extents_free (extents2); - extents2 = nbdkit_extents_new (offset, next->get_size (next)); -@@ -254,7 +254,7 @@ retry_request_cache (nbdkit_next *next, - { - int r; - -- RETRY_START -+ RETRY_START("cache") - r = next->cache (next, count, offset, flags, err); - RETRY_END; - return r; --- -2.39.3 - diff --git a/SOURCES/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch b/SOURCES/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch new file mode 100644 index 0000000..9127c68 --- /dev/null +++ b/SOURCES/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch @@ -0,0 +1,30 @@ +From b8eb91e9102a2ae6cb96b0f2ffdb96b724cbb1b7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 20 Dec 2023 10:38:27 +0000 +Subject: [PATCH] partition: Don't call nbdkit_error twice on error path + +Fixes: commit 7b9301a4c569456a4f96784229a2cd48e8957662 +(cherry picked from commit 036b178a4affd00b8bbdb6cb140e81b62f57a374) +--- + filters/partition/partition-gpt.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/filters/partition/partition-gpt.c b/filters/partition/partition-gpt.c +index 80acddb4..930e2081 100644 +--- a/filters/partition/partition-gpt.c ++++ b/filters/partition/partition-gpt.c +@@ -92,10 +92,8 @@ find_gpt_partition (nbdkit_next *next, + int err; + + if (get_gpt_header (header_bytes, +- &nr_partition_entries, &size_partition_entry) == -1) { +- nbdkit_error ("cannot support non-standard GPT header"); ++ &nr_partition_entries, &size_partition_entry) == -1) + return -1; +- } + + if (partnum > nr_partition_entries) { + nbdkit_error ("GPT partition number out of range"); +-- +2.39.3 + diff --git a/SOURCES/0006-tests-test-ocaml-errorcodes.c-Don-t-use-assert-in-te.patch b/SOURCES/0006-tests-test-ocaml-errorcodes.c-Don-t-use-assert-in-te.patch deleted file mode 100644 index 64f4dcd..0000000 --- a/SOURCES/0006-tests-test-ocaml-errorcodes.c-Don-t-use-assert-in-te.patch +++ /dev/null @@ -1,53 +0,0 @@ -From fdd27622047cd8e25af33b66a57899b75e99db82 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 1 Aug 2023 11:42:58 +0100 -Subject: [PATCH] tests/test-ocaml-errorcodes.c: Don't use assert in test - -exit with EXIT_FAILURE instead, as the program might be compiled with --DNDEBUG. - -(cherry picked from commit 678410e23841376d8b742dce3d10c632499367a2) ---- - tests/test-ocaml-errorcodes.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/tests/test-ocaml-errorcodes.c b/tests/test-ocaml-errorcodes.c -index e59f074b..8ab7e0ae 100644 ---- a/tests/test-ocaml-errorcodes.c -+++ b/tests/test-ocaml-errorcodes.c -@@ -34,8 +34,9 @@ - - #include - #include -+#include -+#include - #include --#include - - #include - -@@ -84,10 +85,19 @@ main (int argc, char *argv[]) - exit (EXIT_FAILURE); - } - -- assert (nbd_pread (nbd, buf, 512, 0, 0) == 0); -+ if (nbd_pread (nbd, buf, 512, 0, 0) == -1) { -+ fprintf (stderr, "%s: FAIL: did not expect reading sector 0 to fail\n", -+ argv[0]); -+ exit (EXIT_FAILURE); -+ } - - for (i = 0; tests[i].offset != 0; ++i) { -- assert (nbd_pread (nbd, buf, 512, tests[i].offset, 0) == -1); -+ if (nbd_pread (nbd, buf, 512, tests[i].offset, 0) != -1) { -+ fprintf (stderr, -+ "%s: FAIL: reading sector %" PRIu64 "should have failed\n", -+ argv[0], tests[i].offset / 512); -+ exit (EXIT_FAILURE); -+ } - actual_errno = nbd_get_errno (); - if (actual_errno != tests[i].expected_errno) { - fprintf (stderr, "%s: FAIL: actual errno = %d expected errno = %d\n", --- -2.39.3 - diff --git a/SOURCES/0007-partition-Suggest-alternate-partition-sectorsize.patch b/SOURCES/0007-partition-Suggest-alternate-partition-sectorsize.patch new file mode 100644 index 0000000..4b8a01c --- /dev/null +++ b/SOURCES/0007-partition-Suggest-alternate-partition-sectorsize.patch @@ -0,0 +1,52 @@ +From 3b168aa842dc80a6d95b2c1ccb52a8ef664e7aba Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 20 Dec 2023 10:34:10 +0000 +Subject: [PATCH] partition: Suggest alternate partition-sectorsize + +When we reach this error it means that we have failed to detect the +"EFI PART" signature (indicating GPT) and we've fallen back to parsing +MBR, but in doing so we have discovered a GPT protective MBR which +should only happen for GPT. A possible cause for missing the +signature was because we have the wrong sector size. + +Therefore check for the current sector size (which should be either +512 or 4096) and suggest that the user sets the other sector size. + +Also avoids the case where the user already set partition-sectorsize=4k +and we were suggesting that they set it again. + +Reported-by: Ming Xie +Fixes: commit 7b9301a4c569456a4f96784229a2cd48e8957662 +Fixes: https://issues.redhat.com/browse/RHEL-19815 +(cherry picked from commit cd761c9bf770b23f678fd82f0d1c8d4cce2ed1b5) +--- + filters/partition/partition-mbr.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/filters/partition/partition-mbr.c b/filters/partition/partition-mbr.c +index 3927c31f..6a81addb 100644 +--- a/filters/partition/partition-mbr.c ++++ b/filters/partition/partition-mbr.c +@@ -87,9 +87,16 @@ find_mbr_partition (nbdkit_next *next, + !is_extended (partition.part_type_byte) && + partnum == i+1) { + if (partition.part_type_byte == 0xEE) { +- nbdkit_error ("rejecting GPT protective entry from MBR, " +- "if the underlying storage uses 4K sectors " +- "try using partition-sectorsize=4k"); ++ if (sector_size == 512) ++ nbdkit_error ("rejecting GPT protective entry from MBR, " ++ "if the underlying storage uses 4K sectors " ++ "try using partition-sectorsize=4k"); ++ else if (sector_size == 4096) ++ nbdkit_error ("rejecting GPT protective entry from MBR, " ++ "if the underlying storage uses 512 byte sectors " ++ "try using partition-sectorsize=512"); ++ else ++ nbdkit_error ("rejecting GPT protective entry from MBR"); + return -1; + } + *offset_r = partition.start_sector * (int64_t) sector_size; +-- +2.39.3 + diff --git a/SOURCES/0007-tests-test-ocaml-errorcodes.c-Enable-verbose-message.patch b/SOURCES/0007-tests-test-ocaml-errorcodes.c-Enable-verbose-message.patch deleted file mode 100644 index 2f54ddd..0000000 --- a/SOURCES/0007-tests-test-ocaml-errorcodes.c-Enable-verbose-message.patch +++ /dev/null @@ -1,30 +0,0 @@ -From eca5131cbbc7e1785b266cc92624a2ce9582a7cc Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 1 Aug 2023 12:42:05 +0100 -Subject: [PATCH] tests/test-ocaml-errorcodes.c: Enable verbose messages - -This test crashes when the OCaml plugin is unloaded (specifically when -we call caml_acquire_runtime_system). Enable verbose messages in a -failed attempt to track down what is happening. - -(cherry picked from commit 99567408fdd8ea55b0bb5286b45ce135d91c38b5) ---- - tests/test-ocaml-errorcodes.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/test-ocaml-errorcodes.c b/tests/test-ocaml-errorcodes.c -index 8ab7e0ae..f84da3d8 100644 ---- a/tests/test-ocaml-errorcodes.c -+++ b/tests/test-ocaml-errorcodes.c -@@ -78,7 +78,7 @@ main (int argc, char *argv[]) - - if (nbd_connect_command (nbd, - (char *[]) { -- "nbdkit", "-s", "--exit-with-parent", -+ "nbdkit", "-s", "--exit-with-parent", "-v", - "./test-ocaml-errorcodes-plugin.so", - NULL }) == -1) { - fprintf (stderr, "%s\n", nbd_get_error ()); --- -2.39.3 - diff --git a/SOURCES/0008-curl-Use-the-parallel-thread-model.patch b/SOURCES/0008-curl-Use-the-parallel-thread-model.patch deleted file mode 100644 index 9a670be..0000000 --- a/SOURCES/0008-curl-Use-the-parallel-thread-model.patch +++ /dev/null @@ -1,80 +0,0 @@ -From bfa0b1238f6318d06930ec4d389a27932fc90a16 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 4 Feb 2023 12:34:57 +0000 -Subject: [PATCH] curl: Use the parallel thread model - -After previous changes, it is now safe to use the parallel thread -model in this plugin. The locking in pool.c protects a single curl -handle from being used from multiple threads. - -An advantage of this is we can now combine the curl plugin with -filters such as readahead and scan. - -This pessimizes some workloads and improves others. See my earlier -comments here: - - https://listman.redhat.com/archives/libguestfs/2023-February/030610.html - https://listman.redhat.com/archives/libguestfs/2023-February/030618.html - https://listman.redhat.com/archives/libguestfs/2023-February/030619.html - https://listman.redhat.com/archives/libguestfs/2023-February/030620.html - -Tests below use this basic command: - - $ time nbdkit -r -U - curl https://cloud.debian.org/images/cloud/bookworm/daily/latest/debian-12-generic-amd64-daily.qcow2 \ - --run '$COPY $uri /var/tmp/out' - -where $COPY is either nbdcopy or qemu-img convert. - -Before this change: - - nbdkit + nbdcopy 0m55.397s - nbdkit + qemu-img convert [over 20 minutes] - -After this change: - - nbdkit + nbdcopy 1m1.235s - nbdkit + qemu-img convert 6m3.262s - nbdkit --filter=readahead --filter=cache + qemu-img convert - 8m16.488s - nbdkit connections=8 + qemu-img convert - 3m48.502s - -Previously [see first link above] we noted that file: URLs are -impacted, and indeed they are, with this command: - - $ time nbdkit -r -U - curl file:/var/tmp/fedora-36.img \ - --run 'nbdcopy --no-extents -p "$uri" null:' - -nearly doubling in run-time (0.78 -> 1.34). However I think this may -be a peculiarity of curl's handling of file. (Use nbdkit-file-plugin -instead). - -Note the fundamental issue here is still lack of multiconn support in -qemu's NBD client. - -(cherry picked from commit f2163754860d041c4cb12dace90591c280eccae8) ---- - plugins/curl/curl.c | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/plugins/curl/curl.c b/plugins/curl/curl.c -index 58ffb662..425f1d90 100644 ---- a/plugins/curl/curl.c -+++ b/plugins/curl/curl.c -@@ -537,12 +537,7 @@ curl_close (void *handle) - free (h); - } - --/* This plugin could support the parallel thread model. It currently -- * uses serialize_requests because parallel has the unfortunate effect -- * of pessimising common workloads. See: -- * https://listman.redhat.com/archives/libguestfs/2023-February/030618.html -- */ --#define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS -+#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL - - /* Calls get_handle() ... put_handle() to get a handle for the length - * of the current scope. --- -2.39.3 - diff --git a/SOURCES/0009-curl-Add-ipresolve-option.patch b/SOURCES/0009-curl-Add-ipresolve-option.patch deleted file mode 100644 index ddcebff..0000000 --- a/SOURCES/0009-curl-Add-ipresolve-option.patch +++ /dev/null @@ -1,115 +0,0 @@ -From a5f1e659d52872a499a5744870cb3e6ff382642f Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 25 Jul 2023 16:57:41 +0100 -Subject: [PATCH] curl: Add ipresolve option - -Allows you to force IPv4 or IPv6. - -(cherry picked from commit d1b27c97f7fac00ee452a1d1b05805ee7145a49c) ---- - plugins/curl/curl.c | 15 +++++++++++++++ - plugins/curl/curldefs.h | 1 + - plugins/curl/nbdkit-curl-plugin.pod | 14 ++++++++++++++ - plugins/curl/pool.c | 2 ++ - 4 files changed, 32 insertions(+) - -diff --git a/plugins/curl/curl.c b/plugins/curl/curl.c -index 425f1d90..91fa65fb 100644 ---- a/plugins/curl/curl.c -+++ b/plugins/curl/curl.c -@@ -68,6 +68,7 @@ struct curl_slist *headers = NULL; - const char *header_script = NULL; - unsigned header_script_renew = 0; - long http_version = CURL_HTTP_VERSION_NONE; -+long ipresolve = CURL_IPRESOLVE_WHATEVER; - char *password = NULL; - #ifndef HAVE_CURLOPT_PROTOCOLS_STR - long protocols = CURLPROTO_ALL; -@@ -314,6 +315,19 @@ curl_config (const char *key, const char *value) - } - } - -+ else if (strcmp (key, "ipresolve") == 0) { -+ if (strcmp (value, "any") == 0 || strcmp (value, "whatever") == 0) -+ ipresolve = CURL_IPRESOLVE_WHATEVER; -+ else if (strcmp (value, "v4") == 0 || strcmp (value, "4") == 0) -+ ipresolve = CURL_IPRESOLVE_V4; -+ else if (strcmp (value, "v6") == 0 || strcmp (value, "6") == 0) -+ ipresolve = CURL_IPRESOLVE_V6; -+ else { -+ nbdkit_error ("unknown ipresolve: %s", value); -+ return -1; -+ } -+ } -+ - else if (strcmp (key, "password") == 0) { - free (password); - if (nbdkit_read_password (value, &password) == -1) -@@ -495,6 +509,7 @@ curl_config_complete (void) - "header-script=