* QEMU/KVM: make sure all vcpus are paused before saving state
@ 2008-04-09 21:58 Marcelo Tosatti
2008-04-11 12:40 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Tosatti @ 2008-04-09 21:58 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel
Make sure that all threads are paused in userspace before saving machine
state.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
--- kvm-userspace.io/qemu/qemu-kvm.c
+++ kvm-userspace.io/qemu/qemu-kvm.c
@@ -244,7 +244,7 @@ static int all_threads_paused(void)
int i;
for (i = 0; i < smp_cpus; ++i)
- if (vcpu_info[i].stopped)
+ if (vcpu_info[i].stop)
return 0;
return 1;
}
@@ -257,8 +257,12 @@ 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()) {
+ pthread_mutex_unlock(&qemu_mutex);
kvm_eat_signal(&io_signal_table, NULL, 1000);
+ pthread_mutex_lock(&qemu_mutex);
+ cpu_single_env = NULL;
+ }
}
static void resume_all_threads(void)
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: QEMU/KVM: make sure all vcpus are paused before saving state
2008-04-09 21:58 QEMU/KVM: make sure all vcpus are paused before saving state Marcelo Tosatti
@ 2008-04-11 12:40 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2008-04-11 12:40 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm-devel
Marcelo Tosatti wrote:
> Make sure that all threads are paused in userspace before saving machine
> state.
>
>
Applied, thanks.
--
Any sufficiently difficult bug is indistinguishable from a feature.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-11 12:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09 21:58 QEMU/KVM: make sure all vcpus are paused before saving state Marcelo Tosatti
2008-04-11 12:40 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox