direct-io.hg

changeset 7713:136b2d20dc81

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.
author emellor@leeni.uk.xensource.com
date Wed Nov 09 16:08:37 2005 +0100 (2005-11-09)
parents b2ea26d2099a
children 5823dbfbb4cd ad6a208992cc 79e8991af6b4 4aeb53ba2890
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Nov 09 14:53:12 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Nov 09 16:08:37 2005 +0100
     1.3 @@ -393,11 +393,22 @@ class XendDomainInfo:
     1.4                    ("on_crash",     str),
     1.5                    ("image",        str),
     1.6                    ("memory",       int),
     1.7 +                  ("maxmem",       int),
     1.8                    ("vcpus",        int),
     1.9                    ("vcpu_avail",   int),
    1.10                    ("start_time", float))
    1.11  
    1.12 -        from_store = self.gatherVm(*params)
    1.13 +        try:
    1.14 +            from_store = self.gatherVm(*params)
    1.15 +        except ValueError, exn:
    1.16 +            # One of the int/float entries in params has a corresponding store
    1.17 +            # entry that is invalid.  We recover, because older versions of
    1.18 +            # Xend may have put the entry there (memory/target, for example),
    1.19 +            # but this is in general a bad situation to have reached.
    1.20 +            log.exception(
    1.21 +                "Store corrupted at %s!  Domain %d's configuration may be "
    1.22 +                "affected.", self.vmpath, self.domid)
    1.23 +            return
    1.24  
    1.25          map(lambda x, y: useIfNeeded(x[0], y), params, from_store)
    1.26