]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Stop VCPUs before freeing struct kvm
authorSasha Levin <levinsasha928@gmail.com>
Sat, 2 Jul 2011 23:52:11 +0000 (02:52 +0300)
committerPekka Enberg <penberg@kernel.org>
Sat, 2 Jul 2011 10:07:45 +0000 (13:07 +0300)
Not stopping VCPUs before leads to seg faults and other errors due to
synchronization between threads.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/term.c

index a0cb03f4bb13cf97436f93f6f05cfec83a56e4c2..2a3e1f0b12574d1f4a52b05f8c6f91dc59fdd332 100644 (file)
@@ -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);