Re: [Libguestfs] [PATCH libnbd v3 5/6] generator: Document non-NULL behaviour of some parameters

2022-09-28 Thread Eric Blake
On Wed, Sep 28, 2022 at 06:25:38PM +0100, Richard W.M. Jones wrote: > In the C API documentation mention the potential problems of calling > non-nullable parameters with NULL. Usually an error is returned, but > warnings and worse might happen too. > > Thanks: Eric Blake > Acked-by: Laszlo Ersek

Re: [Libguestfs] [PATCH libnbd v3 3/6] lib/internal.h: Mark various internal functions with attribute((nonnull))

2022-09-28 Thread Eric Blake
On Wed, Sep 28, 2022 at 06:25:36PM +0100, Richard W.M. Jones wrote: > --- > lib/internal.h | 75 +- > 1 file changed, 50 insertions(+), 25 deletions(-) > > /* utils.c */ > -extern void nbd_internal_hexdump (const void *data, size_t len, FILE

Re: [Libguestfs] [PATCH libnbd v3 6/6] lib/utils.c: Assert that argv != NULL and add comments

2022-09-28 Thread Eric Blake
On Wed, Sep 28, 2022 at 06:25:39PM +0100, Richard W.M. Jones wrote: > Change check into an assertion, and add detailed comments explaining > our assumptions. > > Updates: commit d0fbb769286a97728b0d1358e7accc2eb708d795 > Reviewed-by: Laszlo Ersek > --- > lib/utils.c | 14 -- > 1

Re: [Libguestfs] [PATCH libnbd v3 4/6] generator: Check that more parameters are not NULL

2022-09-28 Thread Eric Blake
On Wed, Sep 28, 2022 at 06:25:37PM +0100, Richard W.M. Jones wrote: > We previously checked only that String parameters are not NULL, > returning an error + EFAULT if so. > > However we did not check Bytes*, SockAddrAndLen, Path or StringList > parameters, also never NULL. Be consistent about

Re: [Libguestfs] [PATCH libnbd v3 2/6] generator: Add attribute((nonnull)) annotations to non-NULL parameters

2022-09-28 Thread Eric Blake
On Wed, Sep 28, 2022 at 06:25:35PM +0100, Richard W.M. Jones wrote: > For API parameters that are pointers and must not be NULL, add the > appropriate GCC annotations. > > Reviewed-by: Laszlo Ersek > --- > generator/C.ml | 59 +++-- >

Re: [Libguestfs] [PATCH libnbd v3 1/6] lib/opt: Don't use NULL for an empty StringList

2022-09-28 Thread Eric Blake
On Wed, Sep 28, 2022 at 06:25:34PM +0100, Richard W.M. Jones wrote: > StringList parameters (char ** in C) will be marked with > __attribute__((nonnull)). To pass an empty list you have to use a > list containing a single NULL element, not a NULL pointer. > > nbd_internal_set_querylist has also

[Libguestfs] [PATCH libnbd v3 6/6] lib/utils.c: Assert that argv != NULL and add comments

2022-09-28 Thread Richard W.M. Jones
Change check into an assertion, and add detailed comments explaining our assumptions. Updates: commit d0fbb769286a97728b0d1358e7accc2eb708d795 Reviewed-by: Laszlo Ersek --- lib/utils.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/utils.c b/lib/utils.c

Re: [Libguestfs] another GTK3 regression...

2022-09-28 Thread Daniel P . Berrangé
On Wed, Sep 28, 2022 at 02:01:11PM +0200, Laszlo Ersek wrote: > (this reproduces at commit 0687cea6a86e; IOW the regression is not from > the recent GTK-related patches, but due to building p2v with GTK3. as > opposed to GTK2) > > In the first dialog, when the Test Connection button is clicked, a

[Libguestfs] [PATCH libnbd v3 0/6] Additional non-NULL warnings, checks and docs

2022-09-28 Thread Richard W.M. Jones
v2: https://listman.redhat.com/archives/libguestfs/2022-September/030014.html I didn't think this would need a v3, but here we are. The first patch (also a new patch) appears to fix a bug in Eric's earlier series to do with meta queries. It's not possible to call the new APIs with queries ==

[Libguestfs] [PATCH libnbd v3 5/6] generator: Document non-NULL behaviour of some parameters

2022-09-28 Thread Richard W.M. Jones
In the C API documentation mention the potential problems of calling non-nullable parameters with NULL. Usually an error is returned, but warnings and worse might happen too. Thanks: Eric Blake Acked-by: Laszlo Ersek --- docs/libnbd.pod | 18 ++ generator/C.ml | 21

[Libguestfs] [PATCH libnbd v3 2/6] generator: Add attribute((nonnull)) annotations to non-NULL parameters

2022-09-28 Thread Richard W.M. Jones
For API parameters that are pointers and must not be NULL, add the appropriate GCC annotations. Reviewed-by: Laszlo Ersek --- generator/C.ml | 59 +++-- tests/errors-connect-null.c | 4 +++ 2 files changed, 61 insertions(+), 2 deletions(-) diff

[Libguestfs] [PATCH libnbd v3 4/6] generator: Check that more parameters are not NULL

2022-09-28 Thread Richard W.M. Jones
We previously checked only that String parameters are not NULL, returning an error + EFAULT if so. However we did not check Bytes*, SockAddrAndLen, Path or StringList parameters, also never NULL. Be consistent about checks. Thanks: Eric Blake for help and an earlier version of the patch ---

[Libguestfs] [PATCH libnbd v3 3/6] lib/internal.h: Mark various internal functions with attribute((nonnull))

2022-09-28 Thread Richard W.M. Jones
--- lib/internal.h | 75 +- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/lib/internal.h b/lib/internal.h index 7896b1d5ca..fb15ada1c3 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -384,20 +384,27 @@ struct command { }

Re: [Libguestfs] [p2v PATCH 2/2] remove old GLIB2 / GTK3 compat code

2022-09-28 Thread Richard W.M. Jones
For the series: Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from

[Libguestfs] [PATCH libnbd v3 1/6] lib/opt: Don't use NULL for an empty StringList

2022-09-28 Thread Richard W.M. Jones
StringList parameters (char ** in C) will be marked with __attribute__((nonnull)). To pass an empty list you have to use a list containing a single NULL element, not a NULL pointer. nbd_internal_set_querylist has also been adjusted. Fixes: commit e33762a86cd5f064e5ef841520baa5fe7361d2c2 ---

Re: [Libguestfs] [PATCH libnbd v2 2/4] generator: Check that more parameters are not NULL

2022-09-28 Thread Richard W.M. Jones
On Wed, Sep 28, 2022 at 12:47:24PM +0200, Laszlo Ersek wrote: > On 09/28/22 11:30, Richard W.M. Jones wrote: > > We previously checked only that String parameters are not NULL, > > returning an error + EFAULT if so. > > > > However we did not check Bytes*, SockAddrAndLen, Path or StringList > >

Re: [Libguestfs] another GTK3 regression...

2022-09-28 Thread Richard W.M. Jones
On Wed, Sep 28, 2022 at 02:01:11PM +0200, Laszlo Ersek wrote: > (this reproduces at commit 0687cea6a86e; IOW the regression is not from > the recent GTK-related patches, but due to building p2v with GTK3. as > opposed to GTK2) > > In the first dialog, when the Test Connection button is clicked, a

Re: [Libguestfs] [p2v PATCH 1/2] require GLIB2 >= 2.56 and GTK3 >= 3.22; enhance API compatibility

2022-09-28 Thread Daniel P . Berrangé
On Wed, Sep 28, 2022 at 02:06:49PM +0200, Laszlo Ersek wrote: > For further simplifying virt-p2v's GTK API usage, require the GLIB2 and > GTK3 versions that RHEL7 provides. > > The MIN_REQUIRED= macros elicit warnings if we use an API that > was already deprecated in said version of the given

Re: [Libguestfs] test message, please ignore...

2022-09-28 Thread Laszlo Ersek
On 09/28/22 14:37, Laszlo Ersek wrote: > (I'm trying to figure out why the patch set I just posted isn't > appearing in my mailbox and in the web archive. Did I mess up the > sending, or is the list software having a bad day?) > ... the latter; apparently.

[Libguestfs] test message, please ignore...

2022-09-28 Thread Laszlo Ersek
(I'm trying to figure out why the patch set I just posted isn't appearing in my mailbox and in the web archive. Did I mess up the sending, or is the list software having a bad day?) ___ Libguestfs mailing list Libguestfs@redhat.com

[Libguestfs] [p2v PATCH 0/2] restrict supported GLIB2 and GTK3 versions

2022-09-28 Thread Laszlo Ersek
Remove GTK3 compat code that is not needed on RHEL7+. Incorporate suggestions from Rich and Daniel in the subthread at . Do not remove "gui-gtk3-compat.h" altogether; I expect we may have to add in new compat stuff in the

[Libguestfs] [p2v PATCH 2/2] remove old GLIB2 / GTK3 compat code

2022-09-28 Thread Laszlo Ersek
Open-code conditional compilation directives that evaluate to constant values when virt-p2v is built with GLIB >= 2.56 and GTK >= 3.22. Signed-off-by: Laszlo Ersek --- gui-gtk3-compat.h | 46 - gui.c | 69 ++-- 2 files changed, 4 insertions(+), 111

[Libguestfs] [p2v PATCH 1/2] require GLIB2 >= 2.56 and GTK3 >= 3.22; enhance API compatibility

2022-09-28 Thread Laszlo Ersek
For further simplifying virt-p2v's GTK API usage, require the GLIB2 and GTK3 versions that RHEL7 provides. The MIN_REQUIRED= macros elicit warnings if we use an API that was already deprecated in said version of the given library. The MAX_ALLOWED= macros make sure we don't unwittingly use an API

[Libguestfs] another GTK3 regression...

2022-09-28 Thread Laszlo Ersek
(this reproduces at commit 0687cea6a86e; IOW the regression is not from the recent GTK-related patches, but due to building p2v with GTK3. as opposed to GTK2) In the first dialog, when the Test Connection button is clicked, a spinner is supposed to be shown to the left, while p2v communicates via

Re: [Libguestfs] [PATCH libnbd v2 4/4] lib/utils.c: Assert that argv != NULL and add comments

2022-09-28 Thread Laszlo Ersek
On 09/28/22 11:30, Richard W.M. Jones wrote: > Change check into an assertion, and add detailed comments explaining > our assumptions. > > Updates: commit d0fbb769286a97728b0d1358e7accc2eb708d795 > --- > lib/utils.c | 14 -- > 1 file changed, 12 insertions(+), 2 deletions(-) > >

Re: [Libguestfs] [PATCH libnbd v2 3/4] generator: Document non-NULL behaviour of some parameters

2022-09-28 Thread Laszlo Ersek
On 09/28/22 11:30, Richard W.M. Jones wrote: > In the C API documentation mention the potential problems of calling > non-nullable parameters with NULL. Usually an error is returned, but > warnings and worse might happen too. > > Thanks: Eric Blake > --- > docs/libnbd.pod | 18

Re: [Libguestfs] [PATCH libnbd v2 2/4] generator: Check that more parameters are not NULL

2022-09-28 Thread Laszlo Ersek
On 09/28/22 11:30, Richard W.M. Jones wrote: > We previously checked only that String parameters are not NULL, > returning an error + EFAULT if so. > > However we did not check Bytes*, SockAddrAndLen, Path or StringList > parameters, also never NULL. Be consistent about checks. > > Thanks: Eric

Re: [Libguestfs] [PATCH libnbd v2 1/4] generator: Add attribute((nonnull)) annotations to non-NULL parameters

2022-09-28 Thread Laszlo Ersek
On 09/28/22 11:30, Richard W.M. Jones wrote: > For API parameters that are pointers and must not be NULL, add the > appropriate GCC annotations. These are only enabled in very recent > GCC (>= 12) because we have concerns with earlier versions, see for > example:

[Libguestfs] [PATCH libnbd v2 4/4] lib/utils.c: Assert that argv != NULL and add comments

2022-09-28 Thread Richard W.M. Jones
Change check into an assertion, and add detailed comments explaining our assumptions. Updates: commit d0fbb769286a97728b0d1358e7accc2eb708d795 --- lib/utils.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/utils.c b/lib/utils.c index

[Libguestfs] [PATCH libnbd v2 1/4] generator: Add attribute((nonnull)) annotations to non-NULL parameters

2022-09-28 Thread Richard W.M. Jones
For API parameters that are pointers and must not be NULL, add the appropriate GCC annotations. These are only enabled in very recent GCC (>= 12) because we have concerns with earlier versions, see for example: https://bugzilla.redhat.com/show_bug.cgi?id=1041336 --- generator/C.ml | 53

[Libguestfs] [PATCH libnbd v2 2/4] generator: Check that more parameters are not NULL

2022-09-28 Thread Richard W.M. Jones
We previously checked only that String parameters are not NULL, returning an error + EFAULT if so. However we did not check Bytes*, SockAddrAndLen, Path or StringList parameters, also never NULL. Be consistent about checks. Thanks: Eric Blake for help and an earlier version of the patch ---

[Libguestfs] [PATCH libnbd v2 3/4] generator: Document non-NULL behaviour of some parameters

2022-09-28 Thread Richard W.M. Jones
In the C API documentation mention the potential problems of calling non-nullable parameters with NULL. Usually an error is returned, but warnings and worse might happen too. Thanks: Eric Blake --- docs/libnbd.pod | 18 ++ generator/C.ml | 21 + 2 files

[Libguestfs] [PATCH libnbd v2 0/4] Additional non-NULL warnings, checks and docs

2022-09-28 Thread Richard W.M. Jones
v1 was: https://listman.redhat.com/archives/libguestfs/2022-September/029982.html This series is actually quite a bit different from v1 because it is rebased on top of Eric's series and takes that into account. Generally this heads down the return error instead of asserting route, hoping that

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-28 Thread Richard W.M. Jones
On Wed, Sep 28, 2022 at 09:00:43AM +, Li, Feng F wrote: > We updated the code from Git and test it again, and confirm the issue have > been fixed . Great, thanks for testing it. Rich. > root@weibupos:/opt/intel/vddpos# du -sh /home/intel/imgStore/POS_DATA.qcow2 > 6.6G

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-28 Thread Li, Feng F
We updated the code from Git and test it again, and confirm the issue have been fixed . Thanks so much again !!! root@weibupos:/opt/intel/vddpos# du -sh /home/intel/imgStore/POS_DATA.qcow2 6.6G/home/intel/imgStore/POS_DATA.qcow2 root@weibupos:/opt/intel/vddpos# cd

Re: [Libguestfs] [PATCH libnbd 0/5] generator: Add attribute((nonnull)) annotations

2022-09-28 Thread Laszlo Ersek
On 09/27/22 20:59, Eric Blake wrote: > On Tue, Sep 27, 2022 at 06:24:17PM +0200, Laszlo Ersek wrote: >> Considering "optional list" in particular, I see no semantic difference >> between vec==NULL and vec[0]==NULL. If an optional list is expected, >> both should be tolerated; if a mandatory

Re: [Libguestfs] [p2v PATCH 7/7] gui.c: annotate GTK_INPUT_PURPOSE_PASSWORD with upstream GTK3 version

2022-09-28 Thread Laszlo Ersek
On 09/26/22 13:59, Richard W.M. Jones wrote: > > Apart from Dan's suggestions in patch 1, the series looks good to me. I've updated patch#1 (both the code and the commit message), and pushed the series (28d7ce8c9db9..94f1f9df1994), taking your above statement as an ACK (hope that's OK). Because