[Qemu-devel] [PATCH v2 13/29] Clean up inclusion of exec/cpu-common.h

Markus Armbruster posted 29 patches 6 years, 6 months ago
Maintainers: Giuseppe Lettieri <g.lettieri@iet.unipi.it>, Andrzej Zaborowski <balrogg@gmail.com>, Stafford Horne <shorne@gmail.com>, Xiao Guangrong <xiaoguangrong.eric@gmail.com>, Aleksandar Markovic <amarkovic@wavecomp.com>, Riku Voipio <riku.voipio@iki.fi>, Michael Walle <michael@walle.cc>, Juan Quintela <quintela@redhat.com>, Pierre Morel <pmorel@linux.ibm.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Markus Armbruster <armbru@redhat.com>, BALATON Zoltan <balaton@eik.bme.hu>, Stefan Weil <sw@weilnetz.de>, Corey Minyard <minyard@acm.org>, Leif Lindholm <leif.lindholm@linaro.org>, Beniamino Galvani <b.galvani@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Amit Shah <amit@kernel.org>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Collin Walling <walling@linux.ibm.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Yuval Shaia <yuval.shaia@oracle.com>, Liu Yuan <namei.unix@gmail.com>, Alex Williamson <alex.williamson@redhat.com>, Peter Chubb <peter.chubb@nicta.com.au>, Anthony Perard <anthony.perard@citrix.com>, Andrew Jeffery <andrew@aj.id.au>, Alistair Francis <Alistair.Francis@wdc.com>, Richard Henderson <rth@twiddle.net>, Luigi Rizzo <rizzo@iet.unipi.it>, Anthony Green <green@moxielogic.com>, Shannon Zhao <shannon.zhaosl@gmail.com>, Peter Lieven <pl@kamp.de>, Jason Wang <jasowang@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Corey Minyard <cminyard@mvista.com>, Vincenzo Maffione <v.maffione@gmail.com>, James Hogan <jhogan@kernel.org>, Gonglei <arei.gonglei@huawei.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Fabien Chouteau <chouteau@adacore.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Marek Vasut <marex@denx.de>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Alberto Garcia <berto@igalia.com>, Laurent Vivier <lvivier@redhat.com>, Max Filippov <jcmvbkbc@gmail.com>, KONRAD Frederic <frederic.konrad@adacore.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Keith Busch <keith.busch@intel.com>, Stefano Stabellini <sstabellini@kernel.org>, zhanghailiang <zhang.zhanghailiang@huawei.com>, Eric Blake <eblake@redhat.com>, David Hildenbrand <david@redhat.com>, Paul Burton <pburton@wavecomp.com>, Jan Kiszka <jan.kiszka@web.de>, Igor Mitsyanko <i.mitsyanko@gmail.com>, Joel Stanley <joel@jms.id.au>, Stefan Berger <stefanb@linux.ibm.com>, Peter Maydell <peter.maydell@linaro.org>, Jia Liu <proljc@gmail.com>, Igor Mammedov <imammedo@redhat.com>, Helge Deller <deller@gmx.de>, Fam Zheng <fam@euphon.net>, Jiri Pirko <jiri@resnulli.us>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Magnus Damm <magnus.damm@gmail.com>, Samuel Thibault <samuel.thibault@ens-lyon.org>, Stefan Hajnoczi <stefanha@redhat.com>, Xie Changlong <xiechanglong.d@gmail.com>, Thomas Huth <huth@tuxfamily.org>, Marcelo Tosatti <mtosatti@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, John Snow <jsnow@redhat.com>, Guan Xuetao <gxt@mprc.pku.edu.cn>, Palmer Dabbelt <palmer@sifive.com>, Gerd Hoffmann <kraxel@redhat.com>, Andrey Smirnov <andrew.smirnov@gmail.com>, Thomas Huth <thuth@redhat.com>, Hannes Reinecke <hare@suse.com>, Jiri Slaby <jslaby@suse.cz>, Kevin Wolf <kwolf@redhat.com>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, Subbaraya Sundeep <sundeep.lkml@gmail.com>, Andrew Baumann <Andrew.Baumann@microsoft.com>, Alistair Francis <alistair@alistair23.me>, Rob Herring <robh@kernel.org>, Halil Pasic <pasic@linux.ibm.com>, Paolo Bonzini <pbonzini@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, Cornelia Huck <cohuck@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Eduardo Habkost <ehabkost@redhat.com>, Radoslaw Biernacki <radoslaw.biernacki@linaro.org>, Eric Farman <farman@linux.ibm.com>, Wen Congyang <wencongyang2@huawei.com>, Max Reitz <mreitz@redhat.com>, Chris Wulff <crwulff@gmail.com>, Eric Auger <eric.auger@redhat.com>, Greg Kurz <groug@kaod.org>, Paul Durrant <paul.durrant@citrix.com>, Antony Pavlov <antonynpavlov@gmail.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Jean-Christophe Dubois <jcd@tribudubois.net>, Tony Krowiak <akrowiak@linux.ibm.com>, Ben Warren <ben@skyportsystems.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Aleksandar Rikalo <arikalo@wavecomp.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Laszlo Ersek <lersek@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>
There is a newer version of this series
[Qemu-devel] [PATCH v2 13/29] Clean up inclusion of exec/cpu-common.h
Posted by Markus Armbruster 6 years, 6 months ago
migration/qemu-file.h neglects to include it even though it needs
ram_addr_t.  Fix that.  Drop a few superfluous inclusions elsewhere.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 accel/stubs/tcg-stub.c          | 1 -
 balloon.c                       | 1 -
 hw/smbios/smbios.c              | 1 -
 include/hw/hw.h                 | 1 -
 include/hw/ppc/ppc4xx.h         | 1 -
 include/migration/misc.h        | 1 -
 include/sysemu/kvm_int.h        | 1 -
 include/sysemu/memory_mapping.h | 1 -
 migration/migration.h           | 1 -
 migration/qemu-file-channel.c   | 1 -
 migration/qemu-file.h           | 1 +
 migration/vmstate-types.c       | 1 -
 qom/cpu.c                       | 1 -
 tcg/optimize.c                  | 1 -
 tcg/tcg-common.c                | 1 -
 tcg/tcg.c                       | 1 -
 16 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
index 76ae461749..e2d23edafe 100644
--- a/accel/stubs/tcg-stub.c
+++ b/accel/stubs/tcg-stub.c
@@ -14,7 +14,6 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "tcg/tcg.h"
-#include "exec/cpu-common.h"
 #include "exec/exec-all.h"
 
 void tb_flush(CPUState *cpu)
diff --git a/balloon.c b/balloon.c
index 914b3662db..f104b42961 100644
--- a/balloon.c
+++ b/balloon.c
@@ -26,7 +26,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu/atomic.h"
-#include "exec/cpu-common.h"
 #include "sysemu/kvm.h"
 #include "sysemu/balloon.h"
 #include "trace-root.h"
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 7bcd67b098..11d476c4a2 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -28,7 +28,6 @@
 #include "hw/firmware/smbios.h"
 #include "hw/loader.h"
 #include "hw/boards.h"
-#include "exec/cpu-common.h"
 #include "smbios_build.h"
 
 /* legacy structures and constants for <= 2.0 machines */
diff --git a/include/hw/hw.h b/include/hw/hw.h
index 38d2fb1f40..86ff26b712 100644
--- a/include/hw/hw.h
+++ b/include/hw/hw.h
@@ -6,7 +6,6 @@
 #error Cannot include hw/hw.h from user emulation
 #endif
 
-#include "exec/cpu-common.h"
 #include "qom/object.h"
 #include "exec/memory.h"
 #include "migration/vmstate.h"
diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h
index 90f8866138..7d82259051 100644
--- a/include/hw/ppc/ppc4xx.h
+++ b/include/hw/ppc/ppc4xx.h
@@ -26,7 +26,6 @@
 #define PPC4XX_H
 
 #include "hw/ppc/ppc.h"
-#include "exec/cpu-common.h"
 #include "exec/memory.h"
 
 /* PowerPC 4xx core initialization */
diff --git a/include/migration/misc.h b/include/migration/misc.h
index 5cdbabd094..b9d8e787af 100644
--- a/include/migration/misc.h
+++ b/include/migration/misc.h
@@ -14,7 +14,6 @@
 #ifndef MIGRATION_MISC_H
 #define MIGRATION_MISC_H
 
-#include "exec/cpu-common.h"
 #include "qemu/notify.h"
 #include "qapi/qapi-types-net.h"
 
diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h
index 787dbc7770..5d341cc29b 100644
--- a/include/sysemu/kvm_int.h
+++ b/include/sysemu/kvm_int.h
@@ -9,7 +9,6 @@
 #ifndef QEMU_KVM_INT_H
 #define QEMU_KVM_INT_H
 
-#include "exec/cpu-common.h"
 #include "exec/memory.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/accel.h"
diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h
index 1b440df486..4b20f1a639 100644
--- a/include/sysemu/memory_mapping.h
+++ b/include/sysemu/memory_mapping.h
@@ -15,7 +15,6 @@
 #define MEMORY_MAPPING_H
 
 #include "qemu/queue.h"
-#include "exec/cpu-common.h"
 #include "exec/cpu-defs.h"
 #include "exec/memory.h"
 
diff --git a/migration/migration.h b/migration/migration.h
index 1fdd7b21fd..26f01d00f6 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -16,7 +16,6 @@
 
 #include "qapi/qapi-types-migration.h"
 #include "qemu/thread.h"
-#include "exec/cpu-common.h"
 #include "qemu/coroutine_int.h"
 #include "hw/qdev.h"
 #include "io/channel.h"
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index 8e639eb496..78ef248820 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "qemu-file-channel.h"
-#include "exec/cpu-common.h"
 #include "qemu-file.h"
 #include "io/channel-socket.h"
 #include "qemu/iov.h"
diff --git a/migration/qemu-file.h b/migration/qemu-file.h
index 13baf896bd..21f3ae4be2 100644
--- a/migration/qemu-file.h
+++ b/migration/qemu-file.h
@@ -26,6 +26,7 @@
 #define MIGRATION_QEMU_FILE_H
 
 #include <zlib.h>
+#include "exec/cpu-common.h"
 
 /* Read a chunk of data from a file at the given position.  The pos argument
  * can be ignored if the file is only be used for streaming.  The number of
diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c
index 845f4649ee..bee658a1b2 100644
--- a/migration/vmstate-types.c
+++ b/migration/vmstate-types.c
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "qemu-file.h"
 #include "migration.h"
 #include "migration/vmstate.h"
diff --git a/qom/cpu.c b/qom/cpu.c
index f376f782d8..fdc1af8f40 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -25,7 +25,6 @@
 #include "qemu/notify.h"
 #include "qemu/log.h"
 #include "exec/log.h"
-#include "exec/cpu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/qemu-print.h"
 #include "sysemu/sysemu.h"
diff --git a/tcg/optimize.c b/tcg/optimize.c
index d2424de4af..cee2a36a60 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -24,7 +24,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "tcg-op.h"
 
 #define CASE_OP_32_64(x)                        \
diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c
index 907d58d0f0..97305a3efc 100644
--- a/tcg/tcg-common.c
+++ b/tcg/tcg-common.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/cpu-common.h"
 #include "tcg/tcg.h"
 
 #if defined(CONFIG_TCG_INTERPRETER)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index be2c33c400..2db83ce2e8 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -42,7 +42,6 @@
 #define NO_CPU_IO_DEFS
 #include "cpu.h"
 
-#include "exec/cpu-common.h"
 #include "exec/exec-all.h"
 
 #if !defined(CONFIG_USER_ONLY)
-- 
2.21.0


Re: [Qemu-devel] [PATCH v2 13/29] Clean up inclusion of exec/cpu-common.h
Posted by Philippe Mathieu-Daudé 6 years, 6 months ago
On 8/6/19 5:14 PM, Markus Armbruster wrote:
> migration/qemu-file.h neglects to include it even though it needs
> ram_addr_t.  Fix that.  Drop a few superfluous inclusions elsewhere.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  accel/stubs/tcg-stub.c          | 1 -
>  balloon.c                       | 1 -
>  hw/smbios/smbios.c              | 1 -
>  include/hw/hw.h                 | 1 -
>  include/hw/ppc/ppc4xx.h         | 1 -
>  include/migration/misc.h        | 1 -
>  include/sysemu/kvm_int.h        | 1 -
>  include/sysemu/memory_mapping.h | 1 -
>  migration/migration.h           | 1 -
>  migration/qemu-file-channel.c   | 1 -
>  migration/qemu-file.h           | 1 +
>  migration/vmstate-types.c       | 1 -
>  qom/cpu.c                       | 1 -
>  tcg/optimize.c                  | 1 -
>  tcg/tcg-common.c                | 1 -
>  tcg/tcg.c                       | 1 -
>  16 files changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
> index 76ae461749..e2d23edafe 100644
> --- a/accel/stubs/tcg-stub.c
> +++ b/accel/stubs/tcg-stub.c
> @@ -14,7 +14,6 @@
>  #include "qemu-common.h"
>  #include "cpu.h"
>  #include "tcg/tcg.h"
> -#include "exec/cpu-common.h"
>  #include "exec/exec-all.h"
>  
>  void tb_flush(CPUState *cpu)
> diff --git a/balloon.c b/balloon.c
> index 914b3662db..f104b42961 100644
> --- a/balloon.c
> +++ b/balloon.c
> @@ -26,7 +26,6 @@
>  
>  #include "qemu/osdep.h"
>  #include "qemu/atomic.h"
> -#include "exec/cpu-common.h"
>  #include "sysemu/kvm.h"
>  #include "sysemu/balloon.h"
>  #include "trace-root.h"
> diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
> index 7bcd67b098..11d476c4a2 100644
> --- a/hw/smbios/smbios.c
> +++ b/hw/smbios/smbios.c
> @@ -28,7 +28,6 @@
>  #include "hw/firmware/smbios.h"
>  #include "hw/loader.h"
>  #include "hw/boards.h"
> -#include "exec/cpu-common.h"
>  #include "smbios_build.h"
>  
>  /* legacy structures and constants for <= 2.0 machines */
> diff --git a/include/hw/hw.h b/include/hw/hw.h
> index 38d2fb1f40..86ff26b712 100644
> --- a/include/hw/hw.h
> +++ b/include/hw/hw.h
> @@ -6,7 +6,6 @@
>  #error Cannot include hw/hw.h from user emulation
>  #endif
>  
> -#include "exec/cpu-common.h"
>  #include "qom/object.h"
>  #include "exec/memory.h"
>  #include "migration/vmstate.h"
> diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h
> index 90f8866138..7d82259051 100644
> --- a/include/hw/ppc/ppc4xx.h
> +++ b/include/hw/ppc/ppc4xx.h
> @@ -26,7 +26,6 @@
>  #define PPC4XX_H
>  
>  #include "hw/ppc/ppc.h"
> -#include "exec/cpu-common.h"
>  #include "exec/memory.h"
>  
>  /* PowerPC 4xx core initialization */
> diff --git a/include/migration/misc.h b/include/migration/misc.h
> index 5cdbabd094..b9d8e787af 100644
> --- a/include/migration/misc.h
> +++ b/include/migration/misc.h
> @@ -14,7 +14,6 @@
>  #ifndef MIGRATION_MISC_H
>  #define MIGRATION_MISC_H
>  
> -#include "exec/cpu-common.h"
>  #include "qemu/notify.h"
>  #include "qapi/qapi-types-net.h"
>  
> diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h
> index 787dbc7770..5d341cc29b 100644
> --- a/include/sysemu/kvm_int.h
> +++ b/include/sysemu/kvm_int.h
> @@ -9,7 +9,6 @@
>  #ifndef QEMU_KVM_INT_H
>  #define QEMU_KVM_INT_H
>  
> -#include "exec/cpu-common.h"
>  #include "exec/memory.h"
>  #include "sysemu/sysemu.h"
>  #include "sysemu/accel.h"
> diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h
> index 1b440df486..4b20f1a639 100644
> --- a/include/sysemu/memory_mapping.h
> +++ b/include/sysemu/memory_mapping.h
> @@ -15,7 +15,6 @@
>  #define MEMORY_MAPPING_H
>  
>  #include "qemu/queue.h"
> -#include "exec/cpu-common.h"
>  #include "exec/cpu-defs.h"
>  #include "exec/memory.h"
>  
> diff --git a/migration/migration.h b/migration/migration.h
> index 1fdd7b21fd..26f01d00f6 100644
> --- a/migration/migration.h
> +++ b/migration/migration.h
> @@ -16,7 +16,6 @@
>  
>  #include "qapi/qapi-types-migration.h"
>  #include "qemu/thread.h"
> -#include "exec/cpu-common.h"
>  #include "qemu/coroutine_int.h"
>  #include "hw/qdev.h"
>  #include "io/channel.h"
> diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
> index 8e639eb496..78ef248820 100644
> --- a/migration/qemu-file-channel.c
> +++ b/migration/qemu-file-channel.c
> @@ -24,7 +24,6 @@
>  
>  #include "qemu/osdep.h"
>  #include "qemu-file-channel.h"
> -#include "exec/cpu-common.h"
>  #include "qemu-file.h"
>  #include "io/channel-socket.h"
>  #include "qemu/iov.h"
> diff --git a/migration/qemu-file.h b/migration/qemu-file.h
> index 13baf896bd..21f3ae4be2 100644
> --- a/migration/qemu-file.h
> +++ b/migration/qemu-file.h
> @@ -26,6 +26,7 @@
>  #define MIGRATION_QEMU_FILE_H
>  
>  #include <zlib.h>
> +#include "exec/cpu-common.h"
>  
>  /* Read a chunk of data from a file at the given position.  The pos argument
>   * can be ignored if the file is only be used for streaming.  The number of
> diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c
> index 845f4649ee..bee658a1b2 100644
> --- a/migration/vmstate-types.c
> +++ b/migration/vmstate-types.c
> @@ -11,7 +11,6 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "exec/cpu-common.h"
>  #include "qemu-file.h"
>  #include "migration.h"
>  #include "migration/vmstate.h"
> diff --git a/qom/cpu.c b/qom/cpu.c
> index f376f782d8..fdc1af8f40 100644
> --- a/qom/cpu.c
> +++ b/qom/cpu.c
> @@ -25,7 +25,6 @@
>  #include "qemu/notify.h"
>  #include "qemu/log.h"
>  #include "exec/log.h"
> -#include "exec/cpu-common.h"
>  #include "qemu/error-report.h"
>  #include "qemu/qemu-print.h"
>  #include "sysemu/sysemu.h"
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index d2424de4af..cee2a36a60 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
> @@ -24,7 +24,6 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "exec/cpu-common.h"
>  #include "tcg-op.h"
>  
>  #define CASE_OP_32_64(x)                        \
> diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c
> index 907d58d0f0..97305a3efc 100644
> --- a/tcg/tcg-common.c
> +++ b/tcg/tcg-common.c
> @@ -23,7 +23,6 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "exec/cpu-common.h"
>  #include "tcg/tcg.h"
>  
>  #if defined(CONFIG_TCG_INTERPRETER)
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index be2c33c400..2db83ce2e8 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -42,7 +42,6 @@
>  #define NO_CPU_IO_DEFS
>  #include "cpu.h"
>  
> -#include "exec/cpu-common.h"
>  #include "exec/exec-all.h"
>  
>  #if !defined(CONFIG_USER_ONLY)
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>