Handle terminating signals (Gerd Hoffmann)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 21 Aug 2008 20:08:03 +0000 (20:08 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 21 Aug 2008 20:08:03 +0000 (20:08 +0000)
commit8d05f919af2ff3dd2446b7329bae29cb08186868
treefe847d34b59f7c579a4697dea158d530686843be
parentb5ef2d61b4610d5d7aeba3980a8d18c7fb424dd5
Handle terminating signals (Gerd Hoffmann)

This patch makes qemu handle signals better.  It sets the request_shutdown
flag, making the main_loop exit and qemu taking the usual exit route, with
atexit handlers being called and so on, instead of qemu just being killed
by the signal.

To avoid calling vm_start() from the signal handler main_loop() got an
additional check so qemu_system_shutdown_request() works even when the
vm is in stopped state.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5055 c046a42c-6fe2-441c-8c8c-71466251a162
curses.c
sdl.c
vl.c