mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()
If hotplugged, synchronize CPU state to KVM. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
c4cfef5e8a
commit
13eed94ed5
5 changed files with 18 additions and 11 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "qom/cpu.h"
|
||||
#include "qemu-common.h"
|
||||
#include "sysemu/kvm.h"
|
||||
|
||||
void cpu_reset_interrupt(CPUState *cpu, int mask)
|
||||
{
|
||||
|
@ -57,6 +58,11 @@ static ObjectClass *cpu_common_class_by_name(const char *cpu_model)
|
|||
|
||||
static void cpu_common_realizefn(DeviceState *dev, Error **errp)
|
||||
{
|
||||
CPUState *cpu = CPU(dev);
|
||||
|
||||
if (dev->hotplugged) {
|
||||
cpu_synchronize_post_init(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static void cpu_class_init(ObjectClass *klass, void *data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue