qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Olaf Hering" <olaf@aepfle.de>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Thomas Huth" <thuth@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/3] util: remove redundant include of glib.h
Date: Thu, 7 Jun 2018 11:58:05 +0800	[thread overview]
Message-ID: <20180607035805.GH7815@xz-mi> (raw)
In-Reply-To: <CAFEAcA-_e7mMB07fOCN6qmm-9YTPG2HSMJ3-z=0wRHaa+uTteA@mail.gmail.com>

On Wed, Jun 06, 2018 at 07:31:53PM +0100, Peter Maydell wrote:
> On 6 June 2018 at 18:32, Daniel P. Berrangé <berrange@redhat.com> wrote:
> > 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)
> >
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >  util/iova-tree.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/util/iova-tree.c b/util/iova-tree.c
> > index 2d9cebfc89..d39cd8bb29 100644
> > --- a/util/iova-tree.c
> > +++ b/util/iova-tree.c
> > @@ -9,7 +9,6 @@
> >   * This work is licensed under the terms of the GNU GPL, version 2 or later.
> >   */
> >
> > -#include <glib.h>
> >  #include "qemu/iova-tree.h"
> 
> While we're fixing up the headers in this file:
> it should start with an include of qemu/osdep.h,
> and qemu/iova-tree.h should not include osdep.h...

Sorry to messed this up.  It was used for hwaddr definition.

Maybe we can just replace hwaddr usage in iova-tree.[ch] with
something like uint64_t?  Then I think we can drop the osdep.h.

Regards,

-- 
Peter Xu

  reply	other threads:[~2018-06-07  3:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 17:32 [Qemu-devel] [PATCH v2 0/3] glib: update the min required version Daniel P. Berrangé
2018-06-06 17:32 ` [Qemu-devel] [PATCH v2 1/3] glib: bump min required glib library version to 2.40 Daniel P. Berrangé
2018-06-06 18:12   ` John Snow
2018-06-07  8:25     ` Daniel P. Berrangé
2018-06-07  8:28       ` Olaf Hering
2018-06-08 13:13         ` Daniel P. Berrangé
2018-06-07  5:46   ` Thomas Huth
2018-06-06 17:32 ` [Qemu-devel] [PATCH v2 2/3] glib: enforce the minimum required version and warn about old APIs Daniel P. Berrangé
2018-06-07  8:57   ` Thomas Huth
2018-06-07  9:23     ` Daniel P. Berrangé
2018-06-06 17:32 ` [Qemu-devel] [PATCH v2 3/3] util: remove redundant include of glib.h Daniel P. Berrangé
2018-06-06 17:45   ` Philippe Mathieu-Daudé
2018-06-06 18:31   ` Peter Maydell
2018-06-07  3:58     ` Peter Xu [this message]
2018-06-07  7:05       ` Markus Armbruster
2018-06-07  7:44         ` Peter Xu
2018-06-07  8:26           ` Daniel P. Berrangé
2018-06-07  8:35             ` Peter Xu
2018-06-07  8:44   ` Thomas Huth
2018-06-07  8:47     ` Daniel P. Berrangé
2018-06-08 12:00 ` [Qemu-devel] [PATCH v2 0/3] glib: update the min required version Peter Maydell
2018-06-08 16:18   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180607035805.GH7815@xz-mi \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=olaf@aepfle.de \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).