qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] c5f1d0: util: remove redundant include of gli


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] c5f1d0: util: remove redundant include of glib.h and add o...
Date: Fri, 29 Jun 2018 08:55:55 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: c5f1d0c493f29f0137fbd79a2c6653f8546f2044
      
https://github.com/qemu/qemu/commit/c5f1d0c493f29f0137fbd79a2c6653f8546f2044
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2018-06-29 (Fri, 29 Jun 2018)

  Changed paths:
    M include/qemu/iova-tree.h
    M util/iova-tree.c

  Log Message:
  -----------
  util: remove redundant include of glib.h and add osdep.h

Code must only ever include glib.h indirectly via the glib-compat.h
header file, because we will need some macros set before glib.h is
pulled in. Adding extra includes of glib.h will (soon) cause compile
failures such as:

In file included from /home/berrange/src/virt/qemu/include/qemu/osdep.h:107,
           from /home/berrange/src/virt/qemu/include/qemu/iova-tree.h:26,
           from util/iova-tree.c:13:
/home/berrange/src/virt/qemu/include/glib-compat.h:22: error: 
"GLIB_VERSION_MIN_REQUIRED" redefined [-Werror]
 #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_40

In file included from /usr/include/glib-2.0/glib/gtypes.h:34,
           from /usr/include/glib-2.0/glib/galloca.h:32,
           from /usr/include/glib-2.0/glib.h:30,
           from util/iova-tree.c:12:
/usr/include/glib-2.0/glib/gversionmacros.h:237: note: this is the location of 
the previous definition
 # define GLIB_VERSION_MIN_REQUIRED      (GLIB_VERSION_CUR_STABLE)

Furthermore, the osdep.h include should always be done directly from the
.c file rather than indirectly via any .h file.

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>


  Commit: e7b3af81597db1a6b55f2c15d030d703c6b2c6ac
      
https://github.com/qemu/qemu/commit/e7b3af81597db1a6b55f2c15d030d703c6b2c6ac
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2018-06-29 (Fri, 29 Jun 2018)

  Changed paths:
    M configure
    M crypto/hash-glib.c
    M crypto/hmac-glib.c
    M include/glib-compat.h
    M qga/commands.c
    R tests/docker/dockerfiles/centos6.docker
    R tests/docker/dockerfiles/min-glib.docker
    M tests/ivshmem-test.c
    M tests/test-qmp-event.c
    M tests/tpm-emu.h
    M tests/vhost-user-test.c
    M trace/simple.c
    M util/osdep.c

  Log Message:
  -----------
  glib: bump min required glib library version to 2.40

Per supported platforms doc[1], the various min glib on relevant distros is:

  RHEL-7: 2.50.3
  Debian (Stretch): 2.50.3
  Debian (Jessie): 2.42.1
  OpenBSD (Ports): 2.54.3
  FreeBSD (Ports): 2.50.3
  OpenSUSE Leap 15: 2.54.3
  SLE12-SP2: 2.48.2
  Ubuntu (Xenial): 2.48.0
  macOS (Homebrew): 2.56.0

This suggests that a minimum glib of 2.42 is a reasonable target.

The GLibC compile farm, however, uses Ubuntu 14.04 (Trusty) which only
has glib 2.40.0, and this is needed for testing during merge. Thus an
exception is made to the documented platform support policy to allow for
all three current LTS releases to be supported.

Docker jobs that not longer satisfy this new min version are removed.

[1] https://qemu.weilnetz.de/doc/qemu-doc.html#Supported-build-platforms

Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>


  Commit: e71e8cc035558eabd6b3e19f6d3254c754c027ef
      
https://github.com/qemu/qemu/commit/e71e8cc035558eabd6b3e19f6d3254c754c027ef
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2018-06-29 (Fri, 29 Jun 2018)

  Changed paths:
    M include/glib-compat.h
    M tests/test-qga.c

  Log Message:
  -----------
  glib: enforce the minimum required version and warn about old APIs

There are two useful macros that can be defined before including
glib.h that are related to the min required glib version

 - GLIB_VERSION_MIN_REQUIRED

   When this is defined, if code uses an API that was deprecated
   in this version, or older, a compiler warning will be emitted.
   This alerts maintainers to update their code to whatever new
   replacement API is now recommended best practice.

 - GLIB_VERSION_MAX_ALLOWED

   When this is defined, if code uses an API that was introduced
   in a version that is newer than the declared version, a compiler
   warning will be emitted. This alerts maintainers if new code
   accidentally uses functionality that won't be available on some
   supported platforms.

The GLIB_VERSION_MAX_ALLOWED constant makes it a bit harder to opt
in to using specific new APIs with a GLIB_CHECK_VERSION conditional.
To workaround this Pragmas can be used to temporarily turn off the
-Wdeprecated-declarations compiler warning, while a static inline
compat function is implemented. This workaround is illustrated with the
implementation of the g_strv_contains method to satisfy the test suite.

Signed-off-by: Daniel P. Berrangé <address@hidden>


  Commit: 75507f1aba6feb73ae43329922d51571550b9128
      
https://github.com/qemu/qemu/commit/75507f1aba6feb73ae43329922d51571550b9128
  Author: Peter Maydell <address@hidden>
  Date:   2018-06-29 (Fri, 29 Jun 2018)

  Changed paths:
    M configure
    M crypto/hash-glib.c
    M crypto/hmac-glib.c
    M include/glib-compat.h
    M include/qemu/iova-tree.h
    M qga/commands.c
    R tests/docker/dockerfiles/centos6.docker
    R tests/docker/dockerfiles/min-glib.docker
    M tests/ivshmem-test.c
    M tests/test-qga.c
    M tests/test-qmp-event.c
    M tests/tpm-emu.h
    M tests/vhost-user-test.c
    M trace/simple.c
    M util/iova-tree.c
    M util/osdep.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/berrange/tags/min-glib-pull-request' 
into staging

glib: update the min required version

This updates the minimum required glib version to 2.40

# gpg: Signature made Fri 29 Jun 2018 12:24:58 BST
# gpg:                using RSA key BE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <address@hidden>"
# gpg:                 aka "Daniel P. Berrange <address@hidden>"
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/min-glib-pull-request:
  glib: enforce the minimum required version and warn about old APIs
  glib: bump min required glib library version to 2.40
  util: remove redundant include of glib.h and add osdep.h

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/109b25045b36...75507f1aba6f
      **NOTE:** This service been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]