direct-io.hg

changeset 7230:b0bc53c9d5b6

Issue diagnostic if we find dying domains on Xend restart, because we will not
be able to show them any longer, as the paths in the store have gone. Don't
call cleanupVm when a domain dies, as localhost-migrating VMs will be blown
away by this (there is actually a race between the saving process and the
resuming process). This fixes bug #276.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Thu Oct 06 10:16:50 2005 +0100 (2005-10-06)
parents 971e7c7411b3
children 1cfe0875658d
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Thu Oct 06 10:13:11 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Thu Oct 06 10:16:50 2005 +0100
     1.3 @@ -146,7 +146,6 @@ class XendDomain:
     1.4          if info:
     1.5              del self.domains[domid]
     1.6              info.cleanupDomain()
     1.7 -            info.cleanupVm()
     1.8  
     1.9  
    1.10      def refresh(self):
    1.11 @@ -161,25 +160,31 @@ class XendDomain:
    1.12              else:
    1.13                  self._delete_domain(d.getDomid())
    1.14          for d in doms:
    1.15 -            if d not in self.domains and not doms[d]['dying']:
    1.16 -                try:
    1.17 -                    dominfo = XendDomainInfo.recreate(doms[d])
    1.18 -                    self._add_domain(dominfo)
    1.19 -                except:
    1.20 -                    if d == PRIV_DOMAIN:
    1.21 -                        log.exception(
    1.22 -                            "Failed to recreate information for domain "
    1.23 -                            "%d.  Doing nothing except crossing my "
    1.24 -                            "fingers.", d)
    1.25 -                    else:
    1.26 -                        log.exception(
    1.27 -                            "Failed to recreate information for domain "
    1.28 -                            "%d.  Destroying it in the hope of "
    1.29 -                            "recovery.", d)
    1.30 -                        try:
    1.31 -                            xc.domain_destroy(dom = d)
    1.32 -                        except:
    1.33 -                            log.exception('Destruction of %d failed.', d)
    1.34 +            if d not in self.domains:
    1.35 +                if doms[d]['dying']:
    1.36 +                    log.error(
    1.37 +                        'Cannot recreate information for dying domain %d.  '
    1.38 +                        'Xend will ignore this domain from now on.',
    1.39 +                        doms[d]['dom'])
    1.40 +                else:
    1.41 +                    try:
    1.42 +                        dominfo = XendDomainInfo.recreate(doms[d])
    1.43 +                        self._add_domain(dominfo)
    1.44 +                    except:
    1.45 +                        if d == PRIV_DOMAIN:
    1.46 +                            log.exception(
    1.47 +                                "Failed to recreate information for domain "
    1.48 +                                "%d.  Doing nothing except crossing my "
    1.49 +                                "fingers.", d)
    1.50 +                        else:
    1.51 +                            log.exception(
    1.52 +                                "Failed to recreate information for domain "
    1.53 +                                "%d.  Destroying it in the hope of "
    1.54 +                                "recovery.", d)
    1.55 +                            try:
    1.56 +                                xc.domain_destroy(dom = d)
    1.57 +                            except:
    1.58 +                                log.exception('Destruction of %d failed.', d)
    1.59  
    1.60  
    1.61      ## public: