Skip to contentSkip to conversation

xend: destroy restored domain when its device doesn't exist

PATCH In review Kouya Shimura 1 participant 3 messages Jan 26, 2010 – Jan 27, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xend: destroy restored domain when its device doesn't exist

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

tools/python/xen/xend/XendCheckpoint.py +6 -7
diff -r 36159ea86bbd tools/python/xen/xend/XendCheckpoint.py
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Sorry, this patch breaks migration to localhost.
Let me think about it.

-- Kouya

Quoted 38 lines · Kouya Shimura

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

diff -r 36159ea86bbd tools/python/xen/xend/XendCheckpoint.py

tools/python/xen/xend/XendCheckpoint.py +6 -7
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

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

Quoted 39 lines · Kouya Shimura

Sorry, this patch breaks migration to localhost.
Let me think about it.

-- Kouya

Quoted 33 lines · Kouya Shimura

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

diff -r 36159ea86bbd tools/python/xen/xend/XendCheckpoint.py

tools/python/xen/xend/XendCheckpoint.py +6 -7
@@ -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
 
 
Quoted 10 lines
Quoted 5 lines
tools/python/xen/xend/XendCheckpoint.py +0 -0
 class RestoreInputHandler:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

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

tools/python/xen/xend/XendCheckpoint.py +6 -7
diff -r 2636e5619708 tools/python/xen/xend/XendCheckpoint.py
@@ -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
[email protected]
http://lists.xensource.com/xen-devel