From 13eed94ed5617b98e657163490584dc2a0cc4b32 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Tue, 23 Apr 2013 10:29:36 +0200 Subject: cpu: Call cpu_synchronize_post_init() from DeviceClass::realize() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If hotplugged, synchronize CPU state to KVM. Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Signed-off-by: Andreas Färber --- qom/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qom/cpu.c') diff --git a/qom/cpu.c b/qom/cpu.c index e242dcb..66f7c00 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -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) -- cgit v1.1