Skip to contentSkip to conversation

kvm tools: Fix SDL exit on window close

PATCH In review Sasha Levin 2 participants 2 messages Oct 25, 2011 – Oct 26, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm tools: Fix SDL exit on window close

We've changed IPC to use sockets instead of signals, but the process of closing the SDL window was still trigerring an exit signal causing an ugly message and not cleaning up after itself.

This patch switches that to use the proper method of cleaning up.

---
 tools/kvm/ui/sdl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
tools/kvm/ui/sdl.c +2 -1
index b84cd66..5bf11fa 100644
@@ -4,6 +4,7 @@
 #include "kvm/i8042.h"
 #include "kvm/util.h"
 #include "kvm/kvm.h"
+#include "kvm/kvm-cpu.h"
 
 #include <SDL/SDL.h>
 #include <pthread.h>
@@ -254,7 +255,7 @@ static void *sdl__thread(void *p)
 		SDL_Delay(1000 / FRAME_RATE);
 	}
 exit:
-	kill(0, SIGKVMSTOP);
+	kvm_cpu__reboot();
 
 	return NULL;
 }
Signature · 1 line
1.7.7
#1 lore raw
Quoted 5 lines · Sasha Levin

We've changed IPC to use sockets instead of signals, but the process of closing the SDL window was still trigerring an exit signal causing an ugly message and not cleaning up after itself.

This patch switches that to use the proper method of cleaning up.

The patch works, thanks.

Osier