Re: [Libguestfs] [libnbd PATCH v2 12/12] tests: Language port of nbd_opt_set_meta_context() tests

2022-09-01 Thread Laszlo Ersek
On 08/31/22 16:39, Eric Blake wrote: > As promised in the previous patch, also test the new > nbd_opt_set_meta_context() API in Python, OCaml, and Golang. > > The fact that Go slams all unit tests into the same namespace is > somewhat annoying; it required munging test 240 now that 250 wants to >

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Laszlo Ersek
On 08/31/22 16:39, Eric Blake wrote: > Upstream NBD clarified (see NBD commit 13a4e33a8) that since > NBD_OPT_LIST_META_CONTEXT is stateless on the server side, it is > acceptable (but not mandatory) for servers to accept it without the > client having pre-negotiated structured replies. We aren't

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 04:01:39PM +0800, Ming Lei wrote: > Maybe you should use one nbd disk, which has the closest code path > with nbdublk. Good idea - I have started a heavy test using nbd.ko as the backing. Let's see what happens after 12 hours or more. Rich. -- Richard Jones,

Re: [Libguestfs] [libnbd PATCH] RFC: api: Add nbd_supports_vsock()

2022-09-01 Thread Laszlo Ersek
On 08/31/22 21:51, Eric Blake wrote: > Similar to nbd_supports_tls(), it is nice to know from a feature probe > whether we are likely to have VSOCK support before even trying more > expensive APIs like nbd_connect_uri("nbd+vsock://..."). > > --- > >

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-01 Thread Ming Lei
On Wed, Aug 31, 2022 at 12:06:37PM +0100, Richard W.M. Jones wrote: > On Wed, Aug 31, 2022 at 06:33:25PM +0800, Ming Lei wrote: > > On Wed, Aug 31, 2022 at 11:22:04AM +0100, Richard W.M. Jones wrote: > > > > > > After running those tests for an hour or two I got a nasty kernel > > > memory

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-01 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 11:22:04AM +0100, Richard W.M. Jones wrote: > > After running those tests for an hour or two I got a nasty kernel > memory corruption issue in the test VM, see attached. Another one from running overnight. Rich. -- Richard Jones, Virtualization Group, Red Hat

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 11:26:10AM +0800, Ming Lei wrote: > On Wed, Aug 31, 2022 at 04:06:16PM +0100, Richard W.M. Jones wrote: > > I have also added the changes to Fedora: > > > > https://koji.fedoraproject.org/koji/taskinfo?taskID=91468555 > > > > Please consider becoming a Fedora packager so

Re: [Libguestfs] [libnbd PATCH v2 01/12] internal: Use vector instead of linked list for meta_contexts

2022-09-01 Thread Laszlo Ersek
On 08/31/22 16:39, Eric Blake wrote: > Instead of open-coding a linked list, we can utilize our vector.h > helpers. No semantic change intended. > --- > lib/internal.h | 17 + > generator/states-newstyle-opt-meta-context.c | 36 >

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 09:39:19AM -0500, Eric Blake wrote: > Upstream NBD clarified (see NBD commit 13a4e33a8) that since > NBD_OPT_LIST_META_CONTEXT is stateless on the server side, it is > acceptable (but not mandatory) for servers to accept it without the > client having pre-negotiated

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 11:21:38AM +0200, Laszlo Ersek wrote: > On 08/31/22 16:39, Eric Blake wrote: > > Upstream NBD clarified (see NBD commit 13a4e33a8) that since > > NBD_OPT_LIST_META_CONTEXT is stateless on the server side, it is > > acceptable (but not mandatory) for servers to accept it

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 05:17:14PM +0100, Richard W.M. Jones wrote: > > > > [*]It's easier to skip on server failure than to try and write an > > nbdkit patch to add yet another --config feature probe just to depend > > on new-enough nbdkit to gracefully probe in advance if the server > > should

Re: [Libguestfs] [libnbd PATCH v2 04/12] api: Add nbd_set_request_meta_context()

2022-09-01 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 09:39:20AM -0500, Eric Blake wrote: > Add a new control knob nbd_set_request_meta_context(), modeled after > the existing nbd_set_request_structured_replies(), to make it possible > to skip the NBD_OPT_SET_META_CONTEXT half of the two-command sequence > currently performed

Re: [Libguestfs] [libnbd PATCH] RFC: api: Add nbd_supports_vsock()

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 08:07:33AM -0500, Eric Blake wrote: > On Thu, Sep 01, 2022 at 08:11:17AM +0200, Laszlo Ersek wrote: > > On 08/31/22 21:51, Eric Blake wrote: > > > Similar to nbd_supports_tls(), it is nice to know from a feature probe > > > whether we are likely to have VSOCK support before

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-01 Thread Ming Lei
On Thu, Sep 01, 2022 at 12:14:40PM +0100, Richard W.M. Jones wrote: > On Thu, Sep 01, 2022 at 04:01:39PM +0800, Ming Lei wrote: > > Maybe you should use one nbd disk, which has the closest code path > > with nbdublk. > > Good idea - I have started a heavy test using nbd.ko as the > backing.

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 11:21:38AM +0200, Laszlo Ersek wrote: > On 08/31/22 16:39, Eric Blake wrote: > > Upstream NBD clarified (see NBD commit 13a4e33a8) that since > > NBD_OPT_LIST_META_CONTEXT is stateless on the server side, it is > > acceptable (but not mandatory) for servers to accept it

Re: [Libguestfs] [libnbd PATCH v2 07/12] api: Make nbd_opt_list_meta_context stateless

2022-09-01 Thread Eric Blake
On Wed, Aug 31, 2022 at 09:39:23AM -0500, Eric Blake wrote: > Since NBD_OPT_LIST_META_CONTEXTS is stateless from the server's point > of view, there is no reason to make it clear state on the client's > side. Since we do not otherwise modify h->meta_contexts while > processing

Re: [Libguestfs] [libnbd PATCH] RFC: api: Add nbd_supports_vsock()

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 08:11:17AM +0200, Laszlo Ersek wrote: > On 08/31/22 21:51, Eric Blake wrote: > > Similar to nbd_supports_tls(), it is nice to know from a feature probe > > whether we are likely to have VSOCK support before even trying more > > expensive APIs like

Re: [Libguestfs] [libnbd PATCH v2 02/12] api: Fix nbd_can_meta_context if NBD_OPT_SET_META_CONTEXT fails

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 11:04:09AM +0200, Laszlo Ersek wrote: ... > > > > Rather than open-code a cleanup loop on all error paths, I instead fix > > the problem by adding a meta_valid witness that is only set to true in > > select places. The obvious place is when handling NBD_REP_ACK; but it

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Laszlo Ersek
On 09/01/22 11:21, Laszlo Ersek wrote: > On 08/31/22 16:39, Eric Blake wrote: >> Upstream NBD clarified (see NBD commit 13a4e33a8) that since >> NBD_OPT_LIST_META_CONTEXT is stateless on the server side, it is >> acceptable (but not mandatory) for servers to accept it without the >> client having

Re: [Libguestfs] [libnbd PATCH v2 02/12] api: Fix nbd_can_meta_context if NBD_OPT_SET_META_CONTEXT fails

2022-09-01 Thread Laszlo Ersek
On 08/31/22 16:39, Eric Blake wrote: > If a server replies to NBD_OPT_SET_META_CONTEXT first with > NBD_REP_META_CONTEXT, then with NBD_REP_ERR_*, we have already > modified h->meta_contexts, but fail to clean it up before moving on to > OPT_GO in the OPT_META_CONTEXT.CHECK_REPLY's default:

Re: [Libguestfs] [libnbd PATCH v2 04/12] api: Add nbd_set_request_meta_context()

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 05:29:21PM +0100, Richard W.M. Jones wrote: > On Wed, Aug 31, 2022 at 09:39:20AM -0500, Eric Blake wrote: > > Add a new control knob nbd_set_request_meta_context(), modeled after > > the existing nbd_set_request_structured_replies(), to make it possible > > to skip the

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 09:42:25PM +0100, Richard W.M. Jones wrote: > On Thu, Sep 01, 2022 at 02:55:45PM -0500, Eric Blake wrote: > > On Thu, Sep 01, 2022 at 05:17:14PM +0100, Richard W.M. Jones wrote: > > > > > > > > [*]It's easier to skip on server failure than to try and write an > > > >

Re: [Libguestfs] [libnbd PATCH] RFC: api: Add nbd_supports_vsock()

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 05:33:43PM +0100, Richard W.M. Jones wrote: > > How about the following wording: > > > > Returns true if libnbd was compiled with support for the C > > family of sockets, or false if not. Note that on the Linux > > operating system, this returns true if there is

Re: [Libguestfs] [libnbd PATCH v2 04/12] api: Add nbd_set_request_meta_context()

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 03:38:34PM -0500, Eric Blake wrote: > On Thu, Sep 01, 2022 at 05:29:21PM +0100, Richard W.M. Jones wrote: > > On Wed, Aug 31, 2022 at 09:39:20AM -0500, Eric Blake wrote: > > > Add a new control knob nbd_set_request_meta_context(), modeled after > > > the existing

Re: [Libguestfs] [libnbd PATCH v2 12/12] tests: Language port of nbd_opt_set_meta_context() tests

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 03:46:23PM -0500, Eric Blake wrote: > On Thu, Sep 01, 2022 at 09:53:11AM +0200, Laszlo Ersek wrote: > > On 08/31/22 16:39, Eric Blake wrote: > > > As promised in the previous patch, also test the new > > > nbd_opt_set_meta_context() API in Python, OCaml, and Golang. > > >

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 05:25:55PM +0100, Richard W.M. Jones wrote: > > > > Can we introduce some xfuncname pattern for these "state machine" C > > files? The STATE_MACHINE hunk header is totally useless. I'd like > > "NEWSTYLE.OPT_META_CONTEXT.START". :) > > It took me a while to work out what

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 02:55:45PM -0500, Eric Blake wrote: > On Thu, Sep 01, 2022 at 05:17:14PM +0100, Richard W.M. Jones wrote: > > > > > > [*]It's easier to skip on server failure than to try and write an > > > nbdkit patch to add yet another --config feature probe just to depend > > > on

Re: [Libguestfs] [libnbd PATCH v2 12/12] tests: Language port of nbd_opt_set_meta_context() tests

2022-09-01 Thread Eric Blake
On Thu, Sep 01, 2022 at 09:53:11AM +0200, Laszlo Ersek wrote: > On 08/31/22 16:39, Eric Blake wrote: > > As promised in the previous patch, also test the new > > nbd_opt_set_meta_context() API in Python, OCaml, and Golang. > > > > The fact that Go slams all unit tests into the same namespace is >