mirror_qemu/include
Philippe Mathieu-Daudé 744c72a837 cpu: Rename CPUClass vmsd -> legacy_vmsd
Quoting Peter Maydell [*]:

  There are two ways to handle migration for
  a CPU object:

  (1) like any other device, so it has a dc->vmsd that covers
  migration for the whole object. As usual for objects that are a
  subclass of a parent that has state, the first entry in the
  VMStateDescription field list is VMSTATE_CPU(), which migrates
  the cpu_common fields, followed by whatever the CPU's own migration
  fields are.

  (2) a backwards-compatible mechanism for CPUs that were
  originally migrated using manual "write fields to the migration
  stream structures". The on-the-wire migration format
  for those is based on the 'env' pointer (which isn't a QOM object),
  and the cpu_common part of the migration data is elsewhere.

  cpu_exec_realizefn() handles both possibilities:

  * for type 1, dc->vmsd is set and cc->vmsd is not,
    so cpu_exec_realizefn() does nothing, and the standard
    "register dc->vmsd for a device" code does everything needed

  * for type 2, dc->vmsd is NULL and so we register the
    vmstate_cpu_common directly to handle the cpu-common fields,
    and the cc->vmsd to handle the per-CPU stuff

  You can't change a CPU from one type to the other without breaking
  migration compatibility, which is why some guest architectures
  are stuck on the cc->vmsd form. New targets should use dc->vmsd.

To avoid new targets to start using type (2), rename cc->vmsd as
cc->legacy_vmsd. The correct field to implement is dc->vmsd (the
DeviceClass one).

See also commit b170fce3dd ("cpu: Register VMStateDescription
through CPUState") for historic background.

[*] https://www.mail-archive.com/qemu-devel@nongnu.org/msg800849.html

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210517105140.1062037-13-f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-05-26 15:33:59 -07:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block emulated nvme updates 2021-05-18 12:22:16 +01:00
chardev chardev: Fix yank with the chardev-change case 2021-04-01 15:27:44 +04:00
crypto crypto: add reload for QCryptoTLSCredsClass 2021-03-23 08:48:21 +01:00
disas Drop the deprecated lm32 target 2021-05-12 18:20:25 +02:00
exec accel/tcg: Keep TranslationBlock headers local to TCG 2021-05-26 15:33:59 -07:00
fpu softfloat: Introduce sh[lr]_double primitives 2021-05-16 07:13:51 -05:00
hw cpu: Rename CPUClass vmsd -> legacy_vmsd 2021-05-26 15:33:59 -07:00
io io: add qio_channel_readv_full_all_eof & qio_channel_readv_full_all helpers 2021-02-10 09:23:28 +00:00
libdecnumber include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
migration migrate/ram: remove "ram_bulk_stage" and "fpo_enabled" 2021-05-13 18:21:13 +01:00
monitor migrate: remove QMP/HMP commands for speed, downtime and cache size 2021-03-18 09:22:55 +00:00
net net: check the existence of peer before trying to pad 2021-04-23 11:11:28 +01:00
qapi Revert "hmp: Use QAPI NetdevInfo in hmp_info_network" 2021-04-08 17:33:59 +08:00
qemu coroutine-sleep: introduce qemu_co_sleep 2021-05-21 18:22:33 +01:00
qom qom: move user_creatable_add_opts logic to vl.c and QAPIfy it 2021-03-19 10:18:17 +01:00
scsi scsi: inline sg_io_sense_from_errno() into the callers. 2021-03-06 11:42:56 +01:00
semihosting semihosting: Move include/hw/semihosting/ -> include/semihosting/ 2021-03-10 15:34:12 +00:00
standard-headers m68k pull request 20210315 2021-03-17 10:38:27 +00:00
sysemu include/sysemu: Poison all accelerator CONFIG switches in common code 2021-05-14 12:31:44 +02:00
tcg accel/tcg: Reduce 'exec/tb-context.h' inclusion 2021-05-26 15:31:45 -07:00
ui ui/gtk: add clipboard support 2021-05-21 09:42:44 +02:00
user trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
elf.h Drop the deprecated unicore32 target 2021-05-12 18:20:52 +02:00
glib-compat.h glib-compat: accept G_TEST_SLOW environment variable 2021-05-04 14:15:35 +02:00
qemu-common.h qemu-common.h: Update copyright string to 2021 2021-03-09 22:19:24 +01:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-tcg.h