[PATCH] kvm tools: Stop guest if SDL window is closed

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

 



Send SIGKVMSTOP signal to the process if the SDL window is closed. This fixes
an annoying problem where closing the window makes the guest seem like it froze
although it's really running in the background but the UI is unusable.

Cc: Asias He <asias.hejun@xxxxxxxxx>
Cc: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Prasad Joshi <prasadjoshi124@xxxxxxxxx>
Cc: Sasha Levin <levinsasha928@xxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/ui/sdl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/ui/sdl.c b/tools/kvm/ui/sdl.c
index aa3eff9..088cd29 100644
--- a/tools/kvm/ui/sdl.c
+++ b/tools/kvm/ui/sdl.c
@@ -3,9 +3,11 @@
 #include "kvm/framebuffer.h"
 #include "kvm/i8042.h"
 #include "kvm/util.h"
+#include "kvm/kvm.h"
 
 #include <SDL/SDL.h>
 #include <pthread.h>
+#include <signal.h>
 
 #define FRAME_RATE		25
 
@@ -127,6 +129,8 @@ static void *sdl__thread(void *p)
 		SDL_Delay(1000 / FRAME_RATE);
 	}
 exit:
+	kill(0, SIGKVMSTOP);
+
 	return NULL;
 }
 
-- 
1.7.0.4

--
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