Revision ff48eb5f cpus.c

b/cpus.c
223 223
    return err;
224 224
}
225 225

  
226
#ifdef CONFIG_IOTHREAD
227 226
static void dummy_signal(int sig)
228 227
{
229 228
}
230
#endif
231 229

  
232 230
#else /* _WIN32 */
233 231

  
......
259 257
#endif /* _WIN32 */
260 258

  
261 259
#ifndef CONFIG_IOTHREAD
260
static void qemu_kvm_init_cpu_signals(CPUState *env)
261
{
262
#ifndef _WIN32
263
    int r;
264
    sigset_t set;
265
    struct sigaction sigact;
266

  
267
    memset(&sigact, 0, sizeof(sigact));
268
    sigact.sa_handler = dummy_signal;
269
    sigaction(SIG_IPI, &sigact, NULL);
270

  
271
    sigemptyset(&set);
272
    sigaddset(&set, SIG_IPI);
273
    pthread_sigmask(SIG_BLOCK, &set, NULL);
274

  
275
    pthread_sigmask(SIG_BLOCK, NULL, &set);
276
    sigdelset(&set, SIG_IPI);
277
    sigdelset(&set, SIGBUS);
278
    r = kvm_set_signal_mask(env, &set);
279
    if (r) {
280
        fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));
281
        exit(1);
282
    }
283
#endif
284
}
285

  
262 286
int qemu_init_main_loop(void)
263 287
{
264 288
    cpu_set_debug_excp_handler(cpu_debug_handler);
......
284 308
            fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r));
285 309
            exit(1);
286 310
        }
311
        qemu_kvm_init_cpu_signals(env);
287 312
    }
288 313
}
289 314

  

Also available in: Unified diff