ia64/xen-unstable

changeset 16971:39ddd51318e9

Revert 16963:d29d74d4eeac and 16750:2ac0fd9fd4b4.
Continue to SIGKILL qemu-dm so that 'xm destroy' should always work
rather than hang if qemu-dm is in a bad state.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sun Feb 03 09:09:21 2008 +0000 (2008-02-03)
parents a47ac2495137
children aecbf98aa709
files tools/ioemu/target-i386-dm/helper2.c tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/ioemu/target-i386-dm/helper2.c	Sat Feb 02 13:40:43 2008 +0000
     1.2 +++ b/tools/ioemu/target-i386-dm/helper2.c	Sun Feb 03 09:09:21 2008 +0000
     1.3 @@ -637,7 +637,6 @@ int main_loop(void)
     1.4      int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
     1.5      char *qemu_file;
     1.6      fd_set fds;
     1.7 -    int ret = 0;
     1.8  
     1.9      buffered_io_timer = qemu_new_timer(rt_clock, handle_buffered_io,
    1.10  				       cpu_single_env);
    1.11 @@ -648,15 +647,10 @@ int main_loop(void)
    1.12  
    1.13      xenstore_record_dm_state("running");
    1.14      while (1) {
    1.15 -        while (!((vm_running && suspend_requested) || shutdown_requested))
    1.16 +        while (!(vm_running && suspend_requested))
    1.17              /* Wait up to 10 msec. */
    1.18              main_loop_wait(10);
    1.19  
    1.20 -        if (shutdown_requested) {
    1.21 -            ret = EXCP_INTERRUPT;
    1.22 -            break;
    1.23 -        }
    1.24 -
    1.25          fprintf(logfile, "device model saving state\n");
    1.26  
    1.27          /* Pull all outstanding ioreqs through the system */
    1.28 @@ -672,34 +666,17 @@ int main_loop(void)
    1.29          xenstore_record_dm_state("paused");
    1.30  
    1.31          /* Wait to be allowed to continue */
    1.32 -        while (suspend_requested && !shutdown_requested) {
    1.33 -            /*
    1.34 -             * Poll for shutdown via SDL every 10ms.
    1.35 -             * This is needed because SDL steals SIGTERM and only lets us
    1.36 -             * know about it after gui_update().
    1.37 -             */
    1.38 -            struct timeval tv;
    1.39 -            tv.tv_sec  = 0;
    1.40 -            tv.tv_usec = 10000;
    1.41 -
    1.42 +        while (suspend_requested) {
    1.43              FD_ZERO(&fds);
    1.44              FD_SET(xenstore_fd(), &fds);
    1.45 -            if (select(xenstore_fd() + 1, &fds, NULL, NULL, &tv) > 0)
    1.46 +            if (select(xenstore_fd() + 1, &fds, NULL, NULL, NULL) > 0)
    1.47                  xenstore_process_event(NULL);
    1.48 -
    1.49 -            /* Refresh SDL state and pick up any pending shutdown request. */
    1.50 -            gui_update();
    1.51 -        }
    1.52 -
    1.53 -        if (shutdown_requested) {
    1.54 -            ret = EXCP_INTERRUPT;
    1.55 -            break;
    1.56          }
    1.57  
    1.58          xenstore_record_dm_state("running");
    1.59      }
    1.60  
    1.61 -    return ret;
    1.62 +    return 0;
    1.63  }
    1.64  
    1.65  void destroy_hvm_domain(void)
     2.1 --- a/tools/python/xen/xend/image.py	Sat Feb 02 13:40:43 2008 +0000
     2.2 +++ b/tools/python/xen/xend/image.py	Sun Feb 03 09:09:21 2008 +0000
     2.3 @@ -329,7 +329,7 @@ class ImageHandler:
     2.4              return
     2.5          if self.pid:
     2.6              try:
     2.7 -                os.kill(self.pid, signal.SIGTERM)
     2.8 +                os.kill(self.pid, signal.SIGKILL)
     2.9              except OSError, exn:
    2.10                  log.exception(exn)
    2.11              try: