Rather than changing captive nbdkit to export variables by default
(where we don't know if it will break clients of --run to suddenly
have more things in their environment variables), it is less invasive
to just call attention in our documentation that a run script that
relies on the environment must manually export variables.

Signed-off-by: Eric Blake <ebl...@redhat.com>
---
 docs/nbdkit-captive.pod  | 7 ++++++-
 docs/nbdkit-protocol.pod | 4 ++++
 docs/nbdkit.pod          | 2 ++
 server/options.h         | 1 +
 tests/test-synopsis.sh   | 1 +
 5 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/docs/nbdkit-captive.pod b/docs/nbdkit-captive.pod
index 4f9740bc..94a9acb2 100644
--- a/docs/nbdkit-captive.pod
+++ b/docs/nbdkit-captive.pod
@@ -48,7 +48,12 @@ Running nbdkit captive under nbdsh for unit testing:

  nbdkit memory 1 --run 'nbdsh -u "$uri" -c "print(h.pread(1, 0))"'

-The following shell variables are available in the I<--run> argument:
+Running an fio benchmark:
+
+ nbdkit -f null 1G --run 'export uri; fio fio.git/examples/nbd.fio'
+
+The following shell variables are available in the I<--run> argument
+(local to the run script unless you use C<export>):

 =over 4

diff --git a/docs/nbdkit-protocol.pod b/docs/nbdkit-protocol.pod
index 620ea16e..537cc63a 100644
--- a/docs/nbdkit-protocol.pod
+++ b/docs/nbdkit-protocol.pod
@@ -38,6 +38,8 @@ parts of the NBD protocol, with successively larger impacts:

 =over 4

+=item B<--no-mc>
+
 =item B<--no-meta-contexts>

 Force the newstyle protocol to treat all requests for meta context
@@ -51,6 +53,8 @@ emulating nbd-server 3.25.

 =item B<--no-sr>

+=item B<--no-structured-replies>
+
 Force the newstyle protocol to decline any client request for
 structured replies; this is stronger than I<--no-meta-contexts> in
 that it also disables the opportunity for sparse reads.  This is
diff --git a/docs/nbdkit.pod b/docs/nbdkit.pod
index 4391fc7b..8e82b337 100644
--- a/docs/nbdkit.pod
+++ b/docs/nbdkit.pod
@@ -334,6 +334,8 @@ L<nbdkit-protocol(1)>.

 =item B<--no-sr>

+=item B<--no-structured-replies>
+
 Do not advertise structured replies.  A client must request structured
 replies to take advantage of block status and potential sparse reads;
 however, as structured reads are not a mandatory part of the newstyle
diff --git a/server/options.h b/server/options.h
index 544f8335..7d0730ba 100644
--- a/server/options.h
+++ b/server/options.h
@@ -86,6 +86,7 @@ static const struct option long_options[] = {
   { "no-mc",            no_argument,       NULL, NO_MC_OPTION },
   { "no-meta-contexts", no_argument,       NULL, NO_MC_OPTION },
   { "no-sr",            no_argument,       NULL, NO_SR_OPTION },
+  { "no-structured-replies", no_argument,  NULL, NO_SR_OPTION },
   { "old-style",        no_argument,       NULL, 'o' },
   { "oldstyle",         no_argument,       NULL, 'o' },
   { "pid-file",         required_argument, NULL, 'P' },
diff --git a/tests/test-synopsis.sh b/tests/test-synopsis.sh
index 59886847..f8d5bcc4 100755
--- a/tests/test-synopsis.sh
+++ b/tests/test-synopsis.sh
@@ -57,6 +57,7 @@ for i in $(nbdkit --long-options | $nocr); do
         --ip-addr) ;;           # alias of -i, --ipaddr
         --new-style) ;;         # alias of -n, --newstyle
         --no-mc) ;;             # alias of --no-meta-contexts
+        --no-sr) ;;             # alias of --no-structured-replies
         --old-style) ;;         # alias of -o, --oldstyle
         --pid-file) ;;          # alias of -P, --pidfile
         --read-only) ;;         # alias of -r, --readonly
-- 
2.43.2
_______________________________________________
Libguestfs mailing list -- guestfs@lists.libguestfs.org
To unsubscribe send an email to guestfs-le...@lists.libguestfs.org

Reply via email to