From: "Elena V. Titova" Subject: [PATCH] xend: resume a guest domain after an unsuccessful live migration Date: Mon, 04 Feb 2013 11:24:36 +0400 Message-ID: <1359962676.5263.71.camel@connect.botik.ru> Reply-To: andia@pereslavl.ru 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.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hello. We use debian sarge, linux-image-3.2.0-3-amd64 and xen-4.1.3 on our servers. When a live migration is run the guest domain may not resume on a destination host and is destroyed on a source host. This patch fixes it by resuming the guest domain on a source host when a start of the guest domain was failed. git diff tools/python/xen/xend/XendCheckpoint.py diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py index fa09757..6b8765f 100644 --- a/tools/python/xen/xend/XendCheckpoint.py +++ b/tools/python/xen/xend/XendCheckpoint.py @@ -163,12 +163,16 @@ def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1,sock=None): dominfo.resumeDomain() else: if live and sock != None: + status = os.read(fd, 64) try: sock.shutdown(2) except: pass sock.close() + if status == "FAIL": + raise XendError("Restore failed") + dominfo.destroy() dominfo.testDeviceComplete() try: @@ -351,8 +355,14 @@ def restore(xd, fd, dominfo = None, paused = False, relocating = False): if not paused: dominfo.unpause() + if relocating: + os.write(fd, "SUCCESS") + return dominfo except Exception, exn: + if relocating: + os.write(fd, "FAIL") + dominfo.destroy() log.exception(exn) raise exn -- Elena Titova