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-changelog

[Xen-changelog] Fix call to state_set inside preserve (was erroneously c

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix call to state_set inside preserve (was erroneously calling set_state).
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 04 Oct 2005 15:46:11 +0000
Delivery-date: Tue, 04 Oct 2005 15:43:41 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID 81246a2923d274188dc073ab13c8bf7db9fd175c
# Parent  b4c388a004c0753f5138f957388cf6ce53cdfc12
Fix call to state_set inside preserve (was erroneously calling set_state).
Tidy exception handling, and rename local 'channel' variable which was clashing
with the identical global name.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r b4c388a004c0 -r 81246a2923d2 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Oct  4 14:57:12 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Oct  4 15:27:16 2005
@@ -308,7 +308,7 @@
             return domlist[0]
     except Exception, err:
         # ignore missing domain
-        log.exception("domain_getinfo(%d) failed, ignoring", dom)
+        log.debug("domain_getinfo(%d) failed, ignoring: %s", dom, str(err))
     return None
 
 class XendDomainInfo:
@@ -733,21 +733,21 @@
                                                      self.domid)
             xc.domain_dumpcore(dom = self.domid, corefile = corefile)
 
-        except Exception, exn:
-            log.error("XendDomainInfo.dumpCore failed: id = %s name = %s: %s",
-                      self.domid, self.info['name'], str(exn))
-
-
-    def closeChannel(self, channel, entry):
+        except:
+            log.exception("XendDomainInfo.dumpCore failed: id = %s name = %s",
+                          self.domid, self.info['name'])
+
+
+    def closeChannel(self, chan, entry):
         """Close the given channel, if set, and remove the given entry in the
         store.  Nothrow guarantee."""
         
-        if channel:
-            channel.close()
+        if chan:
+            chan.close()
         try:
             self.removeDom(entry)
-        except Exception, exn:
-            log.exception(exn)
+        except:
+            log.exception('Removing entry %s failed', entry)
         
 
     def closeStoreChannel(self):
@@ -988,7 +988,7 @@
             self.configure()
             self.storeVmDetails()
             self.storeDomDetails()
-        except Exception:
+        except:
             log.exception('Domain construction failed')
             self.destroy()
             raise VmError('Creating domain failed: name=%s' %
@@ -1064,7 +1064,7 @@
 
         try:
             self.removeDom()
-        except Exception:
+        except:
             log.exception("Removing domain path failed.")
 
 
@@ -1073,7 +1073,7 @@
 
         try:
             self.removeVm()
-        except Exception:
+        except:
             log.exception("Removing VM path failed.")
 
 
@@ -1094,7 +1094,7 @@
         try:
             if self.domid is not None:
                 xc.domain_destroy(dom=self.domid)
-        except Exception:
+        except:
             log.exception("XendDomainInfo.destroy: xc.domain_destroy failed.")
 
         self.state_set(STATE_VM_TERMINATED)
@@ -1117,7 +1117,7 @@
                 for d in t.list(n):
                     try:
                         t.remove(d)
-                    except ex:
+                    except:
                         # Log and swallow any exceptions in removal --
                         # there's nothing more we can do.
                         log.exception(
@@ -1258,7 +1258,7 @@
                 except:
                     new_dom.destroy()
                     raise
-            except Exception, exn:
+            except:
                 log.exception('Failed to restart domain %d.', self.domid)
         finally:
             self.removeVm('xend/restart_in_progress')
@@ -1290,7 +1290,7 @@
         log.info("Preserving dead domain %s (%d).", self.info['name'],
                  self.domid)
         self.storeDom('xend/shutdown_completed', 'True')
-        self.set_state(STATE_VM_TERMINATED)
+        self.state_set(STATE_VM_TERMINATED)
 
 
     def generateShutdownName(self):

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix call to state_set inside preserve (was erroneously calling set_state)., Xen patchbot -unstable <=