]> git.proxmox.com Git - mirror_qemu.git/commit
hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass
authorLiam Merwick <liam.merwick@oracle.com>
Mon, 18 Nov 2019 11:13:25 +0000 (11:13 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 19 Nov 2019 09:01:34 +0000 (10:01 +0100)
commit2f34ebf222d6a9367665a4bf78b8c861a988c1d0
tree688ab7b0b5b1f1a4a8486e168a305be635631854
parent62e9dc35824eee7caf6878a6ba89a46afa433289
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
f0bb276bf8d5 ("hw/i386: split PCMachineState deriving X86MachineState from it")
and moving the save_tsc_khz field in PCMachineClass to X86MachineClass.

Fixes: f0bb276bf8d5 ("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>
hw/i386/pc.c
hw/i386/pc_piix.c
hw/i386/pc_q35.c
hw/i386/x86.c
include/hw/i386/pc.h
include/hw/i386/x86.h
target/i386/machine.c