Re: [Libguestfs] [PATCH nbdkit 2/2] common/include: Fix MIN and MAX macros so they can be nested

2022-02-22 Thread Eric Blake
On Tue, Feb 22, 2022 at 09:35:04PM +, Richard W.M. Jones wrote: > Thanks: Eric Blake > --- > common/include/minmax.h | 21 + > common/include/test-minmax.c | 14 ++ > 2 files changed, 27 insertions(+), 8 deletions(-) ACK. -- Eric Blake, Principal

Re: [Libguestfs] [PATCH nbdkit 1/2] common/include: Change unique-name macros to use __COUNTER__

2022-02-22 Thread Eric Blake
On Tue, Feb 22, 2022 at 09:35:03PM +, Richard W.M. Jones wrote: > Previously the macros used __LINE__ which meant they created a unique > name specific to the line on which the macro was expanded. This > worked to a limited degree for cases like: > > #define FOO \ > ({ int

Re: [Libguestfs] [PATCH nbdkit 0/2] common/include: Fix MIN and MAX macros so they can be nested

2022-02-22 Thread Richard W.M. Jones
On Tue, Feb 22, 2022 at 09:35:02PM +, Richard W.M. Jones wrote: > Not tested very much yet. I need to test them across a lot more > platforms and compilers. However for a first cut they look good. I tested the patches now on: - FreeBSD - OpenBSD - clang on Linux - mingw-w64 (Fedora

[Libguestfs] [PATCH nbdkit 2/2] common/include: Fix MIN and MAX macros so they can be nested

2022-02-22 Thread Richard W.M. Jones
Thanks: Eric Blake --- common/include/minmax.h | 21 + common/include/test-minmax.c | 14 ++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/common/include/minmax.h b/common/include/minmax.h index d3e667ea..8d1fbf19 100644 ---

[Libguestfs] [PATCH nbdkit 1/2] common/include: Change unique-name macros to use __COUNTER__

2022-02-22 Thread Richard W.M. Jones
Previously the macros used __LINE__ which meant they created a unique name specific to the line on which the macro was expanded. This worked to a limited degree for cases like: #define FOO \ ({ int NBDKIT_UNIQUE_NAME(foo) = 42; \ NBDKIT_UNIQUE_NAME(foo) * 2 }) since the “FOO”

[Libguestfs] [PATCH nbdkit 0/2] common/include: Fix MIN and MAX macros so they can be nested

2022-02-22 Thread Richard W.M. Jones
Not tested very much yet. I need to test them across a lot more platforms and compilers. However for a first cut they look good. Rich. ___ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs

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

2022-02-22 Thread Eric Blake
On Tue, Feb 22, 2022 at 12:49:13PM +0100, Laszlo Ersek wrote: > On 02/21/22 23:00, 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 ++ > >

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

2022-02-22 Thread Laszlo Ersek
On 02/21/22 23:00, 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 +++- > 2 files

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

2022-02-22 Thread Nir Soffer
On Mon, Feb 21, 2022 at 5:41 PM Eric Blake wrote: > > 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

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

2022-02-22 Thread Nir Soffer
On Mon, Feb 21, 2022 at 5:08 PM Eric Blake wrote: > > 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.

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

2022-02-22 Thread Nir Soffer
On Mon, Feb 21, 2022 at 5:03 PM Eric Blake wrote: > > 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

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

2022-02-22 Thread Nir Soffer
On Mon, Feb 21, 2022 at 4:52 PM Eric Blake wrote: > > 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 > > --- > >

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

2022-02-22 Thread Nir Soffer
On Mon, Feb 21, 2022 at 4:51 PM Eric Blake wrote: > > 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

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

2022-02-22 Thread Richard W.M. Jones
On Tue, Feb 22, 2022 at 11:14:18AM +0100, Laszlo Ersek wrote: > On 02/21/22 16:56, Richard W.M. Jones wrote: > > 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

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

2022-02-22 Thread Laszlo Ersek
On 02/21/22 16:56, Richard W.M. Jones wrote: > 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

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

2022-02-22 Thread Laszlo Ersek
On 02/21/22 15:32, Richard W.M. Jones wrote: > > 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 >