
* Update to QEMU v9.0.0 --------- Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com> Signed-off-by: Ido Plat <ido.plat@ibm.com> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Signed-off-by: David Hildenbrand <david@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Signed-off-by: Gregory Price <gregory.price@memverge.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Lorenz Brun <lorenz@brun.one> Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com> Signed-off-by: Arnaud Minier <arnaud.minier@telecom-paris.fr> Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Sven Schnelle <svens@stackframe.org> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Signed-off-by: Avihai Horon <avihaih@nvidia.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Joonas Kankaala <joonas.a.kankaala@gmail.com> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Glenn Miles <milesg@linux.ibm.com> Signed-off-by: Oleg Sviridov <oleg.sviridov@red-soft.ru> Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru> Signed-off-by: Yajun Wu <yajunw@nvidia.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Pierre-Clément Tosi <ptosi@google.com> Signed-off-by: Lei Wang <lei4.wang@intel.com> Signed-off-by: Wei Wang <wei.w.wang@intel.com> Signed-off-by: Martin Hundebøll <martin@geanix.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Signed-off-by: Wafer <wafer@jaguarmicro.com> Signed-off-by: Yuxue Liu <yuxue.liu@jaguarmicro.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com> Signed-off-by: Zack Buhman <zack@buhman.org> Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Yuquan Wang wangyuquan1236@phytium.com.cn Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com> Signed-off-by: Cindy Lu <lulu@redhat.com> Co-authored-by: Peter Maydell <peter.maydell@linaro.org> Co-authored-by: Fabiano Rosas <farosas@suse.de> Co-authored-by: Peter Xu <peterx@redhat.com> Co-authored-by: Thomas Huth <thuth@redhat.com> Co-authored-by: Cédric Le Goater <clg@redhat.com> Co-authored-by: Zheyu Ma <zheyuma97@gmail.com> Co-authored-by: Ido Plat <ido.plat@ibm.com> Co-authored-by: Ilya Leoshkevich <iii@linux.ibm.com> Co-authored-by: Markus Armbruster <armbru@redhat.com> Co-authored-by: Marc-André Lureau <marcandre.lureau@redhat.com> Co-authored-by: Paolo Bonzini <pbonzini@redhat.com> Co-authored-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Co-authored-by: David Hildenbrand <david@redhat.com> Co-authored-by: Kevin Wolf <kwolf@redhat.com> Co-authored-by: Stefan Reiter <s.reiter@proxmox.com> Co-authored-by: Fiona Ebner <f.ebner@proxmox.com> Co-authored-by: Gregory Price <gregory.price@memverge.com> Co-authored-by: Lorenz Brun <lorenz@brun.one> Co-authored-by: Yao Xingtao <yaoxt.fnst@fujitsu.com> Co-authored-by: Philippe Mathieu-Daudé <philmd@linaro.org> Co-authored-by: Arnaud Minier <arnaud.minier@telecom-paris.fr> Co-authored-by: BALATON Zoltan <balaton@eik.bme.hu> Co-authored-by: Igor Mammedov <imammedo@redhat.com> Co-authored-by: Akihiko Odaki <akihiko.odaki@daynix.com> Co-authored-by: Richard Henderson <richard.henderson@linaro.org> Co-authored-by: Sven Schnelle <svens@stackframe.org> Co-authored-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Co-authored-by: Helge Deller <deller@kernel.org> Co-authored-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Co-authored-by: Benjamin Gray <bgray@linux.ibm.com> Co-authored-by: Nicholas Piggin <npiggin@gmail.com> Co-authored-by: Avihai Horon <avihaih@nvidia.com> Co-authored-by: Michael Tokarev <mjt@tls.msk.ru> Co-authored-by: Joonas Kankaala <joonas.a.kankaala@gmail.com> Co-authored-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Co-authored-by: Stefan Weil <sw@weilnetz.de> Co-authored-by: Dayu Liu <liu.dayu@zte.com.cn> Co-authored-by: Zhao Liu <zhao1.liu@intel.com> Co-authored-by: Glenn Miles <milesg@linux.vnet.ibm.com> Co-authored-by: Artem Chernyshev <artem.chernyshev@red-soft.ru> Co-authored-by: Yajun Wu <yajunw@nvidia.com> Co-authored-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Co-authored-by: Pierre-Clément Tosi <ptosi@google.com> Co-authored-by: Wei Wang <wei.w.wang@intel.com> Co-authored-by: Martin Hundebøll <martin@geanix.com> Co-authored-by: Michael S. Tsirkin <mst@redhat.com> Co-authored-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Co-authored-by: Wafer <wafer@jaguarmicro.com> Co-authored-by: lyx634449800 <yuxue.liu@jaguarmicro.com> Co-authored-by: Gerd Hoffmann <kraxel@redhat.com> Co-authored-by: Nguyen Dinh Phi <phind.uet@gmail.com> Co-authored-by: Zack Buhman <zack@buhman.org> Co-authored-by: Keith Packard <keithp@keithp.com> Co-authored-by: Yuquan Wang <wangyuquan1236@phytium.com.cn> Co-authored-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com> Co-authored-by: Cindy Lu <lulu@redhat.com>
210 lines
6.1 KiB
Bash
Executable File
210 lines
6.1 KiB
Bash
Executable File
#!/bin/sh -e
|
|
#
|
|
# Clean up QEMU #include lines by ensuring that qemu/osdep.h
|
|
# is the first include listed in .c files, and no headers provided
|
|
# by osdep.h itself are redundantly included in either .c or .h files.
|
|
#
|
|
# Copyright (c) 2015 Linaro Limited
|
|
#
|
|
# Authors:
|
|
# Peter Maydell <peter.maydell@linaro.org>
|
|
#
|
|
# This work is licensed under the terms of the GNU GPL, version 2
|
|
# or (at your option) any later version. See the COPYING file in
|
|
# the top-level directory.
|
|
|
|
# Usage:
|
|
# clean-includes [--git subjectprefix] [--check-dup-head] file ...
|
|
# or
|
|
# clean-includes [--git subjectprefix] [--check-dup-head] --all
|
|
#
|
|
# If the --git subjectprefix option is given, then after making
|
|
# the changes to the files this script will create a git commit
|
|
# with the subject line "subjectprefix: Clean up includes"
|
|
# and a boilerplate commit message.
|
|
#
|
|
# If --check-dup-head is specified, additionally check for duplicate
|
|
# header includes.
|
|
#
|
|
# Using --all will cause clean-includes to run on the whole source
|
|
# tree (excluding certain directories which are known not to need
|
|
# handling).
|
|
|
|
# This script requires Coccinelle to be installed.
|
|
|
|
# .c files will have the osdep.h included added, and redundant
|
|
# includes removed.
|
|
# .h files will have redundant includes (including includes of osdep.h)
|
|
# removed.
|
|
# Other files (including C++ and ObjectiveC) can't be handled by this script.
|
|
|
|
# The following one-liner may be handy for finding files to run this on.
|
|
# However some caution is required regarding files that might be part
|
|
# of the guest agent or standalone tests.
|
|
|
|
# for i in $(git ls-tree --name-only HEAD) ; do test -f $i && \
|
|
# grep -E '^# *include' $i | head -1 | grep 'osdep.h' ; test $? != 0 && \
|
|
# echo $i ; done
|
|
|
|
|
|
GIT=no
|
|
DUPHEAD=no
|
|
|
|
# Extended regular expression defining files to ignore when using --all
|
|
XDIRREGEX='^(tests/tcg|tests/multiboot|tests/fp|tests/plugin|tests/uefi-test-tools|pc-bios|subprojects|contrib/plugins|tools/ebpf|ebpf/rss.bpf.skeleton.h|linux-user/(mips64|x86_64)/(cpu_loop|signal).c)'
|
|
|
|
while true
|
|
do
|
|
case $1 in
|
|
"--git")
|
|
if [ $# -eq 1 ]; then
|
|
echo "--git option requires an argument"
|
|
exit 1
|
|
fi
|
|
GITSUBJ="$2"
|
|
GIT=yes
|
|
shift
|
|
shift
|
|
;;
|
|
"--check-dup-head")
|
|
DUPHEAD=yes
|
|
shift
|
|
;;
|
|
"--")
|
|
shift
|
|
break
|
|
;;
|
|
*)
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ $# -eq 0 ]; then
|
|
echo "Usage: clean-includes [--git subjectprefix] [--check-dup-head] [--all | foo.c ...]"
|
|
echo "(modifies the files in place)"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$1" = "--all" ]; then
|
|
# We assume there are no files in the tree with spaces in their name
|
|
set -- $(git ls-files '*.[ch]' | grep -E -v "$XDIRREGEX")
|
|
fi
|
|
|
|
# Annoyingly coccinelle won't read a scriptfile unless its
|
|
# name ends '.cocci', so write it out to a tempfile with the
|
|
# right kind of name.
|
|
COCCIFILE="$(mktemp --suffix=.cocci)"
|
|
|
|
trap 'rm -f -- "$COCCIFILE"' INT TERM HUP EXIT
|
|
|
|
cat >"$COCCIFILE" <<EOT
|
|
@@
|
|
@@
|
|
|
|
(
|
|
+ #include "qemu/osdep.h"
|
|
#include "..."
|
|
|
|
|
+ #include "qemu/osdep.h"
|
|
#include <...>
|
|
)
|
|
EOT
|
|
|
|
files=
|
|
for f in "$@"; do
|
|
if [ -L "$f" ]; then
|
|
echo "SKIPPING $f (symbolic link)"
|
|
continue
|
|
fi
|
|
case "$f" in
|
|
*.c.inc)
|
|
# These aren't standalone C source files
|
|
echo "SKIPPING $f (not a standalone source file)"
|
|
continue
|
|
;;
|
|
*.c)
|
|
MODE=c
|
|
;;
|
|
*include/qemu/osdep.h | \
|
|
*include/qemu/compiler.h | \
|
|
*include/qemu/qemu-plugin.h | \
|
|
*include/glib-compat.h | \
|
|
*include/sysemu/os-posix.h | \
|
|
*include/sysemu/os-win32.h | \
|
|
*include/standard-headers/ )
|
|
# Removing include lines from osdep.h itself would be counterproductive.
|
|
echo "SKIPPING $f (special case header)"
|
|
continue
|
|
;;
|
|
*include/standard-headers/*)
|
|
echo "SKIPPING $f (autogenerated header)"
|
|
continue
|
|
;;
|
|
*.h)
|
|
MODE=h
|
|
;;
|
|
*)
|
|
echo "WARNING: ignoring $f (cannot handle non-C files)"
|
|
continue
|
|
;;
|
|
esac
|
|
files="$files $f"
|
|
|
|
if [ "$MODE" = "c" ]; then
|
|
# First, use Coccinelle to add qemu/osdep.h before the first existing include
|
|
# (this will add two lines if the file uses both "..." and <...> #includes,
|
|
# but we will remove the extras in the next step)
|
|
spatch --in-place --no-show-diff --cocci-file "$COCCIFILE" "$f"
|
|
|
|
# Now remove any duplicate osdep.h includes
|
|
perl -n -i -e 'print if !/#include "qemu\/osdep.h"/ || !$n++;' "$f"
|
|
else
|
|
# Remove includes of osdep.h itself
|
|
perl -n -i -e 'print if !/\s*#\s*include\s*(["<][^>"]*[">])/ ||
|
|
! (grep { $_ eq $1 } qw ("qemu/osdep.h"))' "$f"
|
|
fi
|
|
|
|
# Remove includes that osdep.h already provides
|
|
perl -n -i -e 'print if !/\s*#\s*include\s*(["<][^>"]*[">])/ ||
|
|
! (grep { $_ eq $1 } qw (
|
|
"config-host.h" "config-target.h" "qemu/compiler.h"
|
|
<setjmp.h> <stdarg.h> <stddef.h> <stdbool.h> <stdint.h> <sys/types.h>
|
|
<stdlib.h> <stdio.h> <string.h> <strings.h> <inttypes.h>
|
|
<limits.h> <unistd.h> <time.h> <ctype.h> <errno.h> <fcntl.h>
|
|
<sys/stat.h> <sys/time.h> <assert.h> <signal.h> <glib.h>
|
|
<sys/stat.h> <sys/time.h> <assert.h> <signal.h> <glib.h> <sys/mman.h>
|
|
"sysemu/os-posix.h, sysemu/os-win32.h "glib-compat.h"
|
|
"qemu/typedefs.h"
|
|
))' "$f"
|
|
|
|
done
|
|
|
|
if [ "$DUPHEAD" = "yes" ] && [ -n "$files" ]; then
|
|
if egrep "^[[:space:]]*#[[:space:]]*include" $files | tr -d '[:blank:]' \
|
|
| sort | uniq -c | grep -v '^ *1 '; then
|
|
echo "Found duplicate header file includes. Please check the above files manually."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if [ "$GIT" = "yes" ]; then
|
|
git add -- $files
|
|
git commit --signoff -F - <<EOF
|
|
$GITSUBJ: Clean up includes
|
|
|
|
This commit was created with scripts/clean-includes.
|
|
|
|
All .c should include qemu/osdep.h first. The script performs three
|
|
related cleanups:
|
|
|
|
* Ensure .c files include qemu/osdep.h first.
|
|
* Including it in a .h is redundant, since the .c already includes
|
|
it. Drop such inclusions.
|
|
* Likewise, including headers qemu/osdep.h includes is redundant.
|
|
Drop these, too.
|
|
|
|
EOF
|
|
|
|
fi
|