[PATCH 9/9] kvm tools: Stop VCPUs before freeing struct kvm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Not stopping VCPUs before leads to seg faults and other errors due to
synchronization between threads.

Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
---
 tools/kvm/term.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/term.c b/tools/kvm/term.c
index a0cb03f..2a3e1f0 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);
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux