Don't quit IO thread before all vcpus are stopped
Call pause_all_threads() before exiting the i/o thread
main loop.
This scenario happened on system_powerdown request:
The vcpu eventually makes pm_ioport_writew (soft power off)
access that calls qemu_system_shutdown_request.
It causes the i/o thread to exit although the vcpu did not
exit yet.
One of the symptoms is that vcpu may trigger timers thus
causing a segfault since the i/o thread stopped the timer.
Signed-off-by: Dor Laor <dor.laor@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>