[Libguestfs] [nbdkit PATCH 8/9] vector: introduce DEFINE_POINTER_VECTOR_TYPE()

2023-03-02 Thread Laszlo Ersek
(Commit message below adapted from libnbd commit fda38988b86b, "vector: introduce DEFINE_POINTER_VECTOR_TYPE()", 2023-02-28). The "name##_iter" function is used 5 times in nbdkit as follows: string_vector_iter (..., (void *) free); Casting "free" to (void*) is ugly. (Well-defined by POSIX, but

[Libguestfs] [nbdkit PATCH 9/9] convert string_vector_(iter(free) + reset()) to string_vector_empty()

2023-03-02 Thread Laszlo Ersek
(Reimplement libnbd commit c7ff70101e8c, "convert string_vector_(iter(free) + reset()) to string_vector_empty()", 2023-02-28.) Convert the 5 string_vector_(iter(free) + reset()) call sites mentioned previously to string_vector_empty(). Note that the converted code performs more cleanup steps in s

[Libguestfs] [nbdkit PATCH 6/9] common/include: extract STATIC_ASSERT() macro

2023-03-02 Thread Laszlo Ersek
We already have two use cases for static assertions (and soon we'll have yet another). Namely: - STATIC_ASSERT_UNSIGNED_INT() in "checked-overflow.h". Here, we use our own trick, based on a negative-sized array typedef that's named with NBDKIT_UNIQUE_NAME. - static_assert() in "test-array-siz

[Libguestfs] [nbdkit PATCH 3/9] build: Silence some cppcheck warnings [partial port]

2023-03-02 Thread Laszlo Ersek
From: Eric Blake Original commit message: I ran: $ cppcheck --cppcheck-build-dir=cache/cppcheck -q -I . -I common/include/ \ -I include/ -I lib/ -I common/utils/ -i generator/ . then inspected the output. cppcheck correctly flags: copy/file-ops.c:423:10: portability: 'data' is of type 'void

[Libguestfs] [nbdkit PATCH 5/9] common/include: add TYPE_IS_POINTER() macro

2023-03-02 Thread Laszlo Ersek
Because the current definition of TYPE_IS_ARRAY() already contains a negation, defining TYPE_IS_POINTER() in terms of TYPE_IS_ARRAY() would lead to double negation, which I consider less than ideal style. Therefore, introduce TYPE_IS_POINTER() from scratch, and rebase TYPE_IS_ARRAY() on top of TYPE

[Libguestfs] [nbdkit PATCH 7/9] force semicolon after DEFINE_VECTOR_TYPE() macro invocations

2023-03-02 Thread Laszlo Ersek
Original commit message: Currently, a semicolon after a DEFINE_VECTOR_TYPE(...) macro invocation is not needed, nor does our documentation in "common/utils/vector.h" prescribe one. Furthermore, it breaks ISO C, which gcc reports with "-Wpedantic": > warning: ISO C does not allow extra ‘;’ outside

[Libguestfs] [nbdkit PATCH 2/9] common/include: Add a function to compute log2(unsigned long)

2023-03-02 Thread Laszlo Ersek
From: "Richard W.M. Jones" Signed-off-by: Laszlo Ersek (cherry picked from libnbd commit 27a9bb45c70dbb1112cab6bdc1a61b21f78bc6f4) --- configure.ac | 3 +++ common/include/ispowerof2.h | 13 + common/include/test-ispowerof2.c | 10 ++ 3 files change

[Libguestfs] [nbdkit PATCH 1/9] common/utils/vector.h: Remove stale reference to `size`

2023-03-02 Thread Laszlo Ersek
From: Nir Soffer Original commit message: Update stale comments to use `len` instead of `size`. Fixes: commit cc0567e9aed7e6b40a44bf8eac0a262ac7314fec Signed-off-by: Nir Soffer Porting notes: (1) Libnbd commit cc0567e9aed7 ("common/utils/vector: Rename `size` to `len`", 2021-10-31) renamed t

[Libguestfs] [nbdkit PATCH 0/9] common: catch up with libnbd

2023-03-02 Thread Laszlo Ersek
This is the counterpart series for [libnbd PATCH 0/6] common: catch up with nbdkit 20230301114027.336230-1-lersek@redhat.com">http://mid.mail-archive.com/20230301114027.336230-1-lersek@redhat.com Contrarily to my prognosis in that cover letter, this series does ultimately extend up to libnbd

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-03-02 Thread Andrey Drobyshev
On 3/2/23 22:59, Richard W.M. Jones wrote: > On Thu, Mar 02, 2023 at 08:52:33PM +0200, Andrey Drobyshev wrote: >> On 3/2/23 20:36, Richard W.M. Jones wrote: >>> I can probably do an outline of a patch if you need it, but >>> not today. >> >> Yes, sure. But speaking of the ways to influence the beh

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-03-02 Thread Richard W.M. Jones
On Thu, Mar 02, 2023 at 08:52:33PM +0200, Andrey Drobyshev wrote: > On 3/2/23 20:36, Richard W.M. Jones wrote: > > I can probably do an outline of a patch if you need it, but > > not today. > > Yes, sure. But speaking of the ways to influence the behaviour of a > command line tool: there're also

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-03-02 Thread Andrey Drobyshev
On 3/2/23 20:36, Richard W.M. Jones wrote: > On Thu, Mar 02, 2023 at 08:15:37PM +0200, Andrey Drobyshev wrote: >> On 2/28/23 16:39, Richard W.M. Jones wrote: >>> On Tue, Feb 28, 2023 at 03:24:46PM +0100, Laszlo Ersek wrote: On 2/28/23 14:01, Richard W.M. Jones wrote: > On Wed, Feb 22, 2023

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-03-02 Thread Richard W.M. Jones
On Thu, Mar 02, 2023 at 08:15:37PM +0200, Andrey Drobyshev wrote: > On 2/28/23 16:39, Richard W.M. Jones wrote: > > On Tue, Feb 28, 2023 at 03:24:46PM +0100, Laszlo Ersek wrote: > >> On 2/28/23 14:01, Richard W.M. Jones wrote: > >>> On Wed, Feb 22, 2023 at 08:20:43PM +0200, Andrey Drobyshev wrote:

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-03-02 Thread Andrey Drobyshev
On 2/28/23 16:39, Richard W.M. Jones wrote: > On Tue, Feb 28, 2023 at 03:24:46PM +0100, Laszlo Ersek wrote: >> On 2/28/23 14:01, Richard W.M. Jones wrote: >>> On Wed, Feb 22, 2023 at 08:20:43PM +0200, Andrey Drobyshev wrote: Since commits b28cd1dc ("Remove requested_guestcaps / rcaps"), f0afc4

Re: [Libguestfs] Checksums and other verification

2023-03-02 Thread Nir Soffer
On Thu, Mar 2, 2023 at 10:46 AM Richard W.M. Jones wrote: > > On Mon, Feb 27, 2023 at 07:09:33PM +0200, Nir Soffer wrote: > > On Mon, Feb 27, 2023 at 6:41 PM Richard W.M. Jones > > wrote: > > > I think it would be more useful if (or in addition) it could compute > > > the checksum of a stream wh

Re: [Libguestfs] [nbdkit PATCH 0/5] ci: Get to green status on FreeBSD and MacOS

2023-03-02 Thread Laszlo Ersek
On 3/1/23 23:10, Eric Blake wrote: > On Wed, Mar 01, 2023 at 06:43:11PM +0100, Laszlo Ersek wrote: >> On 3/1/23 17:54, Eric Blake wrote: >>> I took the easy route of crippling what I couldn't get working, on the >>> grounds that partial coverage is better than none now that we have >>> Cirrus CI ch

Re: [Libguestfs] [nbdkit PATCH 0/5] ci: Get to green status on FreeBSD and MacOS

2023-03-02 Thread Richard W.M. Jones
ACK series, thanks for fixing this. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit ___

Re: [Libguestfs] Checksums and other verification

2023-03-02 Thread Richard W.M. Jones
On Mon, Feb 27, 2023 at 07:09:33PM +0200, Nir Soffer wrote: > On Mon, Feb 27, 2023 at 6:41 PM Richard W.M. Jones wrote: > > I think it would be more useful if (or in addition) it could compute > > the checksum of a stream which is being converted with 'qemu-img > > convert'. Extra points if it ca