[PATCH v4 00/12] Compiler warning fixes for libvhost-user,libvduse

Marcel Holtmann posted 12 patches 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1671741278.git.marcel@holtmann.org
Maintainers: Xie Yongji <xieyongji@bytedance.com>, "Michael S. Tsirkin" <mst@redhat.com>
subprojects/libvduse/libvduse.c           |  9 ++++--
subprojects/libvduse/meson.build          |  8 ++++-
subprojects/libvhost-user/libvhost-user.c | 36 +++++++++++++----------
subprojects/libvhost-user/meson.build     |  8 ++++-
4 files changed, 42 insertions(+), 19 deletions(-)
[PATCH v4 00/12] Compiler warning fixes for libvhost-user,libvduse
Posted by Marcel Holtmann 1 year, 4 months ago
The libvhost-user and libvduse libraries are also useful for external
usage outside of QEMU and thus it would be nice if their files could
be just copied and used. However due to different compiler settings, a
lot of manual fixups are needed. This is the first attempt at some
obvious fixes that can be done without any harm to the code and its
readability.

Marcel Holtmann (12):
  libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
  libvhost-user: Replace typeof with __typeof__
  libvhost-user: Cast rc variable to avoid compiler warning
  libvhost-user: Use unsigned int i for some for-loop iterations
  libvhost-user: Declare uffdio_register early to make it C90 compliant
  libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant
  libvduse: Provide _GNU_SOURCE when compiling outside of QEMU
  libvduse: Switch to unsigned int for inuse field in struct VduseVirtq
  libvduse: Fix assignment in vring_set_avail_event
  libvhost-user: Fix assignment in vring_set_avail_event
  libvhost-user: Add extra compiler warnings
  libvduse: Add extra compiler warnings

 subprojects/libvduse/libvduse.c           |  9 ++++--
 subprojects/libvduse/meson.build          |  8 ++++-
 subprojects/libvhost-user/libvhost-user.c | 36 +++++++++++++----------
 subprojects/libvhost-user/meson.build     |  8 ++++-
 4 files changed, 42 insertions(+), 19 deletions(-)

-- 
2.38.1
Re: [PATCH v4 00/12] Compiler warning fixes for libvhost-user,libvduse
Posted by Paolo Bonzini 1 year, 4 months ago
On 12/22/22 21:36, Marcel Holtmann wrote:
> The libvhost-user and libvduse libraries are also useful for external
> usage outside of QEMU and thus it would be nice if their files could
> be just copied and used. However due to different compiler settings, a
> lot of manual fixups are needed. This is the first attempt at some
> obvious fixes that can be done without any harm to the code and its
> readability.
> 
> Marcel Holtmann (12):
>    libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
>    libvhost-user: Replace typeof with __typeof__
>    libvhost-user: Cast rc variable to avoid compiler warning
>    libvhost-user: Use unsigned int i for some for-loop iterations
>    libvhost-user: Declare uffdio_register early to make it C90 compliant
>    libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant
>    libvduse: Provide _GNU_SOURCE when compiling outside of QEMU
>    libvduse: Switch to unsigned int for inuse field in struct VduseVirtq
>    libvduse: Fix assignment in vring_set_avail_event
>    libvhost-user: Fix assignment in vring_set_avail_event
>    libvhost-user: Add extra compiler warnings
>    libvduse: Add extra compiler warnings
> 
>   subprojects/libvduse/libvduse.c           |  9 ++++--
>   subprojects/libvduse/meson.build          |  8 ++++-
>   subprojects/libvhost-user/libvhost-user.c | 36 +++++++++++++----------
>   subprojects/libvhost-user/meson.build     |  8 ++++-
>   4 files changed, 42 insertions(+), 19 deletions(-)
> 

Looks good, but what happened to "libvhost-user: Switch to unsigned int 
for inuse field in struct VuVirtq"?

(I can pick it up from v3, no need to respin).

Paolo
Re: [PATCH v4 00/12] Compiler warning fixes for libvhost-user,libvduse
Posted by Michael S. Tsirkin 1 year, 4 months ago
On Fri, Dec 23, 2022 at 04:21:33PM +0100, Paolo Bonzini wrote:
> On 12/22/22 21:36, Marcel Holtmann wrote:
> > The libvhost-user and libvduse libraries are also useful for external
> > usage outside of QEMU and thus it would be nice if their files could
> > be just copied and used. However due to different compiler settings, a
> > lot of manual fixups are needed. This is the first attempt at some
> > obvious fixes that can be done without any harm to the code and its
> > readability.
> > 
> > Marcel Holtmann (12):
> >    libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
> >    libvhost-user: Replace typeof with __typeof__
> >    libvhost-user: Cast rc variable to avoid compiler warning
> >    libvhost-user: Use unsigned int i for some for-loop iterations
> >    libvhost-user: Declare uffdio_register early to make it C90 compliant
> >    libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant
> >    libvduse: Provide _GNU_SOURCE when compiling outside of QEMU
> >    libvduse: Switch to unsigned int for inuse field in struct VduseVirtq
> >    libvduse: Fix assignment in vring_set_avail_event
> >    libvhost-user: Fix assignment in vring_set_avail_event
> >    libvhost-user: Add extra compiler warnings
> >    libvduse: Add extra compiler warnings
> > 
> >   subprojects/libvduse/libvduse.c           |  9 ++++--
> >   subprojects/libvduse/meson.build          |  8 ++++-
> >   subprojects/libvhost-user/libvhost-user.c | 36 +++++++++++++----------
> >   subprojects/libvhost-user/meson.build     |  8 ++++-
> >   4 files changed, 42 insertions(+), 19 deletions(-)
> > 
> 
> Looks good, but what happened to "libvhost-user: Switch to unsigned int for
> inuse field in struct VuVirtq"?
> 
> (I can pick it up from v3, no need to respin).
> 
> Paolo

I merged that one IIRC.
Paolo I wandered whether if you are going to be merging patches in these
areas you wanted to be added to MAINTAINERS.

-- 
MST
Re: [PATCH v4 00/12] Compiler warning fixes for libvhost-user,libvduse
Posted by Marcel Holtmann 1 year, 4 months ago
Hi Paolo,

>> The libvhost-user and libvduse libraries are also useful for external
>> usage outside of QEMU and thus it would be nice if their files could
>> be just copied and used. However due to different compiler settings, a
>> lot of manual fixups are needed. This is the first attempt at some
>> obvious fixes that can be done without any harm to the code and its
>> readability.
>> Marcel Holtmann (12):
>>   libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
>>   libvhost-user: Replace typeof with __typeof__
>>   libvhost-user: Cast rc variable to avoid compiler warning
>>   libvhost-user: Use unsigned int i for some for-loop iterations
>>   libvhost-user: Declare uffdio_register early to make it C90 compliant
>>   libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant
>>   libvduse: Provide _GNU_SOURCE when compiling outside of QEMU
>>   libvduse: Switch to unsigned int for inuse field in struct VduseVirtq
>>   libvduse: Fix assignment in vring_set_avail_event
>>   libvhost-user: Fix assignment in vring_set_avail_event
>>   libvhost-user: Add extra compiler warnings
>>   libvduse: Add extra compiler warnings
>>  subprojects/libvduse/libvduse.c           |  9 ++++--
>>  subprojects/libvduse/meson.build          |  8 ++++-
>>  subprojects/libvhost-user/libvhost-user.c | 36 +++++++++++++----------
>>  subprojects/libvhost-user/meson.build     |  8 ++++-
>>  4 files changed, 42 insertions(+), 19 deletions(-)
> 
> Looks good, but what happened to "libvhost-user: Switch to unsigned int for inuse field in struct VuVirtq"?
> 
> (I can pick it up from v3, no need to respin).

I found that it was already upstream and thus I removed it.

Regards

Marcel
Re: [PATCH v4 00/12] Compiler warning fixes for libvhost-user,libvduse
Posted by Michael S. Tsirkin 1 year, 3 months ago
On Thu, Dec 22, 2022 at 09:36:39PM +0100, Marcel Holtmann wrote:
> The libvhost-user and libvduse libraries are also useful for external
> usage outside of QEMU and thus it would be nice if their files could
> be just copied and used. However due to different compiler settings, a
> lot of manual fixups are needed. This is the first attempt at some
> obvious fixes that can be done without any harm to the code and its
> readability.
> 
> Marcel Holtmann (12):
>   libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU
>   libvhost-user: Replace typeof with __typeof__
>   libvhost-user: Cast rc variable to avoid compiler warning
>   libvhost-user: Use unsigned int i for some for-loop iterations
>   libvhost-user: Declare uffdio_register early to make it C90 compliant
>   libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant
>   libvduse: Provide _GNU_SOURCE when compiling outside of QEMU
>   libvduse: Switch to unsigned int for inuse field in struct VduseVirtq
>   libvduse: Fix assignment in vring_set_avail_event
>   libvhost-user: Fix assignment in vring_set_avail_event
>   libvhost-user: Add extra compiler warnings
>   libvduse: Add extra compiler warnings


series looks good to me.

Paolo I understand you are merging this?

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

>  subprojects/libvduse/libvduse.c           |  9 ++++--
>  subprojects/libvduse/meson.build          |  8 ++++-
>  subprojects/libvhost-user/libvhost-user.c | 36 +++++++++++++----------
>  subprojects/libvhost-user/meson.build     |  8 ++++-
>  4 files changed, 42 insertions(+), 19 deletions(-)
> 
> -- 
> 2.38.1
> 
> 
>
Re: [PATCH v4 00/12] Compiler warning fixes for libvhost-user, libvduse
Posted by Paolo Bonzini 1 year, 3 months ago
Il gio 5 gen 2023, 02:58 Michael S. Tsirkin <mst@redhat.com> ha scritto:

> Paolo I understand you are merging this?
>

It would be fine either way; when I find issues in a series I tend to queue
it just in case the other maintainer prefers to leave further handling to
me. In this case it caught my eye due to the meson.build implications.

Anyhow I have already passed it through CI (a bit slow due to the holidays)
and will send the PR today or tomorrow.

Paolo


> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
>
> >  subprojects/libvduse/libvduse.c           |  9 ++++--
> >  subprojects/libvduse/meson.build          |  8 ++++-
> >  subprojects/libvhost-user/libvhost-user.c | 36 +++++++++++++----------
> >  subprojects/libvhost-user/meson.build     |  8 ++++-
> >  4 files changed, 42 insertions(+), 19 deletions(-)
> >
> > --
> > 2.38.1
> >
> >
> >
>
>