# HG changeset patch # User emellor@leeni.uk.xensource.com # Date 1131548917 -3600 # Node ID 136b2d20dc81db51924aee54c8ec4ce6232defa2 # Parent b2ea26d2099ac6a1d774cbc432c988fe0bc5d2d6 Cope with the ValueError exception that we get if you use Xend with the recent change to parsing memory configuration against a store with entries written by an older Xend. Added maxmem field to list of things to be read from the store on recreate. diff -r b2ea26d2099a -r 136b2d20dc81 tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py Wed Nov 09 14:53:12 2005 +0100 +++ b/tools/python/xen/xend/XendDomainInfo.py Wed Nov 09 16:08:37 2005 +0100 @@ -393,11 +393,22 @@ class XendDomainInfo: ("on_crash", str), ("image", str), ("memory", int), + ("maxmem", int), ("vcpus", int), ("vcpu_avail", int), ("start_time", float)) - from_store = self.gatherVm(*params) + try: + from_store = self.gatherVm(*params) + except ValueError, exn: + # One of the int/float entries in params has a corresponding store + # entry that is invalid. We recover, because older versions of + # Xend may have put the entry there (memory/target, for example), + # but this is in general a bad situation to have reached. + log.exception( + "Store corrupted at %s! Domain %d's configuration may be " + "affected.", self.vmpath, self.domid) + return map(lambda x, y: useIfNeeded(x[0], y), params, from_store)