Re: [Libguestfs] [p2v PATCH v2 0/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-11 Thread Laszlo Ersek
On 09/09/22 15:04, Richard W.M. Jones wrote: > On Fri, Sep 09, 2022 at 02:53:11PM +0200, Laszlo Ersek wrote: >> On 09/09/22 13:51, Richard W.M. Jones wrote: >>> On Fri, Sep 09, 2022 at 11:10:47AM +0200, Laszlo Ersek wrote: On 09/08/22 18:27, Laszlo Ersek wrote: > Bugzilla:

[Libguestfs] [p2v PATCH 0/4] fix crash in "v2v_version" string lifecycle management

2022-09-11 Thread Laszlo Ersek
We free the "v2v_version" string with a wrong function, which may cause a crash. The last patch fixes this problem. The first three patches work toward eliminating shadowed identifiers, because shadowing impeded my analysis of "v2v_version"'s life cycle. Laszlo Laszlo Ersek (4): miniexpect:

[Libguestfs] [p2v PATCH 2/4] eliminate shadowing of global variables

2022-09-11 Thread Laszlo Ersek
Shadowing of global variables, especially if it's intentional and/or as wide-spread in a codebase as it is in virt-p2v, is very harmful. Eliminate it by renaming a number of function parameters, appending a "_p" suffix. (The shadowing of "v2v_version" interfered with the analysis of the crash

[Libguestfs] [p2v PATCH 1/4] miniexpect: upgrade to miniexpect with PR#1

2022-09-11 Thread Laszlo Ersek
Incorporate miniexpect with applied, so we can build virt-p2v with "-Wall -Wextra -Wshadow" later. Signed-off-by: Laszlo Ersek --- miniexpect/miniexpect.c | 2 +- miniexpect/README | 23 2 files changed, 15

[Libguestfs] [p2v PATCH 3/4] p2v-c.m4: elicit a stricter set of warnings from gcc

2022-09-11 Thread Laszlo Ersek
Add "-Wextra" because it's good. Add "-Wshadow" because it's good, but covered by neither "-Wall" or "-Wextra". Exclude warnings about unused parameters (i.e., add "-Wno-unused-parameter"); while normally it would be valuable, we have a whole bunch of GTK callbacks with fixed parameter lists but

[Libguestfs] [p2v PATCH 4/4] ssh.c: fix crash in "v2v_version" lifecycle management

2022-09-11 Thread Laszlo Ersek
We only ever set "v2v_version" to non-NULL with pcre2_substring_get_bynumber(), as suggested by valgrind and then verified by code review. Substrings extracted with this function cannot be released with free(); we must call pcre2_substring_free().