[Libguestfs] [PATCH v2] ldmtool: fix NULL pointer dereference

2023-06-20 Thread Vincent Mailhol
From: Vincent Mailhol If /sys/block can not be opened, get_devices() returns NULL. cmdline() does not check this result and below code snippet: scanned = get_devices(); devices = (gchar **) scanned->data; results in a segmentation fault. Add a check on scanned. Relevant

Re: [Libguestfs] libldm crashes in a linux-sandbox context

2023-06-20 Thread Richard W.M. Jones
On Mon, Jun 19, 2023 at 08:18:20PM +0900, Vincent MAILHOL wrote: > On Fri. 16 juin 2023 at 16:34, Richard W.M. Jones wrote: > (...) > > > Last thing, the segfault on ldmtool [1] still seems a valid issue. > > > Even if I now do have a workaround for my problem, that segfault might > > > be worth

[Libguestfs] [PATCH v3] ldmtool: fix NULL pointer dereference

2023-06-20 Thread Vincent Mailhol
If /sys/block can not be opened, get_devices() returns NULL. cmdline() does not check this result and below code snippet: scanned = get_devices(); devices = (gchar **) scanned->data; results in a segmentation fault. Add a check on scanned. Relevant logs: Unable to open

Re: [Libguestfs] [PATCH v3] ldmtool: fix NULL pointer dereference

2023-06-20 Thread Richard W.M. Jones
On Tue, Jun 20, 2023 at 05:00:24PM +0900, Vincent Mailhol wrote: > If /sys/block can not be opened, get_devices() returns NULL. > > cmdline() does not check this result and below code snippet: > > scanned = get_devices(); > devices = (gchar **) scanned->data; > > results in

Re: [Libguestfs] [v2v PATCH] test-data/phony-guests: fix prerequisite list of "fedora-luks-on-lvm.img"

2023-06-20 Thread Richard W.M. Jones
On Mon, Jun 19, 2023 at 06:27:29PM +0200, Laszlo Ersek wrote: > In the virt-v2v repo, commit 1e75569aa074 ("test-data/phony-guests: Allow > virt-v2v to work against phony Fedora") is an ancestor of commit > e4efe4b7d240 ("tests: add LUKS-on-LVM test"). The latter created a state > where

[Libguestfs] [PATCH] Add partprobe call in the API

2023-06-20 Thread Philippe Midol-Monnet
Hello We are using libguestfs with nested partitions: One partition encrypted with LUKS include a GPT and several partition. In order to make the nested partition available to the system after the cryptsetup-open, partprobe need to be run. I guess it is true for all kind of nested partitions

Re: [Libguestfs] [PATCH] Add partprobe call in the API

2023-06-20 Thread Richard W.M. Jones
On Tue, Jun 20, 2023 at 02:09:36PM +0200, Philippe Midol-Monnet wrote: > Hello > > We are using libguestfs with nested partitions: One partition > encrypted with LUKS include a GPT and several partition. > In order to make the nested partition available to the system after > the cryptsetup-open,

Re: [Libguestfs] [PATCH] Add partprobe call in the API

2023-06-20 Thread Philippe Midol-Monnet
Hello Sorry for the missing file and for the email warning. I will check with my company for the warning and send you a new version. Regards Philippe On 20/06/2023 14:30, Richard W.M. Jones wrote: On Tue, Jun 20, 2023 at 02:09:36PM +0200, Philippe Midol-Monnet wrote: Hello We are using

Re: [Libguestfs] [PATCH v3] ldmtool: fix NULL pointer dereference

2023-06-20 Thread Laszlo Ersek
On 6/20/23 10:08, Richard W.M. Jones wrote: > On Tue, Jun 20, 2023 at 05:00:24PM +0900, Vincent Mailhol wrote: >> If /sys/block can not be opened, get_devices() returns NULL. >> >> cmdline() does not check this result and below code snippet: >> >> scanned = get_devices(); >>

Re: [Libguestfs] [PATCH v3] ldmtool: fix NULL pointer dereference

2023-06-20 Thread Richard W.M. Jones
On Tue, Jun 20, 2023 at 11:15:15AM +0200, Laszlo Ersek wrote: > On 6/20/23 10:08, Richard W.M. Jones wrote: > > On Tue, Jun 20, 2023 at 05:00:24PM +0900, Vincent Mailhol wrote: > >> If /sys/block can not be opened, get_devices() returns NULL. > >> > >> cmdline() does not check this result and

[Libguestfs] Rust Bindings for Libnbd

2023-06-20 Thread Tage Johansson
This is Tage. I am a Google Summer of Code contributer this summer working on Rust bindings for Libnbd. So far, I have made a very basic first draft which is far from complete. But I'll send the patches anyway so you can take a look. I have created "generator/Rust.ml" which generates Rust code

[Libguestfs] [PATCH 2/2] rust: add some (but not yet all) tests

2023-06-20 Thread Tage Johansson
From: Tage Johansson --- rust/Cargo.toml | 3 + rust/tests/test_100_handle.rs | 25 rust/tests/test_110_defaults.rs | 33 ++ rust/tests/test_120_set_non_defaults.rs | 56 + rust/tests/test_130_private_data.rs | 28

Re: [Libguestfs] [v2v PATCH] test-data/phony-guests: fix prerequisite list of "fedora-luks-on-lvm.img"

2023-06-20 Thread Laszlo Ersek
On 6/20/23 09:41, Richard W.M. Jones wrote: > On Mon, Jun 19, 2023 at 06:27:29PM +0200, Laszlo Ersek wrote: >> In the virt-v2v repo, commit 1e75569aa074 ("test-data/phony-guests: Allow >> virt-v2v to work against phony Fedora") is an ancestor of commit >> e4efe4b7d240 ("tests: add LUKS-on-LVM

Re: [Libguestfs] [PATCH 2/2] rust: add some (but not yet all) tests

2023-06-20 Thread Richard W.M. Jones
On Tue, Jun 20, 2023 at 09:31:37AM +, Tage Johansson wrote: > From: Tage Johansson > > --- > rust/Cargo.toml | 3 + > rust/tests/test_100_handle.rs | 25 > rust/tests/test_110_defaults.rs | 33 ++ >

Re: [Libguestfs] [PATCH 1/2] rust: create basic Rust bindings

2023-06-20 Thread Richard W.M. Jones
On Tue, Jun 20, 2023 at 09:31:36AM +, Tage Johansson wrote: > @@ -717,6 +744,7 @@ echo > echo "Language bindings:" > echo > feature "Go"test "x$HAVE_GOLANG_TRUE" = "x" > +feature "Rust"test "x$HAVE_RUST_TRUE" = "x" There seems to be a space vs tab

Re: [Libguestfs] [libnbd PATCH v4 4/4] internal: Refactor layout of replies in sbuf

2023-06-20 Thread Laszlo Ersek
On 6/9/23 04:17, Eric Blake wrote: > In order to more easily add a third reply type with an even larger > header, but where the payload will look the same for both structured > and extended replies, it is nicer if simple and structured replies are > nested inside the same layer of sbuf.reply.hdr.

Re: [Libguestfs] [libnbd PATCH v4 3/4] generator: Rename states-reply-structured to states-reply-chunk

2023-06-20 Thread Laszlo Ersek
On 6/12/23 22:34, Eric Blake wrote: > On Thu, Jun 08, 2023 at 09:17:37PM -0500, Eric Blake wrote: >> Upcoming patches to add extended headers want to share the common >> payload parser with structured replies. Renaming the file and the >> associated states from "structured" to "chunk" makes it

Re: [Libguestfs] [v2v PATCH] test-data/phony-guests: fix prerequisite list of "fedora-luks-on-lvm.img"

2023-06-20 Thread Laszlo Ersek
On 6/20/23 11:14, Laszlo Ersek wrote: > On 6/20/23 09:41, Richard W.M. Jones wrote: >> On Mon, Jun 19, 2023 at 06:27:29PM +0200, Laszlo Ersek wrote: >>> In the virt-v2v repo, commit 1e75569aa074 ("test-data/phony-guests: Allow >>> virt-v2v to work against phony Fedora") is an ancestor of commit