From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLME6-0005NE-0p for qemu-devel@nongnu.org; Tue, 10 Feb 2015 20:36:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLME2-00079I-RK for qemu-devel@nongnu.org; Tue, 10 Feb 2015 20:36:25 -0500 Received: from mga14.intel.com ([192.55.52.115]:29610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLME2-000794-MV for qemu-devel@nongnu.org; Tue, 10 Feb 2015 20:36:22 -0500 Message-ID: <54DAB20F.6020604@intel.com> Date: Wed, 11 Feb 2015 09:36:15 +0800 From: "Chen, Tiejun" MIME-Version: 1.0 References: <1423511512-29208-1-git-send-email-mst@redhat.com> In-Reply-To: <1423511512-29208-1-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC] scripts/update-linux-headers.sh: pull virtio hdrs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Cornelia Huck , Peter Maydell , Alexander Graf , stefanha@redhat.com On 2015/2/10 3:56, Michael S. Tsirkin wrote: > It doesn't make sense to copy values manually: > the only issue with getting headers from linux > seems to be dealing with linux/types, we > can easily fix that automatically while importing. > > Signed-off-by: Michael S. Tsirkin > --- > > FYI this is what I propose instead of the recently > suggested > virtio: uniform virtio device IDs > we can then rework existing code to include these headers. > > Will automatically bring in goodies as they arrive in linux. > > This doesn't yet import virtio ccw header, > that won't be hard to add later. > > scripts/update-linux-headers.sh | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh > index c8e026d..0bd8437 100755 > --- a/scripts/update-linux-headers.sh > +++ b/scripts/update-linux-headers.sh > @@ -76,4 +76,14 @@ else > cp "$linux/COPYING" "$output/linux-headers" > fi > > +rm -rf "$output/standard-headers/linux" > +mkdir -p "$output/standard-headers/linux" Shouldn't we add something in configure file to execute this automatically? Or instead of creating 'standard-headers/, why can't we go that existing linux-headers/? Thanks Tiejun > +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 > rm -rf "$tmpdir" >