qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Peter Maydell" <peter.maydell@linaro.org>,
	"Andreas Färber" <afaerber@suse.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Patch Tracking <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] cpu: Clean up includes
Date: Mon, 18 Jan 2016 14:27:08 -0700	[thread overview]
Message-ID: <569D58AC.3090904@redhat.com> (raw)
In-Reply-To: <CAFEAcA9UnwUb=A==+pEAmi9kTqV211V0ufm5g5BRXNe9ZSNndg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

On 01/18/2016 11:05 AM, Peter Maydell wrote:

>>> +++ b/qom/cpu.c
>>> @@ -18,6 +18,7 @@
>>>   * <http://www.gnu.org/licenses/gpl-2.0.html>
>>>   */
>>>
>>> +#include "qemu/osdep.h"
>>>  #include "qemu-common.h"
>>
>> Shouldn't qemu-common.h include osdep.h?
> 
> It does, but the intention is that every .c file should include
> qemu/osdep.h as its first include (even if some other include
> it has also results in osdep.h being pulled in).

Eventually, we want to force that NO .h file includes qemu/osdep.h.  If
every .c file includes it first, then all other .h files can count on it
already being included and therefore don't need to include it
themselves.  (This is comparable to the rule used in other projects,
like libvirt's handling of config.h which must be first in all .c files
and must not be included in .h files).

> This is a simple
> rule that's easy to check in code review and hopefully also
> in an automated way.

Indeed - we MUST turn on automation after all these individual patches
are in, to make sure we don't regress (again, something that libvirt has
already managed to do, so it shouldn't be too hard to automate, except
that libvirt's automation is courtesy of gnulib which we don't use here).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

      reply	other threads:[~2016-01-18 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18 17:35 [Qemu-devel] [PATCH] cpu: Clean up includes Peter Maydell
2016-01-18 18:00 ` Andreas Färber
2016-01-18 18:05   ` Peter Maydell
2016-01-18 21:27     ` Eric Blake [this message]

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=569D58AC.3090904@redhat.com \
    --to=eblake@redhat.com \
    --cc=afaerber@suse.de \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).