From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
"Chen, Tiejun" <tiejun.chen@intel.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH RFC] scripts/update-linux-headers.sh: pull virtio hdrs
Date: Wed, 11 Feb 2015 13:33:43 +0100 [thread overview]
Message-ID: <20150211123343.GC4623@redhat.com> (raw)
In-Reply-To: <CAFEAcA8QFTWbBZSPjCKzEBBwWZojJL+LDKTPL_F=eCDpDHj=Zw@mail.gmail.com>
On Wed, Feb 11, 2015 at 02:12:35AM +0000, Peter Maydell wrote:
> On 9 February 2015 at 19:56, Michael S. Tsirkin <mst@redhat.com> wrote:
> > +rm -rf "$output/standard-headers/linux"
> > +mkdir -p "$output/standard-headers/linux"
> > +for f in $tmpdir/include/linux/virtio*h; do
> > + header=$(expr "$f" : '.*/\(.*\)');
> > + sed -e 's/__u\([0-9][0-9]*\)/uint\1_t/g' \
> > + -e 's/linux\/types/inttypes/' \
> > + -e 's/__bitwise__//' \
> > + "$tmpdir/include/linux/$header" > \
> > + "$output/standard-headers/linux/$header";
> > +done
>
> This doesn't seem to be doing anything to fix up
> the '__attribute__((packed))' annotations.
I don't know - what needs to be fixed up?
> Presumably you're intending to put standard-headers/
> on the include path? It would probably be better to
> not make the headers be in "linux/" in that case,
> since it would mean confusion/clashes for what
> "linux/virtio_net.h" etc mean -- are they the QEMU
> sanitized versions or the host OS's? (Having them
> in linux/ also makes code review harder since it breaks
> the current rule of thumb that is "no include of
> linux/anything in code that's not Linux-host-specific".)
Agreed, I'll change this.
> You need to strip out all the #include <linux/something.h>
> from these headers, otherwise this won't build on non
> Linux hosts.
> Then you need to add in whatever the
> equivalent is to get the defines/types those includes
> were providing (for instance our virtio-net.h does a
> simple #define of ETH_ALEN). You probably want to make
> the update script fail if there's an include it's not
> expecting to deal with, otherwise you're likely to
> end up with a set of headers that seem OK on Linux
> but fail when tested on other OSes -- better to fail
> early and for the person trying to do the header update
> than to end up with a change that won't pass my build
> tests and gets bounced.
OK, seems easy.
Will do.
> All that makes it seem to me like it's more trouble
> than it's worth compared to doing a one-time manual
> import.
>
> -- PMM
Only true if we are perfect and don't make mistakes.
If we do make mistakes, I want to fix them in one place
and propagate the fix automatically.
And since we are working on virtio 1.0 which is a huge change,
introducing mistakes seems more likely.
--
MST
next prev parent reply other threads:[~2015-02-11 12:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 19:56 [Qemu-devel] [PATCH RFC] scripts/update-linux-headers.sh: pull virtio hdrs Michael S. Tsirkin
2015-02-11 1:36 ` Chen, Tiejun
2015-02-11 2:03 ` Peter Maydell
2015-02-11 2:50 ` Chen, Tiejun
2015-02-11 3:46 ` Peter Maydell
2015-02-11 8:08 ` Chen, Tiejun
2015-02-11 12:28 ` Michael S. Tsirkin
2015-02-11 2:12 ` Peter Maydell
2015-02-11 12:33 ` Michael S. Tsirkin [this message]
2015-02-11 13:29 ` Peter Maydell
2015-02-11 14:09 ` Michael S. Tsirkin
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=20150211123343.GC4623@redhat.com \
--to=mst@redhat.com \
--cc=agraf@suse.de \
--cc=cornelia.huck@de.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=tiejun.chen@intel.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).