diff mbox

kvm tools: Wait for VCPU to reboot before returning

Message ID 1310413746-1530-1-git-send-email-levinsasha928@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sasha Levin July 11, 2011, 7:49 p.m. UTC
Wait until all VCPU threads have received the reboot signal and have
exited.

This prevents the occasional error messages when exiting kvm tools with the
ctrl a + x combo.

Reported-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/kvm-cpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
index 2f5d23c..5825ac9 100644
--- a/tools/kvm/kvm-cpu.c
+++ b/tools/kvm/kvm-cpu.c
@@ -422,6 +422,7 @@  static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu)
 void kvm_cpu__reboot(void)
 {
 	pthread_kill(kvm_cpus[0]->thread, SIGKVMEXIT);
+	pthread_join(kvm_cpus[0]->thread, NULL);
 }
 
 int kvm_cpu__start(struct kvm_cpu *cpu)