From: Anthony L. <ali...@us...> - 2008-05-08 03:17:54
|
I discovered this while testing virtio save/restore this evening. After sleeping, cpu_single_env can change so we have to make sure to restore it. This applies on top of my IO thread series. Signed-off-by: Anthony Liguori <ali...@us...> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index cc8f292..0990af6 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -246,8 +246,11 @@ static void pause_all_threads(void) vcpu_info[i].stop = 1; pthread_kill(vcpu_info[i].thread, SIG_IPI); } - while (!all_threads_paused()) + while (!all_threads_paused()) { + CPUState *env = cpu_single_env; pthread_cond_wait(&qemu_pause_cond, &qemu_mutex); + cpu_single_env = env; + } } static void resume_all_threads(void) |