int qemu_cpu_self(void *_env) { CPUState *env = _env; QemuThread this; qemu_thread_self(&this); return qemu_thread_equal(&this, env->thread); }
void vm_stop(int reason) { QemuThread me; qemu_thread_self(&me); if (!qemu_thread_equal(&me, &io_thread)) { qemu_system_vmstop_request(reason); /* * FIXME: should not return to device code in case * vm_stop() has been requested. */ if (cpu_single_env) { cpu_exit(cpu_single_env); cpu_single_env->stop = 1; } return; } do_vm_stop(reason); }