qemu-patch-raspberry4/hw/i386
Liam Merwick 2f34ebf222 hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass
Attempting to migrate a VM using the microvm machine class results in the source
QEMU aborting with the following message/backtrace:

target/i386/machine.c:955:tsc_khz_needed: Object 0x555556608fa0 is not an
instance of type generic-pc-machine

abort()
object_class_dynamic_cast_assert()
vmstate_save_state_v()
vmstate_save_state()
vmstate_save()
qemu_savevm_state_complete_precopy()
migration_thread()
migration_thread()
migration_thread()
qemu_thread_start()
start_thread()
clone()

The access to the machine class returned by MACHINE_GET_CLASS() in
tsc_khz_needed() is crashing as it is trying to dereference a different
type of machine class object (TYPE_PC_MACHINE) to that of this microVM.

This can be resolved by extending the changes in the following commit
f0bb276bf8 ("hw/i386: split PCMachineState deriving X86MachineState from it")
and moving the save_tsc_khz field in PCMachineClass to X86MachineClass.

Fixes: f0bb276bf8 ("hw/i386: split PCMachineState deriving X86MachineState from it")
Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Message-Id: <1574075605-25215-1-git-send-email-liam.merwick@oracle.com>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-11-19 10:01:34 +01:00
..
kvm migration: Do not re-read the clock on pre_save in case of paused guest 2019-09-03 14:39:46 -03:00
xen hw/pci-host/piix: Define and use the PIIX IRQ Route Control Registers 2019-11-05 23:33:12 +01:00
acpi-build.c virtio, pci: fixes 2019-11-07 11:56:19 +00:00
acpi-build.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
amd_iommu.c hw/i386: split PCMachineState deriving X86MachineState from it 2019-10-22 09:39:50 +02:00
amd_iommu.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
e820_memory_layout.c hw/i386/pc: Extract e820 memory layout code 2019-09-16 17:13:07 +02:00
e820_memory_layout.h hw/i386/pc: Extract e820 memory layout code 2019-09-16 17:13:07 +02:00
fw_cfg.c hw/i386/pc: Extract the x86 generic fw_cfg code 2019-09-16 17:13:09 +02:00
fw_cfg.h hw/i386/pc: Extract the x86 generic fw_cfg code 2019-09-16 17:13:09 +02:00
intel_iommu.c hw/i386: split PCMachineState deriving X86MachineState from it 2019-10-22 09:39:50 +02:00
intel_iommu_internal.h intel_iommu: Drop extended root field 2019-04-02 11:49:14 -04:00
Kconfig hw/pci-host: Rename incorrectly named 'piix' as 'i440fx' 2019-11-05 23:33:12 +01:00
kvmvapic.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
Makefile.objs hw/i386: Introduce the microvm machine type 2019-10-22 09:39:54 +02:00
microvm.c microvm: fix memory leak in microvm_fix_kernel_cmdline 2019-11-19 10:00:36 +01:00
multiboot.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
multiboot.h refer to FWCfgState explicitly 2013-06-02 18:14:02 +03:00
pc.c hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass 2019-11-19 10:01:34 +01:00
pc_piix.c hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass 2019-11-19 10:01:34 +01:00
pc_q35.c hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass 2019-11-19 10:01:34 +01:00
pc_sysfw.c hw/i386/pc: move shared x86 functions to x86.c and export them 2019-10-22 09:38:42 +02:00
trace-events intel_iommu: Drop extended root field 2019-04-02 11:49:14 -04:00
vmmouse.c i386/vmmouse: Properly reset state 2019-09-03 14:39:46 -03:00
vmport.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
x86-iommu.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
x86.c hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass 2019-11-19 10:01:34 +01:00