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

2023-09-11 Thread Richard W.M. Jones
On Mon, Sep 11, 2023 at 08:18:04AM -0500, Eric Blake wrote:
> On Mon, Sep 11, 2023 at 01:11:46PM +0100, Richard W.M. Jones wrote:
> > On Mon, Sep 11, 2023 at 07:08:48AM -0500, Eric Blake wrote:
> > > On Sat, Sep 09, 2023 at 02:57:48PM +0100, Richard W.M. Jones wrote:
> > > > 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.
> > > 
> > > Indeed, just from the summary it sounds like a good idea.  nbdkit can
> > > take advantage of it immediately, but libnbd will need to continue to
> > > explicitly use -U - for a while longer (as long as older nbdkit tends
> > > to be the version still installed on various CI platforms).
> > 
> > Although it might not be useful for libnbd, we could also had a
> > --dump-config sentinel, something like:
> > 
> >   $ nbdkit --dump-config
> >   ...
> >   run_default_socket=Unix
> > 
> > (and add run_default_socket=TCP to older branches).  If you can think
> > of a better name for this ... :-)
> 
> That actually sounds good as-is.  I don't know if backporting a patch
> to expose run_default_socket=TCP makes a difference (after all, the
> absence of run_default_socket= in the config output serves the same
> purpose), but I'll leave that up to your call.

Something like the attached patch.  It leaves it open whether
we add the sentinel to older versions or not.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
>From 75dad8e87c50c6c4cb3f2f882ed9a6fe25177bb1 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" 
Date: Mon, 11 Sep 2023 14:06:03 +0100
Subject: [PATCH] server: Add --dump-config run_default_socket=Unix sentinel

In builds where --run implies -U - you will now see:

$ nbdkit --dump-config
...
run_default_socket=Unix

This is absent or has a different value in older versions of nbdkit.
---
 server/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server/main.c b/server/main.c
index 978a720cf..3a429fa46 100644
--- a/server/main.c
+++ b/server/main.c
@@ -190,6 +190,7 @@ dump_config (void)
   printf ("%s=%s\n", "name", PACKAGE_NAME);
   printf ("%s=%s\n", "plugindir", plugindir);
   printf ("%s=%s\n", "root_tls_certificates_dir", root_tls_certificates_dir);
+  printf ("%s=%s\n", "run_default_socket", "Unix");
   printf ("%s=%s\n", "sbindir", sbindir);
 #ifdef HAVE_LIBSELINUX
   printf ("selinux=yes\n");
-- 
2.41.0

___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs


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

2023-09-11 Thread Eric Blake
On Mon, Sep 11, 2023 at 01:11:46PM +0100, Richard W.M. Jones wrote:
> On Mon, Sep 11, 2023 at 07:08:48AM -0500, Eric Blake wrote:
> > On Sat, Sep 09, 2023 at 02:57:48PM +0100, Richard W.M. Jones wrote:
> > > 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.
> > 
> > Indeed, just from the summary it sounds like a good idea.  nbdkit can
> > take advantage of it immediately, but libnbd will need to continue to
> > explicitly use -U - for a while longer (as long as older nbdkit tends
> > to be the version still installed on various CI platforms).
> 
> Although it might not be useful for libnbd, we could also had a
> --dump-config sentinel, something like:
> 
>   $ nbdkit --dump-config
>   ...
>   run_default_socket=Unix
> 
> (and add run_default_socket=TCP to older branches).  If you can think
> of a better name for this ... :-)

That actually sounds good as-is.  I don't know if backporting a patch
to expose run_default_socket=TCP makes a difference (after all, the
absence of run_default_socket= in the config output serves the same
purpose), but I'll leave that up to your call.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



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

2023-09-11 Thread Richard W.M. Jones
On Mon, Sep 11, 2023 at 07:08:48AM -0500, Eric Blake wrote:
> On Sat, Sep 09, 2023 at 02:57:48PM +0100, Richard W.M. Jones wrote:
> > 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.
> 
> Indeed, just from the summary it sounds like a good idea.  nbdkit can
> take advantage of it immediately, but libnbd will need to continue to
> explicitly use -U - for a while longer (as long as older nbdkit tends
> to be the version still installed on various CI platforms).

Although it might not be useful for libnbd, we could also had a
--dump-config sentinel, something like:

  $ nbdkit --dump-config
  ...
  run_default_socket=Unix

(and add run_default_socket=TCP to older branches).  If you can think
of a better name for this ... :-)

> > Last patch updating the documentation wouldn't be applied any time
> > soon, so that the old docs stay around on the website.
> 
> Also a good idea.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



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

2023-09-11 Thread Eric Blake
On Sat, Sep 09, 2023 at 02:57:48PM +0100, Richard W.M. Jones wrote:
> 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.

Indeed, just from the summary it sounds like a good idea.  nbdkit can
take advantage of it immediately, but libnbd will need to continue to
explicitly use -U - for a while longer (as long as older nbdkit tends
to be the version still installed on various CI platforms).

> 
> Last patch updating the documentation wouldn't be applied any time
> soon, so that the old docs stay around on the website.

Also a good idea.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



[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 documentation wouldn't be applied any time
soon, so that the old docs stay around on the website.

Rich.


___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs