Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > aadbe78a25743146bb784eee19f007c5 > files > 12

kvm-83-164.el5_5.9.src.rpm

From 6adc9ca90251a4ecd4aca78e8478c6f64f05b08a Mon Sep 17 00:00:00 2001
From: Yaniv Kamay <yaniv@qumranet.com>
Date: Sun, 21 Dec 2008 15:00:22 +0200
Subject: [PATCH 11/54] qemu: always install SIGIO handler

RH-Type: improvement(qxl)
RH-Upstream-status: pending
---
 qemu/vl.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/qemu/vl.c b/qemu/vl.c
index 1034240..f7c1f74 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -1461,6 +1461,29 @@ static int fcntl_setfl(int fd, int flag)
 
 #define RTC_FREQ 1024
 
+static void sigio_handler(int signum)
+{
+    CPUState *env = cpu_single_env;
+
+    if (env) {
+        cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+#ifdef USE_KQEMU
+        if (env->kqemu_enabled)
+            kqemu_cpu_interrupt(env);
+#endif
+    }
+}
+
+static void init_sigio_handler()
+{
+    struct sigaction act;
+
+    sigfillset(&act.sa_mask);
+    act.sa_flags = 0;
+    act.sa_handler = sigio_handler;
+    sigaction(SIGIO, &act, NULL);
+}
+
 static void enable_sigio_timer(int fd)
 {
     struct sigaction act;
@@ -4851,6 +4874,7 @@ int main(int argc, char **argv, char **envp)
     }
 #endif
     init_monitor_commands();
+    init_sigio_handler();
     register_machines();
     machine = first_machine;
     cpu_model = NULL;
-- 
1.6.1