[Libguestfs] [libnbd PATCH] tests: Test free callback in synchronous nbd_opt_* calls

2023-07-12 Thread Eric Blake
The documentation guarantees that a user's .free callback is reached exactly once for all synchronous nbd_opt_* functions that take a callback structure (nbd_opt_list, nbd_opt_list_meta, ...), regardless of API success or failure, but we weren't actually testing that in the testsuite. It is quite

Re: [Libguestfs] libnbd: When are callbacks freed

2023-07-12 Thread Eric Blake
On Wed, Jul 12, 2023 at 03:33:28PM -0500, Eric Blake wrote: > > > /* Issue NBD_OPT_LIST and wait for the reply. */ > > > int > > > nbd_unlocked_opt_list (struct nbd_handle *h, nbd_list_callback *list) > > > { > > >   struct list_helper s = { .list = *list }; > > >   nbd_list_callback l = {

Re: [Libguestfs] libnbd: When are callbacks freed

2023-07-12 Thread Eric Blake
On Wed, Jul 12, 2023 at 03:19:59PM +, Tage Johansson wrote: > Hello, > > > While writing some tests for the Rust bindings, I discovered a memory leak > with Valgrind due to a completion callback not being freed. More specificly, > the completion callback of `aio_opt_info()` doesn't seem to

Re: [Libguestfs] libnbd: When are callbacks freed

2023-07-12 Thread Richard W.M. Jones
On Wed, Jul 12, 2023 at 03:19:59PM +, Tage Johansson wrote: > Hello, > > While writing some tests for the Rust bindings, I discovered a > memory leak with Valgrind due to a completion callback not being > freed. More specificly, the completion callback of `aio_opt_info()` > doesn't seem to be

[Libguestfs] libnbd: When are callbacks freed

2023-07-12 Thread Tage Johansson
Hello, While writing some tests for the Rust bindings, I discovered a memory leak with Valgrind due to a completion callback not being freed. More specificly, the completion callback of `aio_opt_info()` doesn't seem to be if `aio_opt_info()` failes. In this case, `aio_opt_info()` was called

Re: [Libguestfs] [PATCH v2 1/3] generator: Move [camel_case] function from GoLang.ml to utils.ml as it will be used in Rust.ml as well

2023-07-12 Thread Eric Blake
On Mon, Jun 26, 2023 at 05:29:25PM +0100, Richard W.M. Jones wrote: > > Thanks, this one is upstream in commit 557ed93df3. Hello Tage, I'm looking forward to seeing your work this summer, and congratulations on your first commit to libnbd! Here's some advice to help on future patches. First, I

Re: [Libguestfs] [PATCH] generator: Add some arguments to ocamlc in generator/Makefile.am to silence some warnings

2023-07-12 Thread Eric Blake
On Wed, Jul 12, 2023 at 07:34:56AM +, Tage Johansson wrote: > From: Tage Johansson > > When running make with OCaml 5.0.0, the following warnings are sometimes > shown: > > ``` > OCaml's lib directory layout changed in 5.0. The unix subdirectory has been > automatically added to the search

Re: [Libguestfs] [libguestfs PATCH] lib: remove guestfs_int_cmd_clear_close_files()

2023-07-12 Thread Laszlo Ersek
On 7/11/23 15:10, Richard W.M. Jones wrote: > On Tue, Jul 11, 2023 at 01:39:06PM +0200, Laszlo Ersek wrote: >> The last (only?) caller of guestfs_int_cmd_clear_close_files() disappeared >> in commit e4c396888056 ("lib/info: Remove /dev/fd hacking and pass a true >> filename to qemu-img info.",

[Libguestfs] [PATCH] generator: Add some arguments to ocamlc in generator/Makefile.am to silence some warnings

2023-07-12 Thread Tage Johansson
From: Tage Johansson When running make with OCaml 5.0.0, the following warnings are sometimes shown: ``` OCaml's lib directory layout changed in 5.0. The unix subdirectory has been automatically added to the search path, but you should add -I +unix to the command-line to silence this alert

[Libguestfs] OCaml 5.0 warning

2023-07-12 Thread Tage Johansson
When running make with OCaml 5.0 installed, I get some warnings complaining about changed lib directory layout. It suggests adding "-I +unix -I +str" to the invocation of ocamlc. So this patch does just that. It does silence the warnings for me, but someone should probably test that it works with