[Qemu-devel] [PATCH v2 14/29] migration: Move the VMStateDescription typedef to typedefs.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 14/29] migration: Move the VMStateDescription typedef to typedefs.h
Posted by Markus Armbruster 6 years, 6 months ago
We declare incomplete struct VMStateDescription in a couple of places
so we don't have to include migration/vmstate.h for the typedef.
That's fine with me.  However, the next commit will drop
migration/vmstate.h from a massive number of compiles.  Move the
typedef to qemu/typedefs.h now, so I don't have to insert struct in
front of VMStateDescription all over the place then.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/hw/qdev-core.h      | 6 ++----
 include/migration/vmstate.h | 1 -
 include/qemu/typedefs.h     | 1 +
 include/qom/cpu.h           | 4 ++--
 target/alpha/cpu.h          | 2 +-
 target/arm/cpu.h            | 2 +-
 target/cris/cpu.h           | 2 +-
 target/hppa/cpu.h           | 2 +-
 target/i386/cpu.h           | 2 +-
 target/lm32/cpu.h           | 2 +-
 target/mips/internal.h      | 2 +-
 target/openrisc/cpu.h       | 2 +-
 target/ppc/cpu-qom.h        | 2 +-
 target/ppc/cpu.h            | 2 +-
 target/s390x/cpu.h          | 2 +-
 target/sparc/cpu.h          | 2 +-
 16 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index b870c8ceeb..e5b62dd2fc 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -35,8 +35,6 @@ typedef void (*DeviceReset)(DeviceState *dev);
 typedef void (*BusRealize)(BusState *bus, Error **errp);
 typedef void (*BusUnrealize)(BusState *bus, Error **errp);
 
-struct VMStateDescription;
-
 /**
  * DeviceClass:
  * @props: Properties accessing state fields.
@@ -112,7 +110,7 @@ typedef struct DeviceClass {
     DeviceUnrealize unrealize;
 
     /* device state */
-    const struct VMStateDescription *vmsd;
+    const VMStateDescription *vmsd;
 
     /* Private to qdev / bus.  */
     const char *bus_type;
@@ -425,7 +423,7 @@ void device_class_set_parent_unrealize(DeviceClass *dc,
                                        DeviceUnrealize dev_unrealize,
                                        DeviceUnrealize *parent_unrealize);
 
-const struct VMStateDescription *qdev_get_vmsd(DeviceState *dev);
+const VMStateDescription *qdev_get_vmsd(DeviceState *dev);
 
 const char *qdev_fw_name(DeviceState *dev);
 
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index c2bfa7a7f0..1fbfd099dd 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -28,7 +28,6 @@
 #define QEMU_VMSTATE_H
 
 typedef struct VMStateInfo VMStateInfo;
-typedef struct VMStateDescription VMStateDescription;
 typedef struct VMStateField VMStateField;
 
 /* VMStateInfo allows customized migration of objects that don't fit in
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index c32efb5b18..9e1283aacf 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -101,6 +101,7 @@ typedef struct SHPCDevice SHPCDevice;
 typedef struct SSIBus SSIBus;
 typedef struct VirtIODevice VirtIODevice;
 typedef struct Visitor Visitor;
+typedef struct VMStateDescription VMStateDescription;
 
 /*
  * Pointer types
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 5ee0046b62..ddb91bbaff 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -215,7 +215,7 @@ typedef struct CPUClass {
     int (*write_elf32_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
                                 void *opaque);
 
-    const struct VMStateDescription *vmsd;
+    const VMStateDescription *vmsd;
     const char *gdb_core_xml_file;
     gchar * (*gdb_arch_name)(CPUState *cpu);
     const char * (*gdb_get_dynamic_xml)(CPUState *cpu, const char *xmlname);
@@ -1108,7 +1108,7 @@ bool target_words_bigendian(void);
 #ifdef NEED_CPU_H
 
 #ifdef CONFIG_SOFTMMU
-extern const struct VMStateDescription vmstate_cpu_common;
+extern const VMStateDescription vmstate_cpu_common;
 #else
 #define vmstate_cpu_common vmstate_dummy
 #endif
diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h
index b3e8a823e1..4619530660 100644
--- a/target/alpha/cpu.h
+++ b/target/alpha/cpu.h
@@ -277,7 +277,7 @@ struct AlphaCPU {
 
 
 #ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_alpha_cpu;
+extern const VMStateDescription vmstate_alpha_cpu;
 #endif
 
 void alpha_cpu_do_interrupt(CPUState *cpu);
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 94c990cddb..2cdde6c4bc 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -922,7 +922,7 @@ void arm_cpu_post_init(Object *obj);
 uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz);
 
 #ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_arm_cpu;
+extern const VMStateDescription vmstate_arm_cpu;
 #endif
 
 void arm_cpu_do_interrupt(CPUState *cpu);
diff --git a/target/cris/cpu.h b/target/cris/cpu.h
index fb14ad51f1..aba0a66474 100644
--- a/target/cris/cpu.h
+++ b/target/cris/cpu.h
@@ -183,7 +183,7 @@ struct CRISCPU {
 
 
 #ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_cris_cpu;
+extern const VMStateDescription vmstate_cris_cpu;
 #endif
 
 void cris_cpu_do_interrupt(CPUState *cpu);
diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
index e9fba96be9..4b816cc13a 100644
--- a/target/hppa/cpu.h
+++ b/target/hppa/cpu.h
@@ -334,7 +334,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
 int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx,
                               int type, hwaddr *pphys, int *pprot);
 extern const MemoryRegionOps hppa_io_eir_ops;
-extern const struct VMStateDescription vmstate_hppa_cpu;
+extern const VMStateDescription vmstate_hppa_cpu;
 void hppa_cpu_alarm_timer(void *);
 int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr);
 #endif
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 8b3dc5533e..ecd0ec0899 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1516,7 +1516,7 @@ struct X86CPU {
 
 
 #ifndef CONFIG_USER_ONLY
-extern struct VMStateDescription vmstate_x86_cpu;
+extern VMStateDescription vmstate_x86_cpu;
 #endif
 
 /**
diff --git a/target/lm32/cpu.h b/target/lm32/cpu.h
index c2bbfa2780..064c6b1267 100644
--- a/target/lm32/cpu.h
+++ b/target/lm32/cpu.h
@@ -195,7 +195,7 @@ struct LM32CPU {
 
 
 #ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_lm32_cpu;
+extern const VMStateDescription vmstate_lm32_cpu;
 #endif
 
 void lm32_cpu_do_interrupt(CPUState *cpu);
diff --git a/target/mips/internal.h b/target/mips/internal.h
index b2b41a51ab..d5aa5490d3 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -148,7 +148,7 @@ hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address,
 #define cpu_signal_handler cpu_mips_signal_handler
 
 #ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_mips_cpu;
+extern const VMStateDescription vmstate_mips_cpu;
 #endif
 
 static inline bool cpu_mips_hw_interrupts_enabled(CPUMIPSState *env)
diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h
index f23b25262d..61ade1d4f0 100644
--- a/target/openrisc/cpu.h
+++ b/target/openrisc/cpu.h
@@ -333,7 +333,7 @@ int print_insn_or1k(bfd_vma addr, disassemble_info *info);
 #define cpu_signal_handler cpu_openrisc_signal_handler
 
 #ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_openrisc_cpu;
+extern const VMStateDescription vmstate_openrisc_cpu;
 
 /* hw/openrisc_pic.c */
 void cpu_openrisc_pic_init(OpenRISCCPU *cpu);
diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h
index be9b4c30c3..a2f202f021 100644
--- a/target/ppc/cpu-qom.h
+++ b/target/ppc/cpu-qom.h
@@ -203,7 +203,7 @@ typedef struct PPCTimebase {
     int64_t time_of_the_day_ns;
 } PPCTimebase;
 
-extern const struct VMStateDescription vmstate_ppc_timebase;
+extern const VMStateDescription vmstate_ppc_timebase;
 
 #define VMSTATE_PPC_TIMEBASE_V(_field, _state, _version) {            \
     .name       = (stringify(_field)),                                \
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index c9beba2a5c..4ea33cf696 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1255,7 +1255,7 @@ int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
                                int cpuid, void *opaque);
 #ifndef CONFIG_USER_ONLY
 void ppc_cpu_do_system_reset(CPUState *cs);
-extern const struct VMStateDescription vmstate_ppc_cpu;
+extern const VMStateDescription vmstate_ppc_cpu;
 #endif
 
 /*****************************************************************************/
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index a606547b4d..3d9de25f7c 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -163,7 +163,7 @@ struct S390CPU {
 
 
 #ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_s390_cpu;
+extern const VMStateDescription vmstate_s390_cpu;
 #endif
 
 /* distinguish between 24 bit and 31 bit addressing */
diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index 8ed2250cd0..0d5b01efe5 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -532,7 +532,7 @@ struct SPARCCPU {
 
 
 #ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_sparc_cpu;
+extern const VMStateDescription vmstate_sparc_cpu;
 #endif
 
 void sparc_cpu_do_interrupt(CPUState *cpu);
-- 
2.21.0


Re: [Qemu-devel] [PATCH v2 14/29] migration: Move the VMStateDescription typedef to typedefs.h
Posted by Philippe Mathieu-Daudé 6 years, 6 months ago
On 8/6/19 5:14 PM, Markus Armbruster wrote:
> We declare incomplete struct VMStateDescription in a couple of places
> so we don't have to include migration/vmstate.h for the typedef.
> That's fine with me.  However, the next commit will drop
> migration/vmstate.h from a massive number of compiles.  Move the
> typedef to qemu/typedefs.h now, so I don't have to insert struct in
> front of VMStateDescription all over the place then.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  include/hw/qdev-core.h      | 6 ++----
>  include/migration/vmstate.h | 1 -
>  include/qemu/typedefs.h     | 1 +
>  include/qom/cpu.h           | 4 ++--
>  target/alpha/cpu.h          | 2 +-
>  target/arm/cpu.h            | 2 +-
>  target/cris/cpu.h           | 2 +-
>  target/hppa/cpu.h           | 2 +-
>  target/i386/cpu.h           | 2 +-
>  target/lm32/cpu.h           | 2 +-
>  target/mips/internal.h      | 2 +-
>  target/openrisc/cpu.h       | 2 +-
>  target/ppc/cpu-qom.h        | 2 +-
>  target/ppc/cpu.h            | 2 +-
>  target/s390x/cpu.h          | 2 +-
>  target/sparc/cpu.h          | 2 +-
>  16 files changed, 17 insertions(+), 19 deletions(-)

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

Re: [Qemu-devel] [PATCH v2 14/29] migration: Move the VMStateDescription typedef to typedefs.h
Posted by Alex Bennée 6 years, 6 months ago
Markus Armbruster <armbru@redhat.com> writes:

> We declare incomplete struct VMStateDescription in a couple of places
> so we don't have to include migration/vmstate.h for the typedef.
> That's fine with me.  However, the next commit will drop
> migration/vmstate.h from a massive number of compiles.  Move the
> typedef to qemu/typedefs.h now, so I don't have to insert struct in
> front of VMStateDescription all over the place then.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  include/hw/qdev-core.h      | 6 ++----
>  include/migration/vmstate.h | 1 -
>  include/qemu/typedefs.h     | 1 +
>  include/qom/cpu.h           | 4 ++--
>  target/alpha/cpu.h          | 2 +-
>  target/arm/cpu.h            | 2 +-
>  target/cris/cpu.h           | 2 +-
>  target/hppa/cpu.h           | 2 +-
>  target/i386/cpu.h           | 2 +-
>  target/lm32/cpu.h           | 2 +-
>  target/mips/internal.h      | 2 +-
>  target/openrisc/cpu.h       | 2 +-
>  target/ppc/cpu-qom.h        | 2 +-
>  target/ppc/cpu.h            | 2 +-
>  target/s390x/cpu.h          | 2 +-
>  target/sparc/cpu.h          | 2 +-
>  16 files changed, 17 insertions(+), 19 deletions(-)
>
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index b870c8ceeb..e5b62dd2fc 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -35,8 +35,6 @@ typedef void (*DeviceReset)(DeviceState *dev);
>  typedef void (*BusRealize)(BusState *bus, Error **errp);
>  typedef void (*BusUnrealize)(BusState *bus, Error **errp);
>
> -struct VMStateDescription;
> -
>  /**
>   * DeviceClass:
>   * @props: Properties accessing state fields.
> @@ -112,7 +110,7 @@ typedef struct DeviceClass {
>      DeviceUnrealize unrealize;
>
>      /* device state */
> -    const struct VMStateDescription *vmsd;
> +    const VMStateDescription *vmsd;
>
>      /* Private to qdev / bus.  */
>      const char *bus_type;
> @@ -425,7 +423,7 @@ void device_class_set_parent_unrealize(DeviceClass *dc,
>                                         DeviceUnrealize dev_unrealize,
>                                         DeviceUnrealize *parent_unrealize);
>
> -const struct VMStateDescription *qdev_get_vmsd(DeviceState *dev);
> +const VMStateDescription *qdev_get_vmsd(DeviceState *dev);
>
>  const char *qdev_fw_name(DeviceState *dev);
>
> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> index c2bfa7a7f0..1fbfd099dd 100644
> --- a/include/migration/vmstate.h
> +++ b/include/migration/vmstate.h
> @@ -28,7 +28,6 @@
>  #define QEMU_VMSTATE_H
>
>  typedef struct VMStateInfo VMStateInfo;
> -typedef struct VMStateDescription VMStateDescription;
>  typedef struct VMStateField VMStateField;
>
>  /* VMStateInfo allows customized migration of objects that don't fit in
> diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
> index c32efb5b18..9e1283aacf 100644
> --- a/include/qemu/typedefs.h
> +++ b/include/qemu/typedefs.h
> @@ -101,6 +101,7 @@ typedef struct SHPCDevice SHPCDevice;
>  typedef struct SSIBus SSIBus;
>  typedef struct VirtIODevice VirtIODevice;
>  typedef struct Visitor Visitor;
> +typedef struct VMStateDescription VMStateDescription;
>
>  /*
>   * Pointer types
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index 5ee0046b62..ddb91bbaff 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -215,7 +215,7 @@ typedef struct CPUClass {
>      int (*write_elf32_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
>                                  void *opaque);
>
> -    const struct VMStateDescription *vmsd;
> +    const VMStateDescription *vmsd;
>      const char *gdb_core_xml_file;
>      gchar * (*gdb_arch_name)(CPUState *cpu);
>      const char * (*gdb_get_dynamic_xml)(CPUState *cpu, const char *xmlname);
> @@ -1108,7 +1108,7 @@ bool target_words_bigendian(void);
>  #ifdef NEED_CPU_H
>
>  #ifdef CONFIG_SOFTMMU
> -extern const struct VMStateDescription vmstate_cpu_common;
> +extern const VMStateDescription vmstate_cpu_common;
>  #else
>  #define vmstate_cpu_common vmstate_dummy
>  #endif
> diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h
> index b3e8a823e1..4619530660 100644
> --- a/target/alpha/cpu.h
> +++ b/target/alpha/cpu.h
> @@ -277,7 +277,7 @@ struct AlphaCPU {
>
>
>  #ifndef CONFIG_USER_ONLY
> -extern const struct VMStateDescription vmstate_alpha_cpu;
> +extern const VMStateDescription vmstate_alpha_cpu;
>  #endif
>
>  void alpha_cpu_do_interrupt(CPUState *cpu);
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index 94c990cddb..2cdde6c4bc 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -922,7 +922,7 @@ void arm_cpu_post_init(Object *obj);
>  uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz);
>
>  #ifndef CONFIG_USER_ONLY
> -extern const struct VMStateDescription vmstate_arm_cpu;
> +extern const VMStateDescription vmstate_arm_cpu;
>  #endif
>
>  void arm_cpu_do_interrupt(CPUState *cpu);
> diff --git a/target/cris/cpu.h b/target/cris/cpu.h
> index fb14ad51f1..aba0a66474 100644
> --- a/target/cris/cpu.h
> +++ b/target/cris/cpu.h
> @@ -183,7 +183,7 @@ struct CRISCPU {
>
>
>  #ifndef CONFIG_USER_ONLY
> -extern const struct VMStateDescription vmstate_cris_cpu;
> +extern const VMStateDescription vmstate_cris_cpu;
>  #endif
>
>  void cris_cpu_do_interrupt(CPUState *cpu);
> diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
> index e9fba96be9..4b816cc13a 100644
> --- a/target/hppa/cpu.h
> +++ b/target/hppa/cpu.h
> @@ -334,7 +334,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
>  int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx,
>                                int type, hwaddr *pphys, int *pprot);
>  extern const MemoryRegionOps hppa_io_eir_ops;
> -extern const struct VMStateDescription vmstate_hppa_cpu;
> +extern const VMStateDescription vmstate_hppa_cpu;
>  void hppa_cpu_alarm_timer(void *);
>  int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr);
>  #endif
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index 8b3dc5533e..ecd0ec0899 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -1516,7 +1516,7 @@ struct X86CPU {
>
>
>  #ifndef CONFIG_USER_ONLY
> -extern struct VMStateDescription vmstate_x86_cpu;
> +extern VMStateDescription vmstate_x86_cpu;
>  #endif
>
>  /**
> diff --git a/target/lm32/cpu.h b/target/lm32/cpu.h
> index c2bbfa2780..064c6b1267 100644
> --- a/target/lm32/cpu.h
> +++ b/target/lm32/cpu.h
> @@ -195,7 +195,7 @@ struct LM32CPU {
>
>
>  #ifndef CONFIG_USER_ONLY
> -extern const struct VMStateDescription vmstate_lm32_cpu;
> +extern const VMStateDescription vmstate_lm32_cpu;
>  #endif
>
>  void lm32_cpu_do_interrupt(CPUState *cpu);
> diff --git a/target/mips/internal.h b/target/mips/internal.h
> index b2b41a51ab..d5aa5490d3 100644
> --- a/target/mips/internal.h
> +++ b/target/mips/internal.h
> @@ -148,7 +148,7 @@ hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address,
>  #define cpu_signal_handler cpu_mips_signal_handler
>
>  #ifndef CONFIG_USER_ONLY
> -extern const struct VMStateDescription vmstate_mips_cpu;
> +extern const VMStateDescription vmstate_mips_cpu;
>  #endif
>
>  static inline bool cpu_mips_hw_interrupts_enabled(CPUMIPSState *env)
> diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h
> index f23b25262d..61ade1d4f0 100644
> --- a/target/openrisc/cpu.h
> +++ b/target/openrisc/cpu.h
> @@ -333,7 +333,7 @@ int print_insn_or1k(bfd_vma addr, disassemble_info *info);
>  #define cpu_signal_handler cpu_openrisc_signal_handler
>
>  #ifndef CONFIG_USER_ONLY
> -extern const struct VMStateDescription vmstate_openrisc_cpu;
> +extern const VMStateDescription vmstate_openrisc_cpu;
>
>  /* hw/openrisc_pic.c */
>  void cpu_openrisc_pic_init(OpenRISCCPU *cpu);
> diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h
> index be9b4c30c3..a2f202f021 100644
> --- a/target/ppc/cpu-qom.h
> +++ b/target/ppc/cpu-qom.h
> @@ -203,7 +203,7 @@ typedef struct PPCTimebase {
>      int64_t time_of_the_day_ns;
>  } PPCTimebase;
>
> -extern const struct VMStateDescription vmstate_ppc_timebase;
> +extern const VMStateDescription vmstate_ppc_timebase;
>
>  #define VMSTATE_PPC_TIMEBASE_V(_field, _state, _version) {            \
>      .name       = (stringify(_field)),                                \
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index c9beba2a5c..4ea33cf696 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -1255,7 +1255,7 @@ int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
>                                 int cpuid, void *opaque);
>  #ifndef CONFIG_USER_ONLY
>  void ppc_cpu_do_system_reset(CPUState *cs);
> -extern const struct VMStateDescription vmstate_ppc_cpu;
> +extern const VMStateDescription vmstate_ppc_cpu;
>  #endif
>
>  /*****************************************************************************/
> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
> index a606547b4d..3d9de25f7c 100644
> --- a/target/s390x/cpu.h
> +++ b/target/s390x/cpu.h
> @@ -163,7 +163,7 @@ struct S390CPU {
>
>
>  #ifndef CONFIG_USER_ONLY
> -extern const struct VMStateDescription vmstate_s390_cpu;
> +extern const VMStateDescription vmstate_s390_cpu;
>  #endif
>
>  /* distinguish between 24 bit and 31 bit addressing */
> diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
> index 8ed2250cd0..0d5b01efe5 100644
> --- a/target/sparc/cpu.h
> +++ b/target/sparc/cpu.h
> @@ -532,7 +532,7 @@ struct SPARCCPU {
>
>
>  #ifndef CONFIG_USER_ONLY
> -extern const struct VMStateDescription vmstate_sparc_cpu;
> +extern const VMStateDescription vmstate_sparc_cpu;
>  #endif
>
>  void sparc_cpu_do_interrupt(CPUState *cpu);


--
Alex Bennée