This also means switching to the CONFIG_IOTHREAD version of qemu_main_loop_start and clean up some related patches of upstream code. Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> --- cpus.c | 50 +++----------------------------------------------- qemu-kvm.h | 1 - sysemu.h | 2 -- vl.c | 17 ++--------------- 4 files changed, 5 insertions(+), 65 deletions(-) diff --git a/cpus.c b/cpus.c index 23c6ccd..a4bac1a 100644 --- a/cpus.c +++ b/cpus.c @@ -546,11 +546,13 @@ int qemu_init_main_loop(void) return qemu_event_init(); } +#ifndef CONFIG_IOTHREAD void qemu_main_loop_start(void) { } +#endif /* !CONFIG_IOTHREAD */ void qemu_init_vcpu(void *_env) { CPUState *env = _env; @@ -681,13 +683,13 @@ int qemu_init_main_loop(void) return 0; } +#endif /* UNUSED_IOTHREAD_IMPL */ void qemu_main_loop_start(void) { qemu_system_ready = 1; qemu_cond_broadcast(&qemu_system_cond); } -#endif /* UNUSED_IOTHREAD_IMPL */ void run_on_cpu(CPUState *env, void (*func)(void *data), void *data) { @@ -1273,16 +1275,6 @@ static void setup_kernel_sigmask(CPUState *env) kvm_set_signal_mask(env, &set); } -static void qemu_kvm_system_reset(void) -{ - pause_all_vcpus(); - - cpu_synchronize_all_states(); - qemu_system_reset(); - - resume_all_vcpus(); -} - static int kvm_main_loop_cpu(CPUState *env) { while (1) { @@ -1367,42 +1359,6 @@ bool qemu_system_is_ready(void) return qemu_system_ready; } -int kvm_main_loop(void) -{ - int r; - - qemu_system_ready = 1; - qemu_cond_broadcast(&qemu_system_cond); - - while (1) { - main_loop_wait(0); - if (qemu_shutdown_requested()) { - monitor_protocol_event(QEVENT_SHUTDOWN, NULL); - if (qemu_no_shutdown()) { - vm_stop(VMSTOP_SHUTDOWN); - } else { - break; - } - } else if (qemu_powerdown_requested()) { - monitor_protocol_event(QEVENT_POWERDOWN, NULL); - qemu_irq_raise(qemu_system_powerdown); - } else if (qemu_reset_requested()) { - qemu_kvm_system_reset(); - } else if (qemu_debug_requested()) { - vm_stop(VMSTOP_DEBUG); - } - if ((r = qemu_vmstop_requested())) { - vm_stop(r); - } - } - - bdrv_close_all(); - pause_all_vcpus(); - qemu_mutex_unlock(&qemu_global_mutex); - - return 0; -} - static void qemu_kvm_init_main_loop(void) { sigset_t mask; diff --git a/qemu-kvm.h b/qemu-kvm.h index a577eba..2420f82 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -266,7 +266,6 @@ struct kvm_pit_state { #endif /* !CONFIG_KVM */ int kvm_create_vcpu(CPUState *env); -int kvm_main_loop(void); int kvm_init_ap(void); void kvm_save_lapic(CPUState *env); void kvm_load_lapic(CPUState *env); diff --git a/sysemu.h b/sysemu.h index 0d4f923..560210d 100644 --- a/sysemu.h +++ b/sysemu.h @@ -48,8 +48,6 @@ int qemu_reset_requested_get(void); int qemu_shutdown_requested(void); int qemu_reset_requested(void); int qemu_powerdown_requested(void); -int qemu_debug_requested(void); -int qemu_vmstop_requested(void); void qemu_system_killed(int signal, pid_t pid); void qemu_kill_report(void); extern qemu_irq qemu_system_powerdown; diff --git a/vl.c b/vl.c index e17094a..0bbd4e4 100644 --- a/vl.c +++ b/vl.c @@ -1164,13 +1164,6 @@ static int powerdown_requested; static int debug_requested; static int vmstop_requested; -int qemu_no_shutdown(void) -{ - int r = no_shutdown; - no_shutdown = 0; - return r; -} - int qemu_shutdown_requested_get(void) { return shutdown_requested; @@ -1218,14 +1211,14 @@ int qemu_powerdown_requested(void) return r; } -int qemu_debug_requested(void) +static int qemu_debug_requested(void) { int r = debug_requested; debug_requested = 0; return r; } -int qemu_vmstop_requested(void) +static int qemu_vmstop_requested(void) { int r = vmstop_requested; vmstop_requested = 0; @@ -1372,12 +1365,6 @@ static void main_loop(void) #endif int r; - if (kvm_enabled()) { - kvm_main_loop(); - cpu_disable_ticks(); - return; - } - qemu_main_loop_start(); for (;;) { -- 1.7.1 -- 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