From ba67a003839dec19eb47176bf4af858c965f4f12 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 16 Jun 2008 11:25:16 -0700 Subject: Fix loading vcpu register state before system startup we now load registers only on the vcpu thread, but that is not ready when the system is starting up. so defer the loading until the thread is ready. fixes live migration. Signed-off-by: Avi Kivity --- qemu-kvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 553875be7..431e26d53 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -194,7 +194,7 @@ static void kvm_do_load_registers(void *_env) void kvm_load_registers(CPUState *env) { - if (kvm_enabled()) + if (kvm_enabled() && qemu_system_ready) on_vcpu(env, kvm_do_load_registers, env); } @@ -392,6 +392,8 @@ static int kvm_main_loop_cpu(CPUState *env) #endif cpu_single_env = env; + kvm_load_registers(env); + while (1) { while (!has_work(env)) kvm_main_loop_wait(env, 1000); -- cgit v1.2.3