cpu: Move AVR target vmsd field from CPUClass to DeviceClass
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Mon, 17 May 2021 10:51:30 +0000 (12:51 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 26 May 2021 22:33:59 +0000 (15:33 -0700)
See rationale in previous commit. Targets should use the vmsd field
of DeviceClass, not CPUClass. As migration is not important on the
AVR target, break the migration compatibility and set the DeviceClass
vmsd field. To feel safer, increment the vmstate version.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210517105140.1062037-14-f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/avr/cpu.c
target/avr/machine.c

index 37a8ebcc86fb712e055fbbaf8fd5d79db336b6e4..3353bcb9fc79d774f845139d28ef9234bd15bd38 100644 (file)
@@ -213,7 +213,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data)
     cc->set_pc = avr_cpu_set_pc;
     cc->memory_rw_debug = avr_cpu_memory_rw_debug;
     cc->get_phys_page_debug = avr_cpu_get_phys_page_debug;
-    cc->legacy_vmsd = &vms_avr_cpu;
+    dc->vmsd = &vms_avr_cpu;
     cc->disas_set_info = avr_cpu_disas_set_info;
     cc->gdb_read_register = avr_cpu_gdb_read_register;
     cc->gdb_write_register = avr_cpu_gdb_write_register;
index de264f57c33a633c9743410204b220ee892a7e18..16f7a3e031d743d5c1c2909ad7e2201f7e8639f4 100644 (file)
@@ -98,8 +98,8 @@ static const VMStateInfo vms_eind = {
 
 const VMStateDescription vms_avr_cpu = {
     .name = "cpu",
-    .version_id = 0,
-    .minimum_version_id = 0,
+    .version_id = 1,
+    .minimum_version_id = 1,
     .fields = (VMStateField[]) {
         VMSTATE_UINT32(env.pc_w, AVRCPU),
         VMSTATE_UINT32(env.sp, AVRCPU),