From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKuRX-0000EH-Do for qemu-devel@nongnu.org; Mon, 09 Feb 2015 14:56:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKuRS-0007ae-CP for qemu-devel@nongnu.org; Mon, 09 Feb 2015 14:56:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKuRS-0007aS-61 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 14:56:22 -0500 Date: Mon, 9 Feb 2015 20:56:10 +0100 From: "Michael S. Tsirkin" Message-ID: <1423511512-29208-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [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: qemu-devel@nongnu.org Cc: Cornelia Huck , "Chen, Tiejun" , Alexander Graf , stefanha@redhat.com, Peter Maydell 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" +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" -- MST