summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2008-01-27 14:33:39 +0200
committerAvi Kivity <avi@qumranet.com>2008-01-27 17:03:36 +0200
commitd81e2a77ff41d8a37b3b6db74ff63b3fb1ce9b3e (patch)
treea860a3894a6a157ed415b5b7aca76994cd69edd2
parent280a2b1b77cab2d4c9b688a706dc25621b8ba744 (diff)
kvm: qemu: extract signal table initialization into a function
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--qemu/qemu-kvm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 90fa6072..43b52f39 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -356,6 +356,12 @@ static void *ap_main_loop(void *_env)
return NULL;
}
+static void qemu_kvm_init_signal_table(struct qemu_kvm_signal_table *sigtab)
+{
+ sigemptyset(&sigtab->sigset);
+ sigfillset(&sigtab->negsigset);
+}
+
static void kvm_add_signal(struct qemu_kvm_signal_table *sigtab, int signum)
{
sigaddset(&sigtab->sigset, signum);
@@ -368,8 +374,7 @@ int kvm_init_ap(void)
int i;
qemu_add_vm_change_state_handler(kvm_vm_state_change_handler, NULL);
- sigemptyset(&io_signal_table.sigset);
- sigfillset(&io_signal_table.negsigset);
+ qemu_kvm_init_signal_table(&io_signal_table);
kvm_add_signal(&io_signal_table, SIGIO);
kvm_add_signal(&io_signal_table, SIGALRM);
kvm_add_signal(&io_signal_table, SIGUSR2);