From: "Zhai, Edwin" Subject: [PATCH] [HVM] fix a HVM save/restore race condition after r15639 Date: Mon, 13 Aug 2007 22:55:59 +0800 Message-ID: <20070813145559.GA11455@edwin-srv.sh.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Cc: xen-devel@lists.xensource.com, "Zhai, Edwin" List-Id: xen-devel@lists.xenproject.org --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Tim, The qemu save command sending is moved from saveInputHandler to refreshShutdown(too late) in r15639, so higher possibility that control panel read a not ready qemu state file especially for live migration. If reading happened before qemu create this file, a python missing file exception would occur. If before qemu put the record length in the file header as the last step, dest machine would try to restore a zero length qemu file to lead state lost in each device. Attached patch can fix it, pls. have a look. Thanks, -- best rgds, edwin --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="hvm_live_migration_fix_r15716.patch" Signed-off-by: Zhai Edwin diff -r 045b0034effd tools/python/xen/xend/XendCheckpoint.py --- a/tools/python/xen/xend/XendCheckpoint.py Fri Jul 20 10:58:04 2007 +0800 +++ b/tools/python/xen/xend/XendCheckpoint.py Mon Aug 13 22:20:09 2007 +0800 @@ -98,6 +98,9 @@ def save(fd, dominfo, network, live, dst log.info("Domain %d suspended.", dominfo.getDomid()) dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP3, domain_name) + if hvm: + dominfo.image.saveDeviceModel() + tochild.write("done\n") tochild.flush() log.debug('Written done') diff -r 045b0034effd tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py Fri Jul 20 10:58:04 2007 +0800 +++ b/tools/python/xen/xend/XendDomainInfo.py Mon Aug 13 22:20:09 2007 +0800 @@ -1184,8 +1184,6 @@ class XendDomainInfo: self._clearRestart() if reason == 'suspend': - if self._stateGet() != DOM_STATE_SUSPENDED: - self.image.saveDeviceModel() self._stateSet(DOM_STATE_SUSPENDED) # Don't destroy the domain. XendCheckpoint will do # this once it has finished. However, stop watching --tThc/1wpZn/ma/RB Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --tThc/1wpZn/ma/RB--