All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>, Fam Zheng <famz@redhat.com>
Cc: kwolf@redhat.com, Venkatesha.Mg@veritas.com,
	ashish.mittal@veritas.com, jcody@redhat.com,
	qemu-devel@nongnu.org, Rakesh.Ranjan@veritas.com,
	armbru@redhat.com, Ketan.Nilangekar@veritas.com,
	Abhijit.Dey@veritas.com, pbonzini@redhat.com,
	Buddhi.Madhav@veritas.com, Ashish Mittal <ashmit602@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v6 1/2] block/vxhs.c: Add support for a new block device type called "vxhs"
Date: Tue, 15 Nov 2016 09:52:20 -0600	[thread overview]
Message-ID: <bee01cd5-b560-6113-052f-fc96cc9e60d3@redhat.com> (raw)
In-Reply-To: <20161115101850.GA4836@stefanha-x1.localdomain>

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

On 11/15/2016 04:18 AM, Stefan Hajnoczi wrote:
> On Tue, Nov 15, 2016 at 10:04:05AM +0800, Fam Zheng wrote:
>> On Mon, 11/14 13:06, Eric Blake wrote:
>>> So I guess you have to determine if libqnio is something that should
>>> compile completely independent from qemu, or whether it is so closely
>>> tied to the rest of qemu that it should follow qemu conventions.
>>
>> The question is on include directives in block/vxhs.c, not libnqio library
>> header, so qemu conventions apply.
> 
> Eric: The libqnio library header is not copied into the QEMU source
> tree.  It is an external library dependency like libnfs or libglfs.
> 
> Fam, Markus: Unfortunately neither the clean-includes script nor its
> patch series cover letter explains *why* osdep.h should be included
> before system headers.

For the same reason that <config.h> should be included first before
system headers in an autoconf'd project. Many platforms ship
(semi-)broken system headers, where configure detects AND works around
the problems, but only if the workaround CONSISTENTLY happens before any
system header is included.  It is a LOT harder to track down compilation
or link or even subtle runtime failures if you don't consistently use
your workaround all the time, such that some .c files got the workaround
but others did not.

> The libqnio header is self-contained (i.e. you can #include it and it
> has no dependencies) and only used by vxhs.c.  Why is it a good idea to
> include qemu/osdep.h first?
> 
> Seems like a bad idea to me because it masks missing dependencies in the
> libqnio header.

If the libqnio header is completely independent, then it should not be
part of the qemu source tree (with "" inclusion), but should instead be
externally included (with <> inclusion), just like any other third-party
library we link against.  But even then, we STILL want our osdep.h to
occur before ANY third-party library, so that we have a CONSISTENT
environment, which is why we mandate that osdep.h be included first in
all qemu .c files.

-- 
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 --]

  parent reply	other threads:[~2016-11-15 15:52 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08  0:59 [Qemu-devel] [PATCH v6 0/2] block/vxhs: Add Veritas HyperScale VxHS block device support Ashish Mittal
2016-11-08  0:59 ` [Qemu-devel] [PATCH v6 1/2] block/vxhs.c: Add support for a new block device type called "vxhs" Ashish Mittal
2016-11-14 15:07   ` Stefan Hajnoczi
2016-11-14 15:49     ` Fam Zheng
2016-11-14 16:50       ` Stefan Hajnoczi
2016-11-14 18:03         ` Fam Zheng
2016-11-14 19:06           ` Eric Blake
2016-11-15  2:04             ` Fam Zheng
2016-11-15 10:18               ` Stefan Hajnoczi
2016-11-15 12:44                 ` Fam Zheng
2016-11-15 14:45                   ` Stefan Hajnoczi
2016-11-15 15:00                     ` Fam Zheng
2016-11-15 19:20                       ` Stefan Hajnoczi
2016-11-15 20:39                         ` ashish mittal
2016-11-15 20:40                           ` Stefan Hajnoczi
2016-11-16  9:04                           ` Markus Armbruster
2016-11-16  9:49                             ` Fam Zheng
2016-11-16 11:27                               ` Stefan Hajnoczi
2016-11-16 17:05                                 ` ashish mittal
2017-02-01  1:55                                   ` ashish mittal
2017-02-02 10:08                                     ` Stefan Hajnoczi
2017-02-08 21:23                                       ` ashish mittal
2016-11-15 15:52                 ` Eric Blake [this message]
2016-11-15  7:49       ` Markus Armbruster
2016-11-15 20:49     ` ashish mittal
2016-11-17 16:01   ` Daniel P. Berrange
2016-11-08  0:59 ` [Qemu-devel] [PATCH v6 2/2] block/vxhs.c: Add qemu-iotests for new block device type "vxhs" Ashish Mittal
2016-11-08 20:44   ` Jeff Cody
2017-02-07 23:12     ` ashish mittal
2017-02-13 13:37       ` Stefan Hajnoczi
2017-02-13 16:32         ` Jeff Cody
2017-02-13 22:36           ` Ketan Nilangekar
2017-02-13 23:23             ` Jeff Cody
2017-02-14  3:02               ` Ketan Nilangekar
2017-02-14  7:43                 ` ashish mittal
2017-02-14 16:35                   ` Jeff Cody
2017-02-14 16:51                     ` Daniel P. Berrange
2017-02-14 17:05                       ` Jeff Cody
2017-02-14 18:12   ` Jeff Cody
2017-02-14 18:28     ` ashish mittal

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=bee01cd5-b560-6113-052f-fc96cc9e60d3@redhat.com \
    --to=eblake@redhat.com \
    --cc=Abhijit.Dey@veritas.com \
    --cc=Buddhi.Madhav@veritas.com \
    --cc=Ketan.Nilangekar@veritas.com \
    --cc=Rakesh.Ranjan@veritas.com \
    --cc=Venkatesha.Mg@veritas.com \
    --cc=armbru@redhat.com \
    --cc=ashish.mittal@veritas.com \
    --cc=ashmit602@gmail.com \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.