Rebase to nbdkit 1.45.11

resolves: RHEL-111242
vddk: Don't use FNM_PATHNAME when matching export parameter
resolves: RHEL-122755
This commit is contained in:
Richard W.M. Jones 2025-10-20 16:35:10 +01:00
parent 419ab843ca
commit 112e900e09
5 changed files with 8 additions and 200 deletions

View File

@ -1,38 +0,0 @@
From 503d91e78231a5bdbc9e2f4238cda5d6c347bb5c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 26 Aug 2025 21:48:33 +0100
Subject: [PATCH] docs/nbdkit-probing.pod: Rearrange synopsis to match
description
---
docs/nbdkit-probing.pod | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/nbdkit-probing.pod b/docs/nbdkit-probing.pod
index 1c094b7b..070a793b 100644
--- a/docs/nbdkit-probing.pod
+++ b/docs/nbdkit-probing.pod
@@ -4,16 +4,16 @@ nbdkit-probing - how to probe for nbdkit configuration and plugins
=head1 SYNOPSIS
+ nbdkit --version
+
+=for paragraph
+
nbdkit --dump-config
=for paragraph
nbdkit PLUGIN --dump-plugin
-=for paragraph
-
- nbdkit --version
-
=for paragraph
nbdkit PLUGIN --version
--
2.47.1

View File

@ -1,107 +0,0 @@
From 7b6fb980a8cddd2c405a73d7be0967e884ab0410 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 26 Aug 2025 21:30:23 +0100
Subject: [PATCH] server: Document --long-options and --short-options
These command line options can be used to list the short (ie. single
letter) and long options supported by nbdkit. They are used
internally to implement bash completions. For example:
$ nbdkit --short-options
-4
-6
-D
-e
[etc]
Previously they were undocumented and hidden from the --help output,
and did not even appear in the output of 'nbdkit --long-options'.
However the options have been around for a long time and aren't going
anywhere, and have a well-defined interface and scoped usage, so we
can safely document them. They can also be used to find out what
options are supported by a particular build of nbdkit (see subsequent
commit).
---
docs/nbdkit.pod | 14 ++++++++++++++
docs/synopsis.txt | 10 +++++-----
server/main.c | 7 ++-----
3 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/docs/nbdkit.pod b/docs/nbdkit.pod
index 82939e88..bf6788bb 100644
--- a/docs/nbdkit.pod
+++ b/docs/nbdkit.pod
@@ -338,6 +338,13 @@ L<nbdkit_error(3)> or L<nbdkit_verror(3)>.
Debug messages (I<-v>/I<--verbose>) always go to standard error and
are never sent to the system log.
+=item B<--long-options>
+
+List the long command line options (those starting with I<-->)
+supported by this build of nbdkit. The options are listed one per
+line, and then nbdkit exits. This is used mainly to implement tab
+completion. See also I<--short-options>.
+
=item B<--mask-handshake=>MASK
This option can be used to mask off particular global features which
@@ -466,6 +473,13 @@ that the socket and filesystem labels are different.
nbdkit -U /tmp/sock --selinux-label=system_u:object_r:svirt_socket_t:s0 ...
chcon system_u:object_r:svirt_image_t:s0 /tmp/sock
+=item B<--short-options>
+
+List the short command line options (single letter options starting
+with I<->) supported by this build of nbdkit. The options are listed
+one per line, and then nbdkit exits. This is used mainly to implement
+tab completion. See also I<--long-options>.
+
=item B<-s>
=item B<--single>
diff --git a/docs/synopsis.txt b/docs/synopsis.txt
index 0d25c42d..3cc620db 100644
--- a/docs/synopsis.txt
+++ b/docs/synopsis.txt
@@ -4,14 +4,14 @@ nbdkit [-4|--ipv4-only] [-6|--ipv6-only]
[--filter=FILTER ...] [-f|--foreground]
[-g|--group GROUP] [-i|--ipaddr IPADDR] [--keepalive]
[--log=default|stderr|syslog|null|/path]
- [--mask-handshake=MASK] [--name=NAME] [-n|--newstyle]
- [--no-mc|--no-meta-contexts]
+ [--long-options] [--mask-handshake=MASK] [--name=NAME]
+ [-n|--newstyle] [--no-mc|--no-meta-contexts]
[--no-sr|--no-structured-replies] [-o|--oldstyle]
[-P|--pidfile PIDFILE] [-p|--port PORT] [--print-uri]
[-r|--readonly] [--run 'COMMAND ARGS ...']
- [--selinux-label=LABEL] [-s|--single] [--swap]
- [-t|--threads THREADS] [--timeout=TIMEOUT]
- [--tls=off|on|require]
+ [--selinux-label=LABEL] [--short-options]
+ [-s|--single] [--swap] [-t|--threads THREADS]
+ [--timeout=TIMEOUT] [--tls=off|on|require]
[--tls-certificates=/path/to/certificates]
[--tls-psk=/path/to/pskfile] [--tls-verify-peer]
[-U|--unix SOCKET|-] [-u|--user USER]
diff --git a/server/main.c b/server/main.c
index 91e3172b..ad0e5abe 100644
--- a/server/main.c
+++ b/server/main.c
@@ -404,11 +404,8 @@ main (int argc, char *argv[])
break;
case LONG_OPTIONS_OPTION:
- for (i = 0; long_options[i].name != NULL; ++i) {
- if (strcmp (long_options[i].name, "long-options") != 0 &&
- strcmp (long_options[i].name, "short-options") != 0)
- printf ("--%s\n", long_options[i].name);
- }
+ for (i = 0; long_options[i].name != NULL; ++i)
+ printf ("--%s\n", long_options[i].name);
cleanup_random_fifo ();
exit (EXIT_SUCCESS);
--
2.47.1

View File

@ -1,47 +0,0 @@
From 8788b177b342e9f713ed87864e8fed333c8252e6 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 26 Aug 2025 21:45:09 +0100
Subject: [PATCH] docs: Document how to probe for server command line options
Virt-v2v has started to use this method to probe for the new --name
option, so we should document the method.
---
docs/nbdkit-probing.pod | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/docs/nbdkit-probing.pod b/docs/nbdkit-probing.pod
index 070a793b..8ce506e0 100644
--- a/docs/nbdkit-probing.pod
+++ b/docs/nbdkit-probing.pod
@@ -10,6 +10,12 @@ nbdkit-probing - how to probe for nbdkit configuration and plugins
nbdkit --dump-config
+=for paragraph
+
+ nbdkit --short-options
+
+ nbdkit --long-options
+
=for paragraph
nbdkit PLUGIN --dump-plugin
@@ -76,6 +82,15 @@ earlier versions.
You can also probe the minimum version using L<pkg-config(1)>. See
L<nbdkit-plugin(3)/PKG-CONFIG/PKGCONF>.
+=head2 Find out if nbdkit implements a command line option
+
+To test if a specific single letter option (like I<-D>) or long option
+(like I<--name>) is supported by nbdkit, use:
+
+ nbdkit --short-options | grep -sq '^-D$'
+
+ nbdkit --long-options | grep -sq '^--name$'
+
=head2 Query information about a particular plugin
nbdkit pluginname --dump-plugin
--
2.47.1

View File

@ -54,7 +54,7 @@
%global source_directory 1.45-development %global source_directory 1.45-development
Name: nbdkit Name: nbdkit
Version: 1.45.7 Version: 1.45.11
Release: 1%{?dist} Release: 1%{?dist}
Summary: NBD server Summary: NBD server
@ -80,9 +80,7 @@ Source3: copy-patches.sh
# https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-10.2/ # https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-10.2/
# Patches. # Patches.
Patch0001: 0001-docs-nbdkit-probing.pod-Rearrange-synopsis-to-match-.patch #(nothing)
Patch0002: 0002-server-Document-long-options-and-short-options.patch
Patch0003: 0003-docs-Document-how-to-probe-for-server-command-line-o.patch
# For automatic RPM Provides generation. # For automatic RPM Provides generation.
# See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html # See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html
@ -1562,9 +1560,11 @@ fi
%changelog %changelog
* Fri Aug 29 2025 Richard W.M. Jones <rjones@redhat.com> - 1.45.7-1 * Mon Oct 20 2025 Richard W.M. Jones <rjones@redhat.com> - 1.45.11-1
- Rebase to nbdkit 1.45.7 - Rebase to nbdkit 1.45.11
resolves: RHEL-111242 resolves: RHEL-111242
- vddk: Don't use FNM_PATHNAME when matching export parameter
resolves: RHEL-122755
* Wed Jul 09 2025 Richard W.M. Jones <rjones@redhat.com> - 1.44.1-2 * Wed Jul 09 2025 Richard W.M. Jones <rjones@redhat.com> - 1.44.1-2
- Rebase to nbdkit 1.44.1 - Rebase to nbdkit 1.44.1

View File

@ -1,2 +1,2 @@
SHA512 (nbdkit-1.45.7.tar.gz) = 0dae8cd809e40f8a67d92e1fd49e8956873cd22037e0d68773392c75eab8357731df67afa48742849f92384edf5ec402fe4195f97ddf4045a250c584500a8448 SHA512 (nbdkit-1.45.11.tar.gz) = b9ba91cfa7e71c415bbc2cb47dd569ce327d8dd9ec28aca03788984872f0a0fd63296f963436740b504950896082c14768bd823f5605d23b63ea149f87f939f5
SHA512 (nbdkit-1.45.7.tar.gz.sig) = 2239a0a5dbc175a2b9a3d619babbd10a810d534721c84bbdc893d180d674ae5b5f383756b24a6b9fdb1ac3116f7a99e9d4818b5525e8d8ffa33a1a10d12fdccb SHA512 (nbdkit-1.45.11.tar.gz.sig) = b964604598d50c319c6f04e8cab487f215f6347588b507fdaf752ac8b0929c2e2975d793fbe1f65bf51107b5e087f5c8836589c01b81753e2dce70f9d2e73ae2