qemu-e2k/include/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
..
apic_internal.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
apic-msidef.h
apic.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
ich9.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
intel_iommu.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ioapic_internal.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ioapic.h ioapic: use TYPE_FOO MACRO than constant string 2019-01-09 11:33:47 +01:00
microvm.h hw/i386: Introduce the microvm machine type 2019-10-22 09:39:54 +02:00
pc.h hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass 2019-11-19 10:01:34 +01:00
topology.h i386: Update new x86_apicid parsing rules with die_offset support 2019-07-05 17:08:03 -03:00
x86-iommu.h Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
x86.h hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass 2019-11-19 10:01:34 +01:00