summaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2013-04-23 10:29:36 +0200
committerAndreas Färber <afaerber@suse.de>2013-05-01 13:04:17 +0200
commit13eed94ed5617b98e657163490584dc2a0cc4b32 (patch)
tree04a4408ad812a18b1c161131827aa6a6fbdd70d1 /qom
parentc4cfef5e8a6371aa5e6577f2b980315c2dc46cfb (diff)
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>
Diffstat (limited to 'qom')
-rw-r--r--qom/cpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index e242dcbeb4..66f7c00c29 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)