From: Sasha Levin Date: Sat, 2 Jul 2011 23:52:11 +0000 (+0300) Subject: kvm tools: Stop VCPUs before freeing struct kvm X-Git-Tag: next-20110824~3^2~145 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2bd24259f7841f724485049a226e7f37648cf637;p=karo-tx-linux.git kvm tools: Stop VCPUs before freeing struct kvm Not stopping VCPUs before leads to seg faults and other errors due to synchronization between threads. Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/term.c b/tools/kvm/term.c index a0cb03f4bb13..2a3e1f0b1257 100644 --- a/tools/kvm/term.c +++ b/tools/kvm/term.c @@ -10,6 +10,7 @@ #include "kvm/term.h" #include "kvm/util.h" #include "kvm/kvm.h" +#include "kvm/kvm-cpu.h" extern struct kvm *kvm; static struct termios orig_term; @@ -34,6 +35,7 @@ int term_getc(int who) if (term_got_escape) { term_got_escape = false; if (c == 'x') { + kvm_cpu__reboot(); kvm__delete(kvm); printf("\n # KVM session terminated.\n"); exit(1);