Re: [Libguestfs] libnbd | Failed pipeline for master | 21f4c618

2023-05-30 Thread Richard W.M. Jones
On Mon, May 29, 2023 at 03:17:11PM +, GitLab wrote: > GitLab >✖ Pipeline #882103063 has failed! > > Project nbdkit / libnbd > Branch● master > Commit● 21f4c618 > maint: Ignore .dirstamp files from automake A ... > Commit Author ● Eric Blake

Re: [Libguestfs] [libnbd PATCH v3 02/22] internal: Refactor layout of replies in sbuf

2023-05-30 Thread Laszlo Ersek
On 5/26/23 23:06, Eric Blake wrote: > I should indeed try harder to follow your useful example of generating > specific patches with more than the default 3 lines of context, when > it would make review easier. Alas, 'git format-patch' doesn't seem to > have an easy way to pick a different contex

Re: [Libguestfs] [libnbd PATCH v3 02/22] internal: Refactor layout of replies in sbuf

2023-05-30 Thread Laszlo Ersek
On 5/26/23 23:26, Eric Blake wrote: > On Fri, May 26, 2023 at 06:09:00PM +0200, Laszlo Ersek wrote: >> On 5/26/23 17:53, Laszlo Ersek wrote: >> >>> Optimally, the simple reply and the structured reply should look like >>> this: >>> >>> struct nbd_reply_header { >>> uint32_t magic; >>> uni

Re: [Libguestfs] [nbdkit PATCH] server: s/handle/cookie/ to match NBD spec

2023-05-30 Thread Laszlo Ersek
On 5/29/23 18:24, Eric Blake wrote: > Externally, libnbd has been exposing the 64-bit opaque marker for each > NBD packet as the "cookie", because it was less confusing when > contrasted with 'struct nbd_handle *' holding all libnbd state. It > also avoids confusion between the noun 'handle' as a

Re: [Libguestfs] [libnbd PATCH] internal: s/handle/cookie/ to match NBD spec

2023-05-30 Thread Laszlo Ersek
On 5/29/23 18:24, Eric Blake wrote: > Externally, we have been exposing the 64-bit opaque marker for each > NBD packet as the "cookie", because it was less confusing when > contrasted with our 'struct nbd_handle *' holding all libnbd state. > It also avoids confusion between the noun 'handle' as a

Re: [Libguestfs] [PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks

2023-05-30 Thread Laszlo Ersek
On 5/27/23 15:32, Jürgen Hötzel wrote: > Fixes failing implice_close test on OCaml 5. > --- > ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ocaml/t/guestfs_065_implicit_close.ml > b/ocaml/t/guestfs_065_implicit_close.ml > index

Re: [Libguestfs] [PATCH libguestfs 2/2] Only leave/enter blocking_section when OCaml lock is not held

2023-05-30 Thread Laszlo Ersek
On 5/27/23 15:35, Jürgen Hötzel wrote: > Fixes deadlocks on OCaml5 when trying to get the lock that is already > held: > > Fatal error during lock: Resource deadlock avoided > --- > ocaml/guestfs-c.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/ocaml/guestfs-c

Re: [Libguestfs] [libnbd PATCH v3 03/22] protocol: Add definitions for extended headers

2023-05-30 Thread Laszlo Ersek
On 5/25/23 15:00, Eric Blake wrote: > Add the magic numbers and new structs necessary to implement the NBD > protocol extension of extended headers providing 64-bit lengths. This > corresponds to upstream nbd commits 36abf47d and a9384e2f on the > extension-ext-header branch[1] (commit e6f3b94a fo

Re: [Libguestfs] [PATCH v3 04/14] nbd: Prepare for 64-bit request effect lengths

2023-05-30 Thread Vladimir Sementsov-Ogievskiy
On 15.05.23 22:53, Eric Blake wrote: Widen the length field of NBDRequest to 64-bits, although we can assert that all current uses are still under 32 bits. Move the request magic number to nbd.h, to live alongside the reply magic number. Convert 'bool structured_reply' into a tri-state enum tha

Re: [Libguestfs] [PATCH v3 05/14] nbd: Add types for extended headers

2023-05-30 Thread Vladimir Sementsov-Ogievskiy
On 15.05.23 22:53, Eric Blake wrote: Add the constants and structs necessary for later patches to start implementing the NBD_OPT_EXTENDED_HEADERS extension in both the client and server, matching recent commit e6f3b94a934] in the upstream nbd project. This patch does not change any existing beha

Re: [Libguestfs] [libnbd PATCH v3 04/22] states: Prepare to send 64-bit requests

2023-05-30 Thread Laszlo Ersek
On 5/25/23 15:00, Eric Blake wrote: > Support sending 64-bit requests if extended headers were negotiated. > This includes setting NBD_CMD_FLAG_PAYLOAD_LEN any time we send an > extended NBD_CMD_WRITE; this is such a fundamental part of the > protocol that for now it is easier to silently ignore wh

Re: [Libguestfs] [libnbd PATCH v3 03/22] protocol: Add definitions for extended headers

2023-05-30 Thread Wouter Verhelst
On Tue, May 30, 2023 at 01:50:59PM +0200, Laszlo Ersek wrote: > On 5/25/23 15:00, Eric Blake wrote: > > Add the magic numbers and new structs necessary to implement the NBD > > protocol extension of extended headers providing 64-bit lengths. This > > corresponds to upstream nbd commits 36abf47d an

Re: [Libguestfs] [libnbd PATCH v3 03/22] protocol: Add definitions for extended headers

2023-05-30 Thread Laszlo Ersek
On 5/30/23 16:56, Wouter Verhelst wrote: > On Tue, May 30, 2023 at 01:50:59PM +0200, Laszlo Ersek wrote: >> On 5/25/23 15:00, Eric Blake wrote: >>> +struct nbd_structured_reply_block_status_ext_hdr { >>> + uint32_t context_id; /* metadata context ID */ >>> + uint32_t count;

Re: [Libguestfs] libnbd | Failed pipeline for master | 21f4c618

2023-05-30 Thread Eric Blake
On Tue, May 30, 2023 at 11:42:54AM +0100, Richard W.M. Jones wrote: > On Mon, May 29, 2023 at 03:17:11PM +, GitLab wrote: > > GitLab > >✖ Pipeline #882103063 has failed! > > > > Project nbdkit / libnbd > > Branch● master > > Commit● 21f4c618 > >

Re: [Libguestfs] [PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks

2023-05-30 Thread Eric Blake
On Sat, May 27, 2023 at 03:32:36PM +0200, Jürgen Hötzel wrote: > Fixes failing implice_close test on OCaml 5. s/implice/implicit/ > --- > ocaml/t/guestfs_065_implicit_close.ml | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ocaml/t/guestfs_065_implicit_close.ml > b

Re: [Libguestfs] [PATCH v3 03/14] nbd/server: Prepare for alternate-size headers

2023-05-30 Thread Eric Blake
On Mon, May 29, 2023 at 05:26:50PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 15.05.23 22:53, Eric Blake wrote: > > Upstream NBD now documents[1] an extension that supports 64-bit effect > > lengths in requests. As part of that extension, the size of the reply > > headers will change in order

Re: [Libguestfs] [libnbd PATCH] internal: s/handle/cookie/ to match NBD spec

2023-05-30 Thread Eric Blake
On Tue, May 30, 2023 at 01:18:55PM +0200, Laszlo Ersek wrote: > On 5/29/23 18:24, Eric Blake wrote: > > Externally, we have been exposing the 64-bit opaque marker for each > > NBD packet as the "cookie", because it was less confusing when > > contrasted with our 'struct nbd_handle *' holding all li

Re: [Libguestfs] [libnbd PATCH v3 04/22] states: Prepare to send 64-bit requests

2023-05-30 Thread Eric Blake
On Tue, May 30, 2023 at 04:06:32PM +0200, Laszlo Ersek wrote: > On 5/25/23 15:00, Eric Blake wrote: > > Support sending 64-bit requests if extended headers were negotiated. > > This includes setting NBD_CMD_FLAG_PAYLOAD_LEN any time we send an > > extended NBD_CMD_WRITE; this is such a fundamental

Re: [Libguestfs] [PATCH v3 05/14] nbd: Add types for extended headers

2023-05-30 Thread Eric Blake
On Tue, May 30, 2023 at 04:23:46PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 15.05.23 22:53, Eric Blake wrote: > > Add the constants and structs necessary for later patches to start > > implementing the NBD_OPT_EXTENDED_HEADERS extension in both the client > > and server, matching recent comm

Re: [Libguestfs] [PATCH v3 04/14] nbd: Prepare for 64-bit request effect lengths

2023-05-30 Thread Eric Blake
On Tue, May 30, 2023 at 04:05:14PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 15.05.23 22:53, Eric Blake wrote: > > Widen the length field of NBDRequest to 64-bits, although we can > > assert that all current uses are still under 32 bits. Move the > > request magic number to nbd.h, to live al

Re: [Libguestfs] [libnbd PATCH v3 03/22] protocol: Add definitions for extended headers

2023-05-30 Thread Eric Blake
On Tue, May 30, 2023 at 05:48:25PM +0200, Laszlo Ersek wrote: > On 5/30/23 16:56, Wouter Verhelst wrote: > > On Tue, May 30, 2023 at 01:50:59PM +0200, Laszlo Ersek wrote: > >> On 5/25/23 15:00, Eric Blake wrote: > > >>> +struct nbd_structured_reply_block_status_ext_hdr { > >>> + uint32_t context_

[Libguestfs] [libnbd PATCH] internal: Tweak use of attribute packed in union sbuf

2023-05-30 Thread Eric Blake
While analyzing 'union sbuf' in preparation to add more members to the union, I noticed several things related to __attribute__((packed)) that can be improved. It helps to note that that the bulk of the members of 'union sbuf' are already marked packed structures from nbd-protocol.h, where we don'