Re: [Libguestfs] [libnbd PATCH] nbdsh: Start adding unit tests

2019-09-12 Thread Eric Blake
On 9/11/19 10:10 PM, Eric Blake wrote: > Ultimately, I'd like to add a unit test covering our recent fix for > handling globals from consecutive -c, but let's start with a simple > test that --help output is sane. Sanity includes a mention of the man > page for more details (similar to nbdkit

Re: [Libguestfs] [libnbd PATCH] nbdsh: Start adding unit tests

2019-09-12 Thread Richard W.M. Jones
Yes this is fine, ACK. FWIW the following Fedora packages contain the fixed nbdsh: libnbd-1.0.1-2.fc29 libnbd-1.0.1-2.fc30 libnbd-1.0.1-2.fc31 libnbd-1.1.1-2.fc32 For fc<=31 you will need to enable updates-testing to get them. Rich. -- Richard Jones, Virtualization Group, Red Hat

[Libguestfs] [PATCH libnbd 2/2] interop: Retry TCP connections to qemu-nbd.

2019-09-12 Thread Richard W.M. Jones
The test interop-qemu-nbd-tls-certs frequently fails on slow (32 bit) machines in Fedora Koji. (Is crypto slow on these already overloaded machines?) As we cannot wait for a signal when qemu-nbd is ready start serving, we have to use a sleep. The current sleep is 5 seconds, which is not long

[Libguestfs] [PATCH libnbd 1/2] nbd_connect_tcp: Try to return errno from underlying connect(2) call.

2019-09-12 Thread Richard W.M. Jones
When we make a TCP connection we have to make multiple underlying connect(2) calls, once for each address returned by getaddrinfo. Unfortunately this meant that we lost the errno from any of these calls: $ nbdsh -c 'h.connect_tcp ("localhost", "nbd")' nbd.Error: nbd_connect_tcp: connect:

Re: [Libguestfs] [nbdkit PATCH 2/2] server: Add --mask-handshake option for integration testing

2019-09-12 Thread Richard W.M. Jones
ACK series. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org

Re: [Libguestfs] [PATCH nbdkit] python: Drop support for Python 2.

2019-09-12 Thread Daniel P . Berrangé
On Wed, Sep 11, 2019 at 08:42:29PM +0100, Richard W.M. Jones wrote: > This patch proposes to drop support for Python 2 in nbdkit. > > Rather than abruptly drop it everywhere, my proposal is that we point > people to nbdkit 1.14 (the current stable version) if they want to > continue with Python 2

Re: [Libguestfs] [PATCH libnbd 2/2] interop: Retry TCP connections to qemu-nbd.

2019-09-12 Thread Eric Blake
On 9/12/19 5:02 AM, Richard W.M. Jones wrote: > The test interop-qemu-nbd-tls-certs frequently fails on slow (32 bit) > machines in Fedora Koji. (Is crypto slow on these already overloaded > machines?) > > As we cannot wait for a signal when qemu-nbd is ready start serving, > we have to use a

[Libguestfs] [p2v PATCH] tests: require virt-v2v for functional tests

2019-09-12 Thread Pino Toscano
virt-v2v is definitely used by the functional tests that run virt-p2v, so check for it, and require it for running those tests. Reported by Rich. --- m4/p2v-tests.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/m4/p2v-tests.m4 b/m4/p2v-tests.m4 index f679bc4..7de356d

[Libguestfs] [p2v PATCH] Fix FSF address

2019-09-12 Thread Pino Toscano
Adjust license headers to use the current FSF postal address. Spotted by Rpmlint. --- launch-virt-p2v | 2 +- p2v.ks.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/launch-virt-p2v b/launch-virt-p2v index 925aa6d..5e46f42 100755 --- a/launch-virt-p2v +++

Re: [Libguestfs] [p2v PATCH] tests: require virt-v2v for functional tests

2019-09-12 Thread Richard W.M. Jones
On Thu, Sep 12, 2019 at 05:25:37PM +0200, Pino Toscano wrote: > virt-v2v is definitely used by the functional tests that run virt-p2v, > so check for it, and require it for running those tests. > > Reported by Rich. > --- > m4/p2v-tests.m4 | 5 +++-- > 1 file changed, 3 insertions(+), 2

[Libguestfs] [libnbd PATCH] nbdsh: Add test of handling globals in -c

2019-09-12 Thread Eric Blake
Test that we can script the read of a specific pattern from nbdkit. Also, test that we can concatenate global functions through consecutive -c. This test fails if commit d6cbd130 is reverted. --- sh/Makefile.am | 5 - sh/test-dump.sh | 45 + 2

[Libguestfs] [NBDKIT SECURITY] Denial of Service / Amplification Attack in nbdkit

2019-09-12 Thread Richard W.M. Jones
We have discovered a potential Denial of Service / Amplification Attack in nbdkit. Lifecycle - Reported: 2019-09-11 Fixed: 2019-09-11 Published: 2019-09-12 There is no CVE number assigned for this issue yet, but the bug is being categorized and processed by Red Hat's security team

Re: [Libguestfs] [libnbd PATCH] nbdsh: Add test of handling globals in -c

2019-09-12 Thread Richard W.M. Jones
On Thu, Sep 12, 2019 at 11:14:59AM -0500, Eric Blake wrote: > Test that we can script the read of a specific pattern from > nbdkit. Also, test that we can concatenate global functions through > consecutive -c. This test fails if commit d6cbd130 is reverted. > --- > sh/Makefile.am | 5 - >

Re: [Libguestfs] [p2v PATCH] Fix FSF address

2019-09-12 Thread Daniel P . Berrangé
On Thu, Sep 12, 2019 at 05:14:47PM +0200, Pino Toscano wrote: > Adjust license headers to use the current FSF postal address. > > Spotted by Rpmlint. > --- > launch-virt-p2v | 2 +- > p2v.ks.in | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/launch-virt-p2v

[Libguestfs] [libnbd PATCH] nbdsh: Add -b option to simplify h.block_status

2019-09-12 Thread Eric Blake
We decided to not request the "base:allocation" context by default (if a client wants to use block_status on a different context, then they'd have to get any default request out of the way); however, block status is useless without at least one meta context. This adds a convenience knob for

[Libguestfs] [PATCH nbdkit v2 0/3] Access export name from plugins.

2019-09-12 Thread Richard W.M. Jones
The previous incomplete patch was here: https://www.redhat.com/archives/libguestfs/2019-September/msg00049.html based on earlier discussion here: https://www.redhat.com/archives/libguestfs/2019-September/msg00047.html In v2: - The previous patch was incomplete. This version completes it by

Re: [Libguestfs] [PATCH nbdkit v2 3/3] tests: Add a simple test of nbdkit_export_name.

2019-09-12 Thread Eric Blake
On 9/12/19 4:41 PM, Eric Blake wrote: > > Hmm - instead of making the handle be the name of a temporary file that > contains the export name, you could just make the handle _be_ the export > name: > > or bypass dd by exploiting your knowledge of the client: > pread) > if test $4.$3 =

[Libguestfs] [libnbd PATCH] nbdsh: Support -u as synonym for --connect

2019-09-12 Thread Eric Blake
Typing nbdsh --con (the minimum to get an unambiguous prefix for --connect, different from --command) is annoying compared to having a short option. Since it takes a URI as an argument, using -u seems like a reasonable mnemonic. --- sh/nbdsh.pod | 6 -- python/nbdsh.py| 2 +-

Re: [Libguestfs] [PATCH nbdkit v2 3/3] tests: Add a simple test of nbdkit_export_name.

2019-09-12 Thread Eric Blake
On 9/12/19 4:01 PM, Richard W.M. Jones wrote: > --- > tests/Makefile.am | 3 ++ > tests/test-export-name.sh | 86 +++ > 2 files changed, 89 insertions(+) > +# Create a sh plugin which echos the export name back in the device. echoes? One of those

Re: [Libguestfs] [libnbd PATCH] nbdsh: Support -u as synonym for --connect

2019-09-12 Thread Richard W.M. Jones
On Thu, Sep 12, 2019 at 02:33:24PM -0500, Eric Blake wrote: > Typing nbdsh --con (the minimum to get an unambiguous prefix for > --connect, different from --command) is annoying compared to having a > short option. Since it takes a URI as an argument, using -u seems > like a reasonable mnemonic.

[Libguestfs] [PATCH nbdkit v2 1/3] server: Add nbdkit_export_name() to allow export name to be read.

2019-09-12 Thread Richard W.M. Jones
This allows plugins (or filters) to read the export name which was passed to the server from the client. --- TODO | 8 +++ docs/nbdkit-plugin.pod | 29 ++ include/nbdkit-common.h | 1 + server/connections.c

[Libguestfs] [PATCH nbdkit v2 2/3] sh: Pass export name as an extra parameter to the open method.

2019-09-12 Thread Richard W.M. Jones
In nbdkit API v3 we will probably add the export name as an extra parameter, but while we are using API v2 we can get the same effect by calling nbdkit_export_name(). --- plugins/sh/nbdkit-sh-plugin.pod | 6 -- plugins/sh/sh.c | 6 +- 2 files changed, 9 insertions(+), 3

[Libguestfs] [PATCH nbdkit v2 3/3] tests: Add a simple test of nbdkit_export_name.

2019-09-12 Thread Richard W.M. Jones
--- tests/Makefile.am | 3 ++ tests/test-export-name.sh | 86 +++ 2 files changed, 89 insertions(+) diff --git a/tests/Makefile.am b/tests/Makefile.am index b5806bb..f54597b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -395,6 +395,9 @@

[Libguestfs] [libnbd PATCH v2] nbdsh: Prefer --uri over --connect

2019-09-12 Thread Eric Blake
Typing nbdsh --con (the minimum to get an unambiguous prefix for --connect, different from --command) is annoying compared to having a short option. Since it takes a URI as an argument, using -u/--uri is a nicer mnemonic. We still accept --connect for back-compat, and document it in the man

Re: [Libguestfs] [libnbd PATCH] nbdsh: Add -b option to simplify h.block_status

2019-09-12 Thread Eric Blake
On 9/12/19 1:54 PM, Eric Blake wrote: > We decided to not request the "base:allocation" context by default (if > a client wants to use block_status on a different context, then they'd > have to get any default request out of the way); however, block status > is useless without at least one meta

Re: [Libguestfs] [libnbd PATCH] nbdsh: Add -b option to simplify h.block_status

2019-09-12 Thread Richard W.M. Jones
On Thu, Sep 12, 2019 at 01:54:20PM -0500, Eric Blake wrote: > We decided to not request the "base:allocation" context by default (if > a client wants to use block_status on a different context, then they'd > have to get any default request out of the way); however, block status > is useless

Re: [Libguestfs] [libnbd PATCH v2] nbdsh: Prefer --uri over --connect

2019-09-12 Thread Richard W.M. Jones
On Thu, Sep 12, 2019 at 04:06:48PM -0500, Eric Blake wrote: > Typing nbdsh --con (the minimum to get an unambiguous prefix for > --connect, different from --command) is annoying compared to having a > short option. Since it takes a URI as an argument, using -u/--uri is > a nicer mnemonic. We

Re: [Libguestfs] [PATCH nbdkit v2 3/3] tests: Add a simple test of nbdkit_export_name.

2019-09-12 Thread Eric Blake
On 9/12/19 4:41 PM, Eric Blake wrote: >> +# Try to read back various export names from the plugin. >> +for e in "" "test" "/" "//" " " \ >> + >> "" >> +do >> +export e sock You could hoist the export out