Re: [Libguestfs] [nbdkit PATCH] swab: Implement .block_size callback

2022-02-21 Thread Richard W.M. Jones
On Mon, Feb 21, 2022 at 04:00:11PM -0600, Eric Blake wrote: > We were previously enforcing minimum block size with EINVAL for > too-small requests. Advertise this to the client. > --- > filters/swab/nbdkit-swab-filter.pod | 6 ++ > filters/swab/swab.c | 24 +++

[Libguestfs] [nbdkit PATCH] swab: Implement .block_size callback

2022-02-21 Thread Eric Blake
We were previously enforcing minimum block size with EINVAL for too-small requests. Advertise this to the client. --- filters/swab/nbdkit-swab-filter.pod | 6 ++ filters/swab/swab.c | 24 +++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/

Re: [Libguestfs] [nbdkit PATCH] log: Implement .block_size callback

2022-02-21 Thread Eric Blake
On Mon, Feb 21, 2022 at 07:32:41PM +, Richard W.M. Jones wrote: > On Mon, Feb 21, 2022 at 10:59:39AM -0600, Eric Blake wrote: > > Enhance the amount of information logged during connection. > > --- > > filters/log/nbdkit-log-filter.pod | 2 +- > > filters/log/log.c | 12 ++

Re: [Libguestfs] [PATCH nbdkit] blocksize: Export block size constraints

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 08:56:37PM +, Richard W.M. Jones wrote: > This filter is a little unusual because it allows clients to send a > wider range of request sizes than the underlying plugin allows. > Therefore we advertise the widest possible minimum and maximum block > size to clients. > >

Re: [Libguestfs] [PATCH nbdkit] cache, cow: Export block size constraints

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 08:49:08PM +, Richard W.M. Jones wrote: > Because these filters perform a read-modify-write cycle for requests > which are smaller than the block size of the filter, we can adjust or > set the preferred block size to the block size of the filter or the > preferred block

Re: [Libguestfs] [nbdkit PATCH] log: Implement .block_size callback

2022-02-21 Thread Richard W.M. Jones
On Mon, Feb 21, 2022 at 10:59:39AM -0600, Eric Blake wrote: > Enhance the amount of information logged during connection. > --- > filters/log/nbdkit-log-filter.pod | 2 +- > filters/log/log.c | 12 > 2 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/f

[Libguestfs] [nbdkit PATCH] log: Implement .block_size callback

2022-02-21 Thread Eric Blake
Enhance the amount of information logged during connection. --- filters/log/nbdkit-log-filter.pod | 2 +- filters/log/log.c | 12 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/filters/log/nbdkit-log-filter.pod b/filters/log/nbdkit-log-filter.pod inde

Re: [Libguestfs] how can I run a subset of the tests?

2022-02-21 Thread Richard W.M. Jones
On Mon, Feb 21, 2022 at 03:10:02PM +0100, Laszlo Ersek wrote: > Hi, > > "make check" in libguestfs takes very long (especially when it's run > after every patch in a series). > > How can I run only those tests that are, for example, in "tests/luks/"? This used to be possible before: commit 6d

Re: [Libguestfs] how can I run a subset of the tests?

2022-02-21 Thread Eric Blake
On Mon, Feb 21, 2022 at 03:10:02PM +0100, Laszlo Ersek wrote: > Hi, > > "make check" in libguestfs takes very long (especially when it's run > after every patch in a series). > > How can I run only those tests that are, for example, in "tests/luks/"? Disclaimer: The following advice works for li

Re: [Libguestfs] [PATCH libnbd 8/8] copy: Adaptive queue size

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 02:14:03PM +0200, Nir Soffer wrote: > Limit the size of the copy queue also by the number of queued bytes. > This allows using many concurrent small requests, required to get good > performance, but limiting the number of large requests that are actually > faster with lower

Re: [Libguestfs] [PATCH libnbd 6/8] copy: Keep worker pointer in command

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 02:14:01PM +0200, Nir Soffer wrote: > Replace the command index with a worker pointer. The nbd-ops access the > index via the worker pointer. This allows commands to modify worker > state during processing. > > Signed-off-by: Nir Soffer > --- > copy/multi-thread-copying.c

Re: [Libguestfs] [PATCH libnbd 4/8] copy: Separate finishing a command from freeing it

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 02:13:59PM +0200, Nir Soffer wrote: > free_command() was abused as a completion callback. Introduce > finish_command() completion callback, so code that want to free a > command does not have to add dummy errors. > > This will make it easier to manage worker state when a co

Re: [Libguestfs] [PATCH libnbd 3/8] copy: Extract create_command and create_buffer helpers

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 02:13:58PM +0200, Nir Soffer wrote: > Creating a new command requires lot of boilerplate that makes it harder > to focus on the interesting code. Extract a helpers to create a command, > and the command slice buffer. > > create_buffer is called only once, but the compiler i

Re: [Libguestfs] [PATCH libnbd 1/8] copy: Remove wrong references to holes

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 02:13:56PM +0200, Nir Soffer wrote: > In the past nbdcopy was looking for hole extents instead of zero > extents. When we fixed this, we forgot to update some comments and > variable names referencing hole instead of zero. Might be nice to add: Fixes: d5f65e36 ("copy: Do n

Re: [Libguestfs] [PATCH libnbd 2/8] copy: Rename copy_subcommand to create_subcommand

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 02:13:57PM +0200, Nir Soffer wrote: > copy_subcommand creates a new command without copying the original > command. Rename the function to make this more clear. > > Signed-off-by: Nir Soffer > --- > copy/multi-thread-copying.c | 29 ++--- > 1 file

Re: [Libguestfs] [PATCH nbdkit] cache, cow: Export block size constraints

2022-02-21 Thread Richard W.M. Jones
On Mon, Feb 21, 2022 at 03:19:23PM +0100, Laszlo Ersek wrote: > On 02/21/22 11:22, Richard W.M. Jones wrote: > > On Mon, Feb 21, 2022 at 10:22:04AM +0100, Laszlo Ersek wrote: > >>> +/* Block size constraints. */ > >>> +static int > >>> +cache_block_size (nbdkit_next *next, void *handle, > >>> +

Re: [Libguestfs] [PATCH nbdkit] cache, cow: Export block size constraints

2022-02-21 Thread Laszlo Ersek
On 02/21/22 11:22, Richard W.M. Jones wrote: > On Mon, Feb 21, 2022 at 10:22:04AM +0100, Laszlo Ersek wrote: >>> +/* Block size constraints. */ >>> +static int >>> +cache_block_size (nbdkit_next *next, void *handle, >>> + uint32_t *minimum, uint32_t *preferred, uint32_t >>> *maxim

Re: [Libguestfs] [libnbd PATCH] RFC: api: Add set_request_block_size

2022-02-21 Thread Eric Blake
On Sun, Feb 20, 2022 at 07:14:06PM +, Richard W.M. Jones wrote: > On Thu, Feb 17, 2022 at 05:04:13PM -0600, Eric Blake wrote: > > WIP: I need to finish writing the actual interop-qemu-block-size.sh to > > demonstrate scenarios where qemu-nbd advertises a block size > 1 to > > clients that reque

[Libguestfs] how can I run a subset of the tests?

2022-02-21 Thread Laszlo Ersek
Hi, "make check" in libguestfs takes very long (especially when it's run after every patch in a series). How can I run only those tests that are, for example, in "tests/luks/"? Thanks, Laszlo ___ Libguestfs mailing list Libguestfs@redhat.com https://l

Re: [Libguestfs] [PATCH libnbd 7/8] copy: Track worker queue size

2022-02-21 Thread Nir Soffer
On Mon, Feb 21, 2022 at 12:17 PM Richard W.M. Jones wrote: > > On Mon, Feb 21, 2022 at 08:28:54AM +0200, Nir Soffer wrote: > > On Sun, Feb 20, 2022 at 8:53 PM Richard W.M. Jones > > wrote: > > > > > > On Sun, Feb 20, 2022 at 02:14:02PM +0200, Nir Soffer wrote: > > > > +static inline void > > > >

Re: [Libguestfs] [PATCH libnbd 7/8] copy: Track worker queue size

2022-02-21 Thread Richard W.M. Jones
On Mon, Feb 21, 2022 at 08:28:54AM +0200, Nir Soffer wrote: > On Sun, Feb 20, 2022 at 8:53 PM Richard W.M. Jones wrote: > > > > On Sun, Feb 20, 2022 at 02:14:02PM +0200, Nir Soffer wrote: > > > +static inline void > > > +increase_queue_size(struct worker *worker, size_t len) > > > >

Re: [Libguestfs] [PATCH nbdkit] cache, cow: Export block size constraints

2022-02-21 Thread Richard W.M. Jones
On Mon, Feb 21, 2022 at 10:22:04AM +0100, Laszlo Ersek wrote: > > +/* Block size constraints. */ > > +static int > > +cache_block_size (nbdkit_next *next, void *handle, > > + uint32_t *minimum, uint32_t *preferred, uint32_t > > *maximum) > > +{ > > + if (next->block_size (next, m

Re: [Libguestfs] [PATCH nbdkit] blocksize: Export block size constraints

2022-02-21 Thread Laszlo Ersek
On 02/20/22 21:56, Richard W.M. Jones wrote: > This filter is a little unusual because it allows clients to send a > wider range of request sizes than the underlying plugin allows. > Therefore we advertise the widest possible minimum and maximum block > size to clients. > > We still need to pick a

Re: [Libguestfs] [PATCH nbdkit] cache, cow: Export block size constraints

2022-02-21 Thread Laszlo Ersek
On 02/20/22 21:49, Richard W.M. Jones wrote: > Because these filters perform a read-modify-write cycle for requests > which are smaller than the block size of the filter, we can adjust or > set the preferred block size to the block size of the filter or the > preferred block size of the underlying