[libvirt] [PATCH v2 0/5] Misc cleanups for internal.h & fix tests with CLang

Daniel P. Berrange posted 5 patches 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170705115851.13792-1-berrange@redhat.com
build-aux/mock-noinline.pl             |   2 +-
config-post.h                          |  24 ++---
src/check-symfile.pl                   |   2 +-
src/internal.h                         | 173 ++++++++++-----------------------
src/libxl/libxl_conf.c                 |   1 +
src/nwfilter/nwfilter_dhcpsnoop.c      |   1 +
src/nwfilter/nwfilter_gentech_driver.c |   1 +
src/qemu/qemu_capspriv.h               |   2 +-
src/qemu/qemu_conf.c                   |   1 +
src/rpc/virnetsocket.h                 |   4 +-
src/util/vircommand.h                  |   2 +-
src/util/vircrypto.h                   |   2 +-
src/util/virfile.h                     |   2 +-
src/util/virhostcpu.h                  |   4 +-
src/util/virmacaddr.h                  |   2 +-
src/util/virnetdev.h                   |   8 +-
src/util/virnetdevip.h                 |   2 +-
src/util/virnetdevopenvswitch.h        |   2 +-
src/util/virnetdevtap.h                |   6 +-
src/util/virnuma.h                     |  16 +--
src/util/virrandom.h                   |   6 +-
src/util/virscsi.h                     |   2 +-
src/util/virscsivhost.h                |   2 +-
src/util/virsocketaddr.h               |  16 +++
src/util/virtpm.h                      |   2 +-
src/util/virutil.c                     |   1 +
src/util/virutil.h                     |  10 +-
src/util/viruuid.h                     |   2 +-
src/vz/vz_sdk.c                        |   1 +
src/xen/xen_hypervisor.c               |   6 +-
src/xen/xend_internal.c                |   6 +-
31 files changed, 135 insertions(+), 176 deletions(-)
[libvirt] [PATCH v2 0/5] Misc cleanups for internal.h & fix tests with CLang
Posted by Daniel P. Berrange 6 years, 9 months ago
When writing the fix for test suite mocking under CLang I found a
bunch of cruft in internal.h The first four patches thus cleanup
up internal.h. We then add the extra annotations requird to prevent
CLang optimizer breaking mock overrides.

Changed in v2:

 - Fixed version check to find clang
 - Use 'printf' instead of 'gnu_printf' on clang still
 - Addd fix for mock functions under clang

Daniel P. Berrange (5):
  Remove duplicate define of __GNUC_PREREQ
  Require use of GCC 4.4 or CLang compilers
  Remove network constants out of internal.h
  Remove incorrectly used TODO macro
  Prevent more compiler optimization of mockable functions

 build-aux/mock-noinline.pl             |   2 +-
 config-post.h                          |  24 ++---
 src/check-symfile.pl                   |   2 +-
 src/internal.h                         | 173 ++++++++++-----------------------
 src/libxl/libxl_conf.c                 |   1 +
 src/nwfilter/nwfilter_dhcpsnoop.c      |   1 +
 src/nwfilter/nwfilter_gentech_driver.c |   1 +
 src/qemu/qemu_capspriv.h               |   2 +-
 src/qemu/qemu_conf.c                   |   1 +
 src/rpc/virnetsocket.h                 |   4 +-
 src/util/vircommand.h                  |   2 +-
 src/util/vircrypto.h                   |   2 +-
 src/util/virfile.h                     |   2 +-
 src/util/virhostcpu.h                  |   4 +-
 src/util/virmacaddr.h                  |   2 +-
 src/util/virnetdev.h                   |   8 +-
 src/util/virnetdevip.h                 |   2 +-
 src/util/virnetdevopenvswitch.h        |   2 +-
 src/util/virnetdevtap.h                |   6 +-
 src/util/virnuma.h                     |  16 +--
 src/util/virrandom.h                   |   6 +-
 src/util/virscsi.h                     |   2 +-
 src/util/virscsivhost.h                |   2 +-
 src/util/virsocketaddr.h               |  16 +++
 src/util/virtpm.h                      |   2 +-
 src/util/virutil.c                     |   1 +
 src/util/virutil.h                     |  10 +-
 src/util/viruuid.h                     |   2 +-
 src/vz/vz_sdk.c                        |   1 +
 src/xen/xen_hypervisor.c               |   6 +-
 src/xen/xend_internal.c                |   6 +-
 31 files changed, 135 insertions(+), 176 deletions(-)

-- 
2.9.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 0/5] Misc cleanups for internal.h & fix tests with CLang
Posted by Roman Bogorodskiy 6 years, 9 months ago
  Daniel P. Berrange wrote:

> When writing the fix for test suite mocking under CLang I found a
> bunch of cruft in internal.h The first four patches thus cleanup
> up internal.h. We then add the extra annotations requird to prevent
> CLang optimizer breaking mock overrides.
> 
> Changed in v2:
> 
>  - Fixed version check to find clang
>  - Use 'printf' instead of 'gnu_printf' on clang still
>  - Addd fix for mock functions under clang
> 
> Daniel P. Berrange (5):
>   Remove duplicate define of __GNUC_PREREQ
>   Require use of GCC 4.4 or CLang compilers
>   Remove network constants out of internal.h
>   Remove incorrectly used TODO macro
>   Prevent more compiler optimization of mockable functions
> 
>  build-aux/mock-noinline.pl             |   2 +-
>  config-post.h                          |  24 ++---
>  src/check-symfile.pl                   |   2 +-
>  src/internal.h                         | 173 ++++++++++-----------------------
>  src/libxl/libxl_conf.c                 |   1 +
>  src/nwfilter/nwfilter_dhcpsnoop.c      |   1 +
>  src/nwfilter/nwfilter_gentech_driver.c |   1 +
>  src/qemu/qemu_capspriv.h               |   2 +-
>  src/qemu/qemu_conf.c                   |   1 +
>  src/rpc/virnetsocket.h                 |   4 +-
>  src/util/vircommand.h                  |   2 +-
>  src/util/vircrypto.h                   |   2 +-
>  src/util/virfile.h                     |   2 +-
>  src/util/virhostcpu.h                  |   4 +-
>  src/util/virmacaddr.h                  |   2 +-
>  src/util/virnetdev.h                   |   8 +-
>  src/util/virnetdevip.h                 |   2 +-
>  src/util/virnetdevopenvswitch.h        |   2 +-
>  src/util/virnetdevtap.h                |   6 +-
>  src/util/virnuma.h                     |  16 +--
>  src/util/virrandom.h                   |   6 +-
>  src/util/virscsi.h                     |   2 +-
>  src/util/virscsivhost.h                |   2 +-
>  src/util/virsocketaddr.h               |  16 +++
>  src/util/virtpm.h                      |   2 +-
>  src/util/virutil.c                     |   1 +
>  src/util/virutil.h                     |  10 +-
>  src/util/viruuid.h                     |   2 +-
>  src/vz/vz_sdk.c                        |   1 +
>  src/xen/xen_hypervisor.c               |   6 +-
>  src/xen/xend_internal.c                |   6 +-
>  31 files changed, 135 insertions(+), 176 deletions(-)

Works fine for me with clang 3.9.1 and clang 4.0.0.

Roman Bogorodskiy
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 0/5] Misc cleanups for internal.h & fix tests with CLang
Posted by Andrea Bolognani 6 years, 9 months ago
On Wed, 2017-07-05 at 12:58 +0100, Daniel P. Berrange wrote:
> When writing the fix for test suite mocking under CLang I found a
> bunch of cruft in internal.h The first four patches thus cleanup
> up internal.h. We then add the extra annotations requird to prevent
> CLang optimizer breaking mock overrides.

A very minor detail that I feel compelled to point out
regardless: it's Clang, not CLang. Please use the proper
capitalization, if not in the commit messages at the very
least in the error messages you introduce in patch 2/5.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list