ia64/xen-unstable

changeset 18502:6055360dbfe4

[IA64] xc_domain_save: Do not poll-wait for guest to shutdown.

This patch is ia64 counter part of 18452:59904b180078.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Thu Sep 25 11:47:53 2008 +0900 (2008-09-25)
parents 3d96f88fb220
children 325904748847
files tools/libxc/ia64/xc_ia64_linux_save.c
line diff
     1.1 --- a/tools/libxc/ia64/xc_ia64_linux_save.c	Thu Sep 18 17:54:15 2008 +0900
     1.2 +++ b/tools/libxc/ia64/xc_ia64_linux_save.c	Thu Sep 25 11:47:53 2008 +0900
     1.3 @@ -56,43 +56,18 @@ static int
     1.4  suspend_and_state(int (*suspend)(void), int xc_handle, int io_fd,
     1.5                    int dom, xc_dominfo_t *info)
     1.6  {
     1.7 -    int i = 0;
     1.8 -
     1.9      if (!(*suspend)()) {
    1.10          ERROR("Suspend request failed");
    1.11          return -1;
    1.12      }
    1.13  
    1.14 -retry:
    1.15 -
    1.16 -    if (xc_domain_getinfo(xc_handle, dom, 1, info) != 1) {
    1.17 +    if ( (xc_domain_getinfo(xc_handle, dom, 1, info) != 1) ||
    1.18 +         !info->shutdown || (info->shutdown_reason != SHUTDOWN_suspend) ) {
    1.19          ERROR("Could not get domain info");
    1.20          return -1;
    1.21      }
    1.22  
    1.23 -    if (info->shutdown && info->shutdown_reason == SHUTDOWN_suspend)
    1.24 -        return 0; // success
    1.25 -
    1.26 -    if (info->paused) {
    1.27 -        // try unpausing domain, wait, and retest
    1.28 -        xc_domain_unpause(xc_handle, dom);
    1.29 -
    1.30 -        ERROR("Domain was paused. Wait and re-test.");
    1.31 -        usleep(10000);  // 10ms
    1.32 -
    1.33 -        goto retry;
    1.34 -    }
    1.35 -
    1.36 -
    1.37 -    if(++i < 100) {
    1.38 -        ERROR("Retry suspend domain.");
    1.39 -        usleep(10000);  // 10ms
    1.40 -        goto retry;
    1.41 -    }
    1.42 -
    1.43 -    ERROR("Unable to suspend domain.");
    1.44 -
    1.45 -    return -1;
    1.46 +    return 0;
    1.47  }
    1.48  
    1.49  static inline int