From: john.levon@sun.com Subject: [PATCH] Fix xm save timeout with paused domains Date: Tue, 08 May 2007 09:05:28 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User john.levon@sun.com # Date 1178640308 25200 # Node ID eee26efa7fad6ff7ba9ab43dfec82995e9df4653 # Parent 62709adfbeec35215e97f7dbe0ab64c704fca26d Fix xm save timeout with paused domains. Don't start migrating a domU before it's unpaused. Signed-off-by: Max Zhen diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c --- a/tools/libxc/xc_domain_save.c +++ b/tools/libxc/xc_domain_save.c @@ -454,14 +454,26 @@ static void *map_frame_list_list(int xc_ shared_info_t *shinfo) { int count = 100; + int paused = 1; + xc_dominfo_t info; void *p; - while ( count-- && (shinfo->arch.pfn_to_mfn_frame_list_list == 0) ) + while ( count && (shinfo->arch.pfn_to_mfn_frame_list_list == 0) ) + { + if (paused && xc_domain_getinfo(xc_handle, dom, 1, &info) != 1) + { + ERROR("Could not get domain info"); + return NULL; + } + paused = info.paused; + if (!paused) + count--; /* start the counter only after dom is unpaused */ usleep(10000); + } if ( shinfo->arch.pfn_to_mfn_frame_list_list == 0 ) { - ERROR("Timed out waiting for frame list updated."); + ERROR("Timed out waiting for frame list update."); return NULL; }