WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] xend: destroy restored domain when its device do

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] xend: destroy restored domain when its device doesn't exist
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Wed, 27 Jan 2010 10:55:09 +0900
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Tue, 26 Jan 2010 17:55:35 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <7kmy01xrzr.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <7kockhxvc2.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx> <7kmy01xrzr.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The breakage of migration to localhost happens on xen-3.4 only.
xen-4.0 is OK since c/s 20080 fixed it.
So my patch can be applied to xen-4.0.
I attach it again.

Thanks,
Kouya

Kouya Shimura writes:
> Sorry, this patch breaks migration to localhost.
> Let me think about it.
> 
> -- Kouya
> 
> Kouya Shimura writes:
> > A migrated domain keeps on running even though its disk doesn't exist.
> > This situation must be undesirable.
> > 
> > Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
> > 
> > diff -r 36159ea86bbd tools/python/xen/xend/XendCheckpoint.py
> > --- a/tools/python/xen/xend/XendCheckpoint.py       Tue Jan 19 13:59:28 
> > 2010 +0000
> > +++ b/tools/python/xen/xend/XendCheckpoint.py       Tue Jan 26 13:49:28 
> > 2010 +0900
> > @@ -337,19 +337,18 @@ def restore(xd, fd, dominfo = None, paus
> >  
> >          try:
> >              dominfo.waitForDevices() # Wait for backends to set up
> > -        except Exception, exn:
> > -            log.exception(exn)
> > -
> > -        if lock:
> > -            XendDomain.instance().domains_lock.acquire()
> > +        finally:
> > +            if lock:
> > +                XendDomain.instance().domains_lock.acquire()
> >  
> >          if not paused:
> >              dominfo.unpause()
> >  
> >          return dominfo
> > -    except:
> > +    except Exception, exn:
> >          dominfo.destroy()
> > -        raise
> > +        log.exception(exn)
> > +        raise exn
> >  
> >  
> >  class RestoreInputHandler:
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@xxxxxxxxxxxxxxxxxxx
> > http://lists.xensource.com/xen-devel
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

A migrated domain keeps on running even though its disk doesn't exist.
This situation must be undesirable.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 2636e5619708 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Tue Jan 26 15:54:40 2010 +0000
+++ b/tools/python/xen/xend/XendCheckpoint.py   Wed Jan 27 10:49:04 2010 +0900
@@ -344,19 +344,18 @@ def restore(xd, fd, dominfo = None, paus
 
         try:
             dominfo.waitForDevices() # Wait for backends to set up
-        except Exception, exn:
-            log.exception(exn)
-
-        if lock:
-            XendDomain.instance().domains_lock.acquire()
+        finally:
+            if lock:
+                XendDomain.instance().domains_lock.acquire()
 
         if not paused:
             dominfo.unpause()
 
         return dominfo
-    except:
+    except Exception, exn:
         dominfo.destroy()
-        raise
+        log.exception(exn)
+        raise exn
 
 
 class RestoreInputHandler:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>