[Libguestfs] [PATCH nbdkit 02/10] server: Don't set export_name as a side effect of using --run

2023-09-09 Thread Richard W.M. Jones
Reduce long-range code dependencies by not setting export_name in run_command (--run functionality), especially as this function is not always called. If the -e option was not used at all then export_name will be NULL. --- server/captive.c | 12 +--- 1 file changed, 5 insertions(+), 7

[Libguestfs] [PATCH nbdkit 05/10] server: Add the NBD URI to debug output

2023-09-09 Thread Richard W.M. Jones
Example after applying this patch: $ ./nbdkit -fv --port -e foo null 1M /home/rjones/d/nbdkit/server/nbdkit -f -v --port= -e foo -- /home/rjones/d/nbdkit/plugins/null/.libs/nbdkit-null-plugin.so 1M nbdkit: debug: nbdkit 1.35.12 nbdkit: debug: TLS disabled: could not load TLS

[Libguestfs] [PATCH nbdkit 08/10] tests: Be punctilious about using requires_run in tests that use --run

2023-09-09 Thread Richard W.M. Jones
This requires that nbdkit is built with the --run feature, which (currently) is not true for Windows. (In some tests we separately checked for !Windows, but let's favour consistency.) --- plugins/rust/test-ramdisk.sh | 2 ++ tests/test-S3.sh | 1 +

[Libguestfs] [PATCH nbdkit 07/10] tests/test-parallel-*.sh: Remove redundant comment

2023-09-09 Thread Richard W.M. Jones
--- tests/test-parallel-file.sh | 1 - tests/test-parallel-nbd.sh | 1 - tests/test-parallel-sh.sh | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/test-parallel-file.sh b/tests/test-parallel-file.sh index 3cbaa2d46..add60007a 100755 --- a/tests/test-parallel-file.sh +++

[Libguestfs] [PATCH nbdkit 06/10] server: Make --run imply -U -

2023-09-09 Thread Richard W.M. Jones
Almost always when you used nbdkit --run you should also use -U - (to use a private Unix domain socket). Otherwise nbdkit listened on TCP port 10809, which had two bad side effects: It permitted other processes to interfere with your --run command, and it reserved a public TCP port which would

[Libguestfs] [PATCH nbdkit 10/10] XXX docs: Remove references to -U - when it is implicit

2023-09-09 Thread Richard W.M. Jones
XXX NOTE XXX I would not apply this patch immediately, since online documentation will get updated as soon as I do that. Best to wait until after 1.36 is released at least. XXX END NOTE XXX --- docs/nbdkit-captive.pod | 6 +++---

[Libguestfs] [PATCH nbdkit 00/10] Make --run imply -U -

2023-09-09 Thread Richard W.M. Jones
Should have done this a long time ago. I feel it is about time we change the default of nbdkit --run to imply -U -, rather than opening a public port. Patch series turned out to be a little bit more complicated than I anticipated, but it contains some nice clean ups. Last patch updating the

[Libguestfs] [PATCH nbdkit 03/10] server: Don't set port as a side effect

2023-09-09 Thread Richard W.M. Jones
This removes another long-range code dependency. --- server/sockets.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/sockets.c b/server/sockets.c index fe8b24409..d49b1755b 100644 --- a/server/sockets.c +++ b/server/sockets.c @@ -171,26 +171,26 @@

[Libguestfs] [PATCH nbdkit 01/10] server: Introduce service_mode concept

2023-09-09 Thread Richard W.M. Jones
Previously there were two places where similiar-ish logic was used to decide if we are going to serve over a socket activation, -s, Unix socket, AF_VSOCK or TCP/IP. Let's abstract that into a service_mode. One place where we did this was when calculating the $uri variable for --run. This change

[Libguestfs] [PATCH nbdkit 09/10] tests: Remove references to -U - when it is implicit

2023-09-09 Thread Richard W.M. Jones
In tests where we used 'nbdkit -U - ... --run', remove -U - as that is now implicit. --- tests/Makefile.am| 2 +- plugins/rust/test-ramdisk.sh | 4 +-- tests/test-S3.sh | 2 +- tests/test-blkio.sh | 2 +-

[Libguestfs] [PATCH nbdkit 04/10] server: Calculate $uri in one place

2023-09-09 Thread Richard W.M. Jones
Move the calculation of $uri to the main function (well, inlined there), and out of --run code. This is largely code motion. In theory it changes the content of $uri since we now shell quote it after generating it, but this ought not to have any practical effect. --- server/internal.h | 1 +